-
-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use doctest to execute examples in the docstring #2230
Comments
Interesting idea. I think Jeff or Taras proposed already something like that previously. Probably we wont be able to execute all doc snippets like ddp etc |
Of course, but it could help to keep most examples correct. |
Hello @sdesrozis, @vfdev-5, I'd like to work on the Ignite docs, can you provide some more details about this issue? Do we have to check each doctest for deprecation? Or do we have to refactor the doctests to a follow a particular template? |
A good first point would be to check whether I propose to focus on a few metrics. Select ones having a piece of example code inside the docstring and check how Anyway, I think this issue is a huge effort. We have to do it carefully according to others actions on the doc. Concretely the first point you would do should help to discuss and plan with the team. |
Since this is a fast developing library, I think it would be great to have doctests to stay updated on the docs. I will start looking into how doctests work with sphinx. |
@sdesrozis can we close this issue as solved or still there is something to be done ? |
It's done ! |
📚 Documentation
Example snippets are inserted into the docstring to show usage. However, these pieces of code might be deprecated, or might not work. The module
doctest
aims to execute the tests written in docstring and it works fine with sphinx. It could help to detect earlier doc issues and provide a better doc.Useful links
Note that some tests was written according to
doctest
ignite/ignite/handlers/timing.py
Line 30 in b3d9849
The main point is the refactoring of every test to pass the validation. It means have consistent pieces of code (define training fn, engines, etc.) to provide reproducible examples.
The text was updated successfully, but these errors were encountered: