-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Move "Attributes" and "Methods" below "Parameters" #571
Conversation
@lucascolley can you look to see if there is some test that could be added or modified that would have caught this? |
this test numpydoc/numpydoc/tests/test_docscrape.py Line 1258 in 54dbc89
|
I opened gh-572 in case we need higher-level discussion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I'm in favor of the change - class attributes and methods are typically key pieces of API, so ensuring that they render near the top of the docstring instead of being buried under the other sections seems like an improvement.
could someone approve CI please? :) |
Done! |
apologies for the iteration, I was being lazy and not running the tests - they all pass locally for me now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like everyone is in favor so in it goes, thanks @lucascolley !
thanks all! |
The numpydoc 1.8.0 release re-ordered some sections [1] in generated docs, which caused our missing reference extension to no longer ignore some entries since they are at different lines. Fixes matplotlib#28715 [1] numpy/numpydoc#571
Reorder the sections in
docscrape
to match the style guide. As per https://numpydoc.readthedocs.io/en/latest/format.html#class-docstring, the Attributes section should be "located below the Parameters section", which I am interpreting as directly below. It seems wrong for Attributes to be below Notes, References and Examples.x-ref scipy/scipy#21099