8000 PR04 errors fix by mwoss · Pull Request #25157 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

PR04 errors fix #25157

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 17 commits into from
Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Remove unnecessary colons and note section in Grouper docs
  • Loading branch information
mwoss committed Feb 7, 2019
commit 63aaaf0b5ee83a0b60c241942df55ce9aa18c57a
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ class Timedelta(_Timedelta):
'ms', 'milliseconds', 'millisecond', 'milli', 'millis', 'L',
'us', 'microseconds', 'microsecond', 'micro', 'micros', 'U',
'ns', 'nanoseconds', 'nano', 'nanos', 'nanosecond', 'N'}
**kwargs : numeric, optional
**kwargs
Available kwargs: {days, seconds, microseconds,
milliseconds, minutes, hours, weeks}.
Values for construction in compat with datetime.timedelta.
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ 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 :
**kwargs
Additional keyword arguments will be passed to the function.

Returns
Expand Down
13 changes: 5 additions & 8 deletions pandas/core/groupby/grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,21 @@ class Grouper(object):
axis : number/name of the axis, defaults to 0
sort : boolean, default to False
whether to sort the resulting labels

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
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
-------
A specification for a groupby instruction

Note
-------
Kwargs to control time-like groupers:
closed, label, convetion, base and loffset
are taken into account when `freq` parameter is passed

Examples
--------

Expand Down
2 changes: 1 addition & 1 deletion pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def render(self, **kwargs):

Parameters
----------
**kwargs :
**kwargs
Any additional keyword arguments are passed
through to ``self.template.render``.
This is useful when you need to provide
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def read_parquet(path, engine='auto', columns=None, **kwargs):
``io.parquet.engine`` is used. The default ``io.parquet.engine``
behavior is to try 'pyarrow', falling back to 'fastparquet' if
'pyarrow' is unavailable.
**kwargs :
**kwargs
Any additional kwargs are passed to the engine.

Returns
Expand Down
2 changes: 1 addition & 1 deletion scripts/validate_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def validate_pep8(self):
application = flake8.main.application.Application()
application.initialize(["--quiet"])

with tempfile.NamedTemporaryFile(mode='w') as file:
with tempfile.NamedTemporaryFile(mode='w', encoding='utf-8') as file:
Copy link
Member

Choose a reason for hiding this comment

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

If you can revert this I think the rest looks good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, i again commit this line. I should create github issue with coresponding PR for that.

file.write(content)
file.flush()
application.run_checks([file.name])
Expand Down
0