question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docs: Doctest-able Examples

See original GitHub issue

DFFML is hoping to participate in Google Summer of Code (GSoC) under the Python Software Foundation umbrella. You can read all about what this means at http://python-gsoc.org/. This issue, and any others tagged gsoc and project are not general bugs, but project ideas which one could choose to write a proposal for. Issue tagged as gsoc and project can also be used as an example for what the scope of an idea for a project proposal might look like.

Project Idea: Doctest-able Examples

Project description: We have a lot of tests, and a lot of command line usage examples. However, we don’t have a lot of examples of how to use the plethora of classes, methods, and functions that are provided. The goal of this project is to create code examples for as much of the codebase as possible. We recently switched over numpy style docstrings. So adding information on the arguments, parameters, and return values of things would also be good, but is not a must for this project. The goal is to have working examples that can be tested via the sphinx doctest plugin. This will make it so that users can look at the docs for anything the github pages site, copy paste it into a Python file and it’ll work (since the examples you write will be tested on every CI run).

Skills: Python, git Difficulty level: Intermediate

Related Readings/Links:

Potential mentors: @pdxjohnny, @sudharsana-kjl

Getting Started: The tests have most of the code you’ll need, you’ll just need to adapt it from test code into example code.

A good first target would be the functions under the High Level API Docs as you can reference the quickstart guide for their usage.

The scripts/doctest.sh can be used to run the doctests.

What we want to see in your application: Describe how you intend to solve the problem, and give us some “stretch goals”, for example define some percentage of functions with testable examples as “success”, and some percentage as “exceeds”.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mHash1mcommented, Feb 26, 2020

@pdxjohnny Thanks, I’ll dive into it.

1reaction
pdxjohnnycommented, Feb 26, 2020

@mHash1m @kurianbenoy I’ve enabled the doctests in the CI and updated the issue with how to run the doctests.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docs: Everything needs doctestable examples · Issue #345 · intel ...
See dffml/util/data.py for an example. We need to follow the Numpy Style too. ... docs: Everything needs doctestable examples #345.
Read more >
Doctest Examples — great_expectations documentation
Use these examples during migration to testable docs. The block below is not rendered in the final documentation, but does affect the namespace....
Read more >
dffml/community - Gitter
/usr/src/dffml/docs/index.rst:59: WARNING: toctree contains reference to ... mentioned repos I have read documentation and it's working examples in python, ...
Read more >
Doctest functions with side effects - Rudolf is figuring out.
Let's add a @doc with a “doctestable” example: # humanized_weather.ex # ... @doc """ Displays current temperature at the given coordinates ...
Read more >
doctest — Test interactive Python examples — Python 3.11.1 ...
To perform regression testing by verifying that interactive examples from a test file or a test object work as expected. To write tutorial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found