Skip to content

DOC: updated docstrings for EX02 validation and updated code_checks #51724

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
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 2 additions & 12 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ fi
### DOCSTRINGS ###
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Validate docstrings (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=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 (EX02, 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=EX02,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
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Partially validate docstrings (EX01)' ; echo $MSG
Expand Down Expand Up @@ -557,16 +557,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.DataFrame.__dataframe__
RET=$(($RET + $?)) ; echo $MSG "DONE"

MSG='Partially validate docstrings (EX02)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX02 --ignore_functions \
pandas.DataFrame.plot.line \
pandas.Series.plot.line \
pandas.api.types.is_datetime64_any_dtype \
pandas.api.types.is_datetime64_ns_dtype \
pandas.api.types.is_datetime64tz_dtype \
pandas.plotting.parallel_coordinates
RET=$(($RET + $?)) ; echo $MSG "DONE"

fi

### DOCUMENTATION NOTEBOOKS ###
Expand Down
6 changes: 6 additions & 0 deletions pandas/core/dtypes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ def is_datetime64tz_dtype(arr_or_dtype) -> bool:

Examples
--------
>>> from pandas.api.types import is_datetime64tz_dtype
>>> is_datetime64tz_dtype(object)
False
>>> is_datetime64tz_dtype([1, 2, 3])
Expand All @@ -331,6 +332,7 @@ def is_datetime64tz_dtype(arr_or_dtype) -> bool:
>>> is_datetime64tz_dtype(pd.DatetimeIndex([1, 2, 3], tz="US/Eastern"))
True

>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
>>> dtype = DatetimeTZDtype("ns", tz="US/Eastern")
>>> s = pd.Series([], dtype=dtype)
>>> is_datetime64tz_dtype(dtype)
Expand Down Expand Up @@ -886,6 +888,8 @@ def is_datetime64_any_dtype(arr_or_dtype) -> bool:

Examples
--------
>>> from pandas.api.types import is_datetime64_any_dtype
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
>>> is_datetime64_any_dtype(str)
False
>>> is_datetime64_any_dtype(int)
Expand Down Expand Up @@ -928,6 +932,8 @@ def is_datetime64_ns_dtype(arr_or_dtype) -> bool:

Examples
--------
>>> from pandas.api.types import is_datetime64_ns_dtype
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
>>> is_datetime64_ns_dtype(str)
False
>>> is_datetime64_ns_dtype(int)
Expand Down
3 changes: 1 addition & 2 deletions pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,7 @@ def __call__(self, *args, **kwargs):
:context: close-figs

>>> s = pd.Series([1, 3, 2])
>>> s.plot.line()
<AxesSubplot: ylabel='Density'>
>>> s.plot.line() # doctest: +SKIP

.. plot::
:context: close-figs
Expand Down
3 changes: 1 addition & 2 deletions pandas/plotting/_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,7 @@ def parallel_coordinates(
... )
>>> pd.plotting.parallel_coordinates(
... df, 'Name', color=('#556270', '#4ECDC4', '#C7F464')
... )
<AxesSubplot: xlabel='y(t)', ylabel='y(t + 1)'>
... ) # doctest: +SKIP
"""
plot_backend = _get_plot_backend("matplotlib")
return plot_backend.parallel_coordinates(
Expand Down