Skip to content
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

DOC Fix incorrect heading underline length in docstrings #22278

Merged

Conversation

rossbar
Copy link
Contributor

@rossbar rossbar commented Jan 24, 2022

numpydoc 1.2 (currently in rc1) raises a UserWarning during docstring parsing when the heading underline lengths do not match the length of the heading. This PR will prevent these warnings from being emitted during the docs build process when numpydoc 1.2 is released.

numpydoc 1.2 raises a UserWarning during docstring parsing when the
heading underline lengths do not match the length of the heading. This
PR will prevent these warnings from being emitted during the docs build
process when numpydoc 1.2 is released.
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @rossbar !

Now that the sections have the correct headings, it looks like there are numpy doc validation errors in the CI. All the errors are related to section ordering:

- GL07: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Examples

May you address those errors for the docstrings you fixed?

@rossbar rossbar force-pushed the doc/fix-heading-underline-length branch from 4a219f8 to 4088856 Compare January 24, 2022 06:15
@rossbar
Copy link
Contributor Author

rossbar commented Jan 24, 2022

Now that the sections have the correct headings, it looks like there are numpy doc validation errors in the CI.

On this topic - one of the new features of numpydoc 1.2 is that the numpydoc docstring validation can now be run during the doc build process. Just a heads up! The way scikit-learn has incorporated the validation into the test suite is neat though 🚀

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasjpfan thomasjpfan changed the title DOC: Fix instances of incorrect heading underline length in docstrings. DOC Fix instances of incorrect heading underline length in docstrings. Jan 24, 2022
@thomasjpfan thomasjpfan changed the title DOC Fix instances of incorrect heading underline length in docstrings. DOC Fix incorrect heading underline length in docstrings Jan 24, 2022
@thomasjpfan thomasjpfan merged commit 24106c2 into scikit-learn:main Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants