-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Clean up _axes.py docstrings #10138
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
Clean up _axes.py docstrings #10138
Conversation
@@ -111,7 +111,8 @@ class Axes(_AxesBase): | |||
aname = 'Axes' | |||
|
|||
def get_title(self, loc="center"): | |||
"""Get an axes title. | |||
""" | |||
Get an axes title. |
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.
@anntzer keeps doing the opposite. Personally, I prefer this form, but we should get some consensus to stop unnecessary churn.
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.
Does numpydoc have an opinion about this and does either form play badly with the autosummary
tables?
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.
I got the "same line" form from the example at the bottom of https://www.python.org/dev/peps/pep-0257/#multi-line-docstrings although tbh the text itself says "The summary line may be on the same line as the opening quotes or on the next line.".
Almost certain that any conformant tool should be able to handle both forms properly because it should pass docstrings through inspect.cleandoc, which does
All leading whitespace is removed from the first line. Any leading whitespace that can be uniformly removed from the second line onwards is removed. Empty lines at the beginning and end are subsequently removed. Also, all tabs are expanded to spaces.
(emphasis mine).
I think starting on the second line is fine too (and I tend to do that when it buys me three characters for the first line of the docstring...), happy to stick to that format.
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.
I prefer the second-line form.
....oops this needs a rebase... |
Ooops, shoot, I merged something that conflicts with this. My appologies @dstansby. Ping and this will be the next thing I merge! |
Anyone feel free to merge once tests pass 😄 |
Had a recent train journey, so I have a few general docstring cleaning branches hanging around.