Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix various numpydoc style issues #16858

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

Merged
merged 7 commits into from
Mar 21, 2020
Merged

Fix various numpydoc style issues #16858

merged 7 commits into from
Mar 21, 2020

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Mar 20, 2020

PR Summary

I'm trying out numpydoc --validate and I'm not sure it's quite ready to use in CI yet, but there are some issues we can fix right now.

The ordering of sections in the numpydoc example is prescriptive, so we this changes some incorrectly ordered docstrings. Return values don't need a name when there's only one returned item. The rest is just small typos, for details see the commit messages.

PR Checklist

  • [n/a] Has Pytest style unit tests
  • Code is Flake 8 compliant
  • [n/a] New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • [n/a] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [n/a] Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

QuLogic added 3 commits March 20, 2020 17:24
The numpydoc sections listing is prescriptive, not descriptive, and the
order should be followed.
As noted before, the ordering for numpydoc is required, so Examples
should be last.
Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

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

can self merge after ci and fixing the points I listed.

QuLogic added 4 commits March 20, 2020 18:48
The numpydoc standard says there should not be a name if there's only
one return value.

Additionally, split up some return types that are tuples, because they
really should get separate entries for each value.
The standard is to keep quotes on their own line if the docstring covers
multiple lines.
@QuLogic
Copy link
Member Author

QuLogic commented Mar 20, 2020

I actually found quite a few more, see the diff.

@QuLogic QuLogic requested a review from anntzer March 20, 2020 22:50
@dstansby dstansby merged commit 3fe3d1a into matplotlib:master Mar 21, 2020
@dstansby dstansby added this to the v3.3.0 milestone Mar 21, 2020
@QuLogic QuLogic deleted the docs branch March 21, 2020 19:47
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.

3 participants