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

Docstring cleanup #14337

Merged
merged 1 commit into from
May 27, 2019
Merged

Docstring cleanup #14337

merged 1 commit into from
May 27, 2019

Conversation

timhoffm
Copy link
Member

PR Summary

Some docstring cleanup. Mainly capitalization (pydocstyle D403).

There's much more to do, but I don't trust automatic regexp replacements here. Therefore, I'll take it slow and do bits at a time. With that I can do other small doc improvements on the go and the PR does not become too large to review.

@@ -237,8 +237,8 @@ def validate_int_or_None(s):

def validate_fonttype(s):
"""
confirm that this is a Postscript of PDF font type that we know how to
convert to
Confirm that this is a Postscript of PDF font type that we know how to
Copy link
Contributor

Choose a reason for hiding this comment

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

of -> or

@@ -305,7 +305,7 @@ def __init__(self, n=None, allow_none=False):
self.allow_none = allow_none

def __call__(self, s):
"""return a seq of n floats or raise"""
"""Return a seq of n floats or raise."""
Copy link
Contributor

@anntzer anntzer May 26, 2019

Choose a reason for hiding this comment

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

a list of *n* floats

@@ -329,7 +329,7 @@ def __init__(self, n=None):
self.n = n

def __call__(self, s):
"""return a seq of n ints or raise"""
"""Return a seq of n ints or raise."""
Copy link
Contributor

@anntzer anntzer May 26, 2019

Choose a reason for hiding this comment

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

a list of *n* ints

try:
return int(s)
except ValueError:
raise ValueError('Could not convert "%s" to int' % s)


def validate_int_or_None(s):
"""if not None, tries to validate as an int"""
"""If not None, tries to validate as an int."""
Copy link
Member

Choose a reason for hiding this comment

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

Should rewrite to "Convert ..." like its non-None version.

@@ -713,7 +713,7 @@ def _calc_offsets(appended_sizes, karray):

def new_locator(self, nx, nx1=None):
"""
returns a new locator
Returns a new locator
Copy link
Member

Choose a reason for hiding this comment

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

Create

@@ -806,7 +806,7 @@ class VBoxDivider(HBoxDivider):

def new_locator(self, ny, ny1=None):
"""
returns a new locator
Returns a new locator
Copy link
Member

Choose a reason for hiding this comment

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

Create

@@ -251,7 +251,7 @@ def pick(self, mouseevent):

def twinx(self, axes_class=None):
"""
create a twin of Axes for generating a plot with a sharex
Create a twin of Axes for generating a plot with a sharex
Copy link
Member

Choose a reason for hiding this comment

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

s/sharex/shared/

@@ -309,7 +309,7 @@ def _remove_twiny(self, ax):

def twin(self, aux_trans=None, axes_class=None):
"""
create a twin of Axes for generating a plot with a sharex
Create a twin of Axes for generating a plot with a sharex
Copy link
Member

Choose a reason for hiding this comment

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

Wait is this even right for twin?

@dstansby dstansby added this to the v3.1.1 milestone May 27, 2019
@dstansby dstansby merged commit 3ae86f1 into matplotlib:master May 27, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request May 27, 2019
dstansby added a commit that referenced this pull request May 27, 2019
…337-on-v3.1.x

Backport PR #14337 on branch v3.1.x (Docstring cleanup)
@timhoffm timhoffm deleted the pydocstyle-D403 branch May 27, 2019 14:49
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.

None yet

4 participants