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

Skip to content

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

Merged
merged 1 commit into from
Jan 11, 2018
Merged

Clean up _axes.py docstrings #10138

merged 1 commit into from
Jan 11, 2018

Conversation

dstansby
Copy link
Member

Had a recent train journey, so I have a few general docstring cleaning branches hanging around.

@@ -111,7 +111,8 @@ class Axes(_AxesBase):
aname = 'Axes'

def get_title(self, loc="center"):
"""Get an axes title.
"""
Get an axes title.
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Member

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.

@jklymak
Copy link
Member

jklymak commented Jan 6, 2018

....oops this needs a rebase...

@tacaswell tacaswell added this to the v2.2 milestone Jan 7, 2018
@jklymak
Copy link
Member

jklymak commented Jan 9, 2018

Ooops, shoot, I merged something that conflicts with this. My appologies @dstansby. Ping and this will be the next thing I merge!

@dstansby
Copy link
Member Author

dstansby commented Jan 9, 2018

Anyone feel free to merge once tests pass 😄

@anntzer anntzer merged commit f4b1a61 into matplotlib:master Jan 11, 2018
@dstansby dstansby deleted the doc-_axes branch January 11, 2018 09:50
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
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.

6 participants