-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
DOC: Fix PR01 errors in multiple files (#57438) #57504
Conversation
Fixed PR01 errors (pandas-dev#57438) and added parameter descriptions for: - `pandas.Grouper` - `pandas.core.groupby.DataFrameGroupBy.cummax` - `pandas.core.groupby.DataFrameGroupBy.cummin` - `pandas.core.groupby.DataFrameGroupBy.cumprod` - `pandas.core.groupby.DataFrameGroupBy.cumsum` - `pandas.core.groupby.DataFrameGroupBy.filter` - `pandas.core.groupby.DataFrameGroupBy.pct_change` - `pandas.core.groupby.DataFrameGroupBy.rolling` - `pandas.core.groupby.SeriesGroupBy.cummax` - `pandas.core.groupby.SeriesGroupBy.cummin` - `pandas.core.groupby.SeriesGroupBy.cumprod` - `pandas.core.groupby.SeriesGroupBy.cumsum` - `pandas.core.groupby.SeriesGroupBy.cumprod` Fixed functions also removed from code_checks.sh
Resolved a PR02 documentation error arising from the inherited `nunique` method docstring within `groupby.SeriesGroupBy.nunique`. The issue was due to the `resample.Resampler.nunique` method lacking a `dropna` parameter, which is present in the inherited docstring. - Introduced `_nunique_extra_params` to dynamically insert parameter documentation only where applicable (i.e. where `groupby.SeriesGroupBy.nunique`is).
pandas/core/resample.py
Outdated
@@ -1358,7 +1358,7 @@ def ohlc(self): | |||
return self._downsample("ohlc") | |||
|
|||
@final | |||
@doc(SeriesGroupBy.nunique) | |||
@doc(SeriesGroupBy.nunique, extra_params="") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give this a distinct docstring (e.g. copy-paste the SeriesGroupBy.nunique docstring here) and avoid using doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Since they're now their own distinct docstrings, I separated the examples too (added see alsos to each other instead)
pandas/core/groupby/generic.py
Outdated
""" | ||
) | ||
|
||
@doc(extra_params=_nunique_extra_params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Connecting with my other comment, can you avoid using doc
here?
Thanks @Deen-dot |
…#57504) * DOC: Fix PR01 errors in multiple files (pandas-dev#57438) Fixed PR01 errors (pandas-dev#57438) and added parameter descriptions for: - `pandas.Grouper` - `pandas.core.groupby.DataFrameGroupBy.cummax` - `pandas.core.groupby.DataFrameGroupBy.cummin` - `pandas.core.groupby.DataFrameGroupBy.cumprod` - `pandas.core.groupby.DataFrameGroupBy.cumsum` - `pandas.core.groupby.DataFrameGroupBy.filter` - `pandas.core.groupby.DataFrameGroupBy.pct_change` - `pandas.core.groupby.DataFrameGroupBy.rolling` - `pandas.core.groupby.SeriesGroupBy.cummax` - `pandas.core.groupby.SeriesGroupBy.cummin` - `pandas.core.groupby.SeriesGroupBy.cumprod` - `pandas.core.groupby.SeriesGroupBy.cumsum` - `pandas.core.groupby.SeriesGroupBy.cumprod` Fixed functions also removed from code_checks.sh * Updated formatting * Corrected E501 formatting * Remove trailing whitespaces * Fix PR02 error from docstring inheritance for resampler nunique method Resolved a PR02 documentation error arising from the inherited `nunique` method docstring within `groupby.SeriesGroupBy.nunique`. The issue was due to the `resample.Resampler.nunique` method lacking a `dropna` parameter, which is present in the inherited docstring. - Introduced `_nunique_extra_params` to dynamically insert parameter documentation only where applicable (i.e. where `groupby.SeriesGroupBy.nunique`is). * Resolve request * Undo mistake * Remove unnecessary import to fix ruff check
Fixed PR01 errors (#57438) and added parameter descriptions for:
pandas.Grouper
pandas.core.groupby.DataFrameGroupBy.cummax
pandas.core.groupby.DataFrameGroupBy.cummin
pandas.core.groupby.DataFrameGroupBy.cumprod
pandas.core.groupby.DataFrameGroupBy.cumsum
pandas.core.groupby.DataFrameGroupBy.filter
pandas.core.groupby.DataFrameGroupBy.pct_change
pandas.core.groupby.DataFrameGroupBy.rolling
pandas.core.groupby.SeriesGroupBy.nunique
pandas.core.groupby.SeriesGroupBy.cummax
pandas.core.groupby.SeriesGroupBy.cummin
pandas.core.groupby.SeriesGroupBy.cumprod
pandas.core.groupby.SeriesGroupBy.cumsum
pandas.core.groupby.SeriesGroupBy.cumprod
Fixed functions also removed from code_checks.sh