Skip to content

Commit b056c63

Browse files
DOC: updated docstrings for EX02 validation and updated code_checks (#51724)
* updated docstrings for EX02 validation * remove whatsnew entry --------- Co-authored-by: Marco Edward Gorelli <[email protected]>
1 parent a344dc9 commit b056c63

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

ci/code_checks.sh

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ fi
7979
### DOCSTRINGS ###
8080
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8181

82-
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
83-
$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
82+
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
83+
$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
8484
RET=$(($RET + $?)) ; echo $MSG "DONE"
8585

8686
MSG='Partially validate docstrings (EX01)' ; echo $MSG
@@ -558,16 +558,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
558558
pandas.DataFrame.__dataframe__
559559
RET=$(($RET + $?)) ; echo $MSG "DONE"
560560

561-
MSG='Partially validate docstrings (EX02)' ; echo $MSG
562-
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX02 --ignore_functions \
563-
pandas.DataFrame.plot.line \
564-
pandas.Series.plot.line \
565-
pandas.api.types.is_datetime64_any_dtype \
566-
pandas.api.types.is_datetime64_ns_dtype \
567-
pandas.api.types.is_datetime64tz_dtype \
568-
pandas.plotting.parallel_coordinates
569-
RET=$(($RET + $?)) ; echo $MSG "DONE"
570-
571561
fi
572562

573563
### DOCUMENTATION NOTEBOOKS ###

pandas/core/dtypes/common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ def is_datetime64tz_dtype(arr_or_dtype) -> bool:
322322
323323
Examples
324324
--------
325+
>>> from pandas.api.types import is_datetime64tz_dtype
325326
>>> is_datetime64tz_dtype(object)
326327
False
327328
>>> is_datetime64tz_dtype([1, 2, 3])
@@ -331,6 +332,7 @@ def is_datetime64tz_dtype(arr_or_dtype) -> bool:
331332
>>> is_datetime64tz_dtype(pd.DatetimeIndex([1, 2, 3], tz="US/Eastern"))
332333
True
333334
335+
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
334336
>>> dtype = DatetimeTZDtype("ns", tz="US/Eastern")
335337
>>> s = pd.Series([], dtype=dtype)
336338
>>> is_datetime64tz_dtype(dtype)
@@ -886,6 +888,8 @@ def is_datetime64_any_dtype(arr_or_dtype) -> bool:
886888
887889
Examples
888890
--------
891+
>>> from pandas.api.types import is_datetime64_any_dtype
892+
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
889893
>>> is_datetime64_any_dtype(str)
890894
False
891895
>>> is_datetime64_any_dtype(int)
@@ -928,6 +932,8 @@ def is_datetime64_ns_dtype(arr_or_dtype) -> bool:
928932
929933
Examples
930934
--------
935+
>>> from pandas.api.types import is_datetime64_ns_dtype
936+
>>> from pandas.core.dtypes.dtypes import DatetimeTZDtype
931937
>>> is_datetime64_ns_dtype(str)
932938
False
933939
>>> is_datetime64_ns_dtype(int)

pandas/plotting/_core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,8 +989,7 @@ def __call__(self, *args, **kwargs):
989989
:context: close-figs
990990
991991
>>> s = pd.Series([1, 3, 2])
992-
>>> s.plot.line()
993-
<AxesSubplot: ylabel='Density'>
992+
>>> s.plot.line() # doctest: +SKIP
994993
995994
.. plot::
996995
:context: close-figs

pandas/plotting/_misc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,7 @@ def parallel_coordinates(
447447
... )
448448
>>> pd.plotting.parallel_coordinates(
449449
... df, 'Name', color=('#556270', '#4ECDC4', '#C7F464')
450-
... )
451-
<AxesSubplot: xlabel='y(t)', ylabel='y(t + 1)'>
450+
... ) # doctest: +SKIP
452451
"""
453452
plot_backend = _get_plot_backend("matplotlib")
454453
return plot_backend.parallel_coordinates(

0 commit comments

Comments
 (0)