Skip to content

Commit

Permalink
DOC: fix SA05 errors in docstrings for pandas.core.window Expanding a…
Browse files Browse the repository at this point in the history
…nd Rolling, and SeriesGroupBy (pandas-dev#57446)

* DOC: fix SA05 errors in docstrings for pandas.core.window Expanding and Rolling, and SeriesGroupBy

* Reverted changes on removing SA05 check

* Added SA05 to list of errors for validate docstrings

---------

Co-authored-by: William Joshua King <[email protected]>
  • Loading branch information
2 people authored and pmhatre1 committed May 7, 2024
1 parent 477a4c3 commit 0610c49
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
12 changes: 2 additions & 10 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ fi
### DOCSTRINGS ###
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Validate docstrings (EX01, EX03, EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT02, RT04, RT05, SA02, SA03, SA04, SS01, SS02, SS03, SS04, SS05, SS06)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01,EX03,EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT02,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05,SS06
MSG='Validate docstrings (EX01, EX03, EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT02, RT04, RT05, SA02, SA03, SA04, SA05, SS01, SS02, SS03, SS04, SS05, SS06)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01,EX03,EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT02,RT04,RT05,SA02,SA03,SA04,SA05,SS01,SS02,SS03,SS04,SS05,SS06
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Partially validate docstrings (PR02)' ; echo $MSG
Expand Down Expand Up @@ -3182,14 +3182,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.util.hash_pandas_object # There should be no backslash in the final line, please keep this comment in the last ignored function
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Partially validate docstrings (SA05)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=SA05 --ignore_functions \
pandas.core.groupby.SeriesGroupBy.first\
pandas.core.groupby.SeriesGroupBy.last\
pandas.core.window.expanding.Expanding.aggregate\
pandas.core.window.rolling.Rolling.aggregate # There should be no backslash in the final line, please keep this comment in the last ignored function
RET=$(($RET + $?)) ; echo $MSG "DONE"

fi

### DOCUMENTATION NOTEBOOKS ###
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/window/expanding.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def _get_window_indexer(self) -> BaseIndexer:
"""
See Also
--------
pandas.DataFrame.aggregate : Similar DataFrame method.
pandas.Series.aggregate : Similar Series method.
DataFrame.aggregate : Similar DataFrame method.
Series.aggregate : Similar Series method.
"""
),
examples=dedent(
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/window/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1216,8 +1216,8 @@ def calc(x):
"""
See Also
--------
pandas.DataFrame.aggregate : Similar DataFrame method.
pandas.Series.aggregate : Similar Series method.
DataFrame.aggregate : Similar DataFrame method.
Series.aggregate : Similar Series method.
"""
),
examples=dedent(
Expand Down Expand Up @@ -1906,8 +1906,8 @@ def _raise_monotonic_error(self, msg: str):
"""
See Also
--------
pandas.Series.rolling : Calling object with Series data.
pandas.DataFrame.rolling : Calling object with DataFrame data.
Series.rolling : Calling object with Series data.
DataFrame.rolling : Calling object with DataFrame data.
"""
),
examples=dedent(
Expand Down

0 comments on commit 0610c49

Please sign in to comment.