Skip to content

DOC: Fix PR06 errors in Series docstrings (#28253) #28288

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 2 commits into from
Sep 16, 2019

Conversation

danielplawrence
Copy link
Contributor

First bit of work on #28253, fixes PR06 validation errors in Series docstrings.
Mostly just converting boolean -> bool, string -> str, integer -> ; re-worded a little where necessary.

  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

Ran validate_docstrings.py and confirmed all PR06 issues for Series are removed, and that no additional validation errors are added by this change.

@WillAyd WillAyd added the Docs label Sep 5, 2019
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

minor stylistic things but this looks pretty good. This doesn't close anything directly right? Just progress towards it?

@@ -4621,8 +4621,9 @@ def filter(self, items=None, like=None, regex=None, axis=None):
Keep labels from axis for which "like in label == True".
regex : str (regular expression)
Keep labels from axis for which re.search(regex, label) == True.
axis : int or string axis name
The axis to filter on. By default this is the info axis,
axis : int or str
Copy link
Member

Choose a reason for hiding this comment

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

There is a particular convention for axis you can use

axis : {0 or ‘index’, 1 or ‘columns’, None}, default None

From the docs:

https://pandas.pydata.org/pandas-docs/stable/development/contributing_docstring.html#parameter-types

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in a99ef99

@@ -2533,7 +2533,7 @@ def to_msgpack(self, path_or_buf=None, encoding="utf-8", **kwargs):

Parameters
----------
path : string File path, buffer-like, or None
path : str (file path), buffer-like, or None
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
path : str (file path), buffer-like, or None
path : str, filepath, buffer-like, or None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since neither 'file path' nor 'filepath' are listed as types here, I've removed this and added a little clarification below.

@@ -4855,7 +4856,7 @@ def sample(
random_state : int or numpy.random.RandomState, optional
Seed for the random number generator (if int), or numpy RandomState
object.
axis : int or string, optional
axis : int or str, optional
Copy link
Member

Choose a reason for hiding this comment

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

same thing here for axis

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in a99ef99

freq : DateOffset, timedelta, or str, default None
Increment to use from the tseries module
or time rule expressed as a string (e.g. 'EOM')
axis : int or str
Copy link
Member

Choose a reason for hiding this comment

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

and finally here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in a99ef99

@jreback jreback added this to the 1.0 milestone Sep 7, 2019
Copy link
Contributor Author

@danielplawrence danielplawrence left a comment

Choose a reason for hiding this comment

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

minor stylistic things but this looks pretty good. This doesn't close anything directly right? Just progress towards it?

Thanks -- doesn't close anything, just covers the first task in issue 28253

@WillAyd WillAyd merged commit 944e26e into pandas-dev:master Sep 16, 2019
@WillAyd
Copy link
Member

WillAyd commented Sep 16, 2019

Great thanks @danielplawrence !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants