Skip to content

Use doctest to execute examples in the docstring #2230

@sdesrozis

Description

@sdesrozis

📚 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

>>> from ignite.handlers import Timer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions