Skip to content

DOC: examples in reference documentation are not run through doctest #29544

@mattip

Description

@mattip

Issue with current documentation:

In #21070, we discussed the use of various strategies to doctest documentation. The issue was not resolved. In the mean time, spin has grown an option to check RST documentation, and running it on the reference documentation results in errors:

`spin check-tutorials doc/source/reference/`
FAILED ../../../../../doc/source/reference/array_api.rst::array_api.rst
FAILED ../../../../../doc/source/reference/arrays.classes.rst::arrays.classes.rst
FAILED ../../../../../doc/source/reference/arrays.datetime.rst::arrays.datetime.rst
FAILED ../../../../../doc/source/reference/arrays.nditer.cython.rst::arrays.nditer.cython.rst
FAILED ../../../../../doc/source/reference/arrays.promotion.rst::arrays.promotion.rst
FAILED ../../../../../doc/source/reference/constants.rst::constants.rst
FAILED ../../../../../doc/source/reference/distutils.rst::distutils.rst
FAILED ../../../../../doc/source/reference/c-api/coremath.rst::coremath.rst

Additionally, refguidecheck --help still shows the --rst and --doctests options, but they no longer exist as command line arguments

Idea or request for content:

  • Fix the --help string of refguide_check to reflect its true use (checking that __all__ is correct).
  • Fix or mark-as-skip the reference documentation examples
  • Rework the doctest test in circleCI to test the reference documentation

    numpy/.circleci/config.yml

    Lines 94 to 101 in 3049f4e

    spin check-docs -v
    spin check-tutorials -v
    # Currently, this does two checks not done by check-docs:
    # - validates ReST blocks (via validate_rst_syntax)
    # - checks that all of a module's `__all__` is reflected in the
    # module-level docstring autosummary
    echo calling python3 tools/refguide_check.py -v
    python3 tools/refguide_check.py -v

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions