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

PR04 errors fix #25157

Merged
merged 17 commits into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ fi
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04, RT04, SS05, SA05)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04,RT04,SS05,SA05
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR04,PR05,EX04,RT04,SS05,SA05
RET=$(($RET + $?)) ; echo $MSG "DONE"

fi
Expand Down
7 changes: 4 additions & 3 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1127,10 +1127,11 @@ class Timedelta(_Timedelta):
'ms', 'milliseconds', 'millisecond', 'milli', 'millis', 'L',
'us', 'microseconds', 'microsecond', 'micro', 'micros', 'U',
'ns', 'nanoseconds', 'nano', 'nanos', 'nanosecond', 'N'}
days, seconds, microseconds,
milliseconds, minutes, hours, weeks : numeric, optional
**kwargs
Available kwargs: {days, seconds, microseconds,
milliseconds, minutes, hours, weeks}.
Values for construction in compat with datetime.timedelta.
np ints and floats will be coerced to python ints and floats.
Numpy ints and floats will be coerced to python ints and floats.

Notes
-----
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def _factorize_array(values, na_sentinel=-1, size_hint=None,
coerced to ndarrays before factorization.
"""),
order=dedent("""\
order
order : None
.. deprecated:: 0.23.0

This parameter has no effect and is deprecated.
Expand Down
2 changes: 2 additions & 0 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@ def transpose(self, *args, **kwargs):
copy : boolean, default False
Make a copy of the underlying data. Mixed-dtype data will
always result in a copy
**kwargs
Additional keyword arguments will be passed to the function.

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ def rank(self, method='average', ascending=True, na_option='keep',
The axis of the object over which to compute the rank.

Returns
-----
-------
WillAyd marked this conversation as resolved.
Show resolved Hide resolved
DataFrame with ranking of values within each group
"""
if na_option not in {'keep', 'top', 'bottom'}:
Expand Down
12 changes: 7 additions & 5 deletions pandas/core/groupby/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ class Grouper(object):
axis : number/name of the axis, defaults to 0
sort : boolean, default to False
whether to sort the resulting labels

additional kwargs to control time-like groupers (when `freq` is passed)

closed : closed end of interval; 'left' or 'right'
Only when `freq` parameter is passed.
Copy link
Member

Choose a reason for hiding this comment

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

Sorry just one last pass at all of these where Only when freq... is the description - not sure that's the best way of going about this.

It looks like the description for these is where the type should go. Can you move the description down to the line below and add a type for this and the 3 other parameters sharing this description? Also would be nice to revert removal of previous line if it doesn't cause PR04 failures

Copy link
Contributor Author

@mwoss mwoss Feb 9, 2019

Choose a reason for hiding this comment

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

What do you mean by sharing the description? Should I group those kwargs somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix it in few hours. Sorry, busy weekend.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea how deal with line below (for all kwargs).

Additional kwargs to control time-like groupers (when freq is passed).

There is no description sharing functionality for Python docstrings.

label : interval boundary to use for labeling; 'left' or 'right'
Only when `freq` parameter is passed.
convention : {'start', 'end', 'e', 's'}
If grouper is PeriodIndex
base, loffset
If grouper is PeriodIndex and `freq` parameter is passed.
base : int, default 0
Only when `freq` parameter is passed.
loffset : string, DateOffset, timedelta object
Only when `freq` parameter is passed.

Returns
-------
Expand Down
5 changes: 3 additions & 2 deletions pandas/core/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
axes_single_arg="{0, 1, 2, 'items', 'major_axis', 'minor_axis'}",
optional_mapper='', optional_axis='', optional_labels='')
_shared_doc_kwargs['args_transpose'] = (
"three positional arguments: each one of\n{ax_single}".format(
"{ax_single}\n\tThree positional arguments from given options.".format(
ax_single=_shared_doc_kwargs['axes_single_arg']))


Expand Down Expand Up @@ -1009,7 +1009,8 @@ def apply(self, func, axis='major', **kwargs):
DataFrames of items & major axis will be passed
axis : {'items', 'minor', 'major'}, or {0, 1, 2}, or a tuple with two
axes
Additional keyword arguments will be passed as keywords to the function
**kwargs :
Additional keyword arguments will be passed to the function.

Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def std(self, ddof=1, *args, **kwargs):
Parameters
----------
ddof : integer, default 1
degrees of freedom
Degrees of freedom.
"""
nv.validate_resampler_func('std', args, kwargs)
return self._downsample('std', ddof=ddof)
Expand Down
8 changes: 5 additions & 3 deletions pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,11 @@ def render(self, **kwargs):

Parameters
----------
`**kwargs` : Any additional keyword arguments are passed through
to ``self.template.render``. This is useful when you need to provide
additional variables for a custom template.
**kwargs
Any additional keyword arguments are passed
through to ``self.template.render``.
This is useful when you need to provide
additional variables for a custom template.

.. versionadded:: 0.20

Expand Down
11 changes: 6 additions & 5 deletions pandas/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,17 @@ def read_parquet(path, engine='auto', columns=None, **kwargs):
----------
path : string
File path
columns : list, default=None
If not None, only these columns will be read from the file.

.. versionadded 0.21.1
engine : {'auto', 'pyarrow', 'fastparquet'}, default 'auto'
Parquet library to use. If 'auto', then the option
``io.parquet.engine`` is used. The default ``io.parquet.engine``
behavior is to try 'pyarrow', falling back to 'fastparquet' if
'pyarrow' is unavailable.
kwargs are passed to the engine
columns : list, default=None
If not None, only these columns will be read from the file.

.. versionadded 0.21.1
**kwargs
Any additional kwargs are passed to the engine.

Returns
-------
Expand Down