Skip to content

Commit 5e2bf77

Browse files
authored
DOC: PR08 doctring validation (#44622)
1 parent 014ea2e commit 5e2bf77

File tree

5 files changed

+15
-19
lines changed

5 files changed

+15
-19
lines changed

ci/code_checks.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ fi
9393
### DOCSTRINGS ###
9494
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9595

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

100100
fi

pandas/core/generic.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -5311,10 +5311,9 @@ def sample(
53115311
If weights do not sum to 1, they will be normalized to sum to 1.
53125312
Missing values in the weights column will be treated as zero.
53135313
Infinite values not allowed.
5314-
random_state : int, array-like, BitGenerator, np.random.RandomState,
5315-
np.random.Generator, optional. If int, array-like, or BitGenerator, seed for
5316-
random number generator. If np.random.RandomState or np.random.Generator,
5317-
use as given.
5314+
random_state : int, array-like, BitGenerator, np.random.RandomState, np.random.Generator, optional
5315+
If int, array-like, or BitGenerator, seed for random number generator.
5316+
If np.random.RandomState or np.random.Generator, use as given.
53185317
53195318
.. versionchanged:: 1.1.0
53205319
@@ -5403,7 +5402,7 @@ def sample(
54035402
num_legs num_wings num_specimen_seen
54045403
falcon 2 2 10
54055404
fish 0 0 8
5406-
"""
5405+
""" # noqa:E501
54075406
if axis is None:
54085407
axis = self._stat_axis_number
54095408

@@ -7906,11 +7905,10 @@ def resample(
79067905
level : str or int, optional
79077906
For a MultiIndex, level (name or number) to use for
79087907
resampling. `level` must be datetime-like.
7909-
origin : {{'epoch', 'start', 'start_day', 'end', 'end_day'}}, Timestamp
7910-
or str, default 'start_day'
7908+
origin : Timestamp or str, default 'start_day'
79117909
The timestamp on which to adjust the grouping. The timezone of origin
79127910
must match the timezone of the index.
7913-
If a timestamp is not used, these values are also supported:
7911+
If string, must be one of the following:
79147912
79157913
- 'epoch': `origin` is 1970-01-01
79167914
- 'start': `origin` is the first value of the timeseries

pandas/core/groupby/groupby.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -3588,10 +3588,9 @@ def sample(
35883588
sampling probabilities after normalization within each group.
35893589
Values must be non-negative with at least one positive element
35903590
within each group.
3591-
random_state : int, array-like, BitGenerator, np.random.RandomState,
3592-
np.random.Generator, optional. If int, array-like, or BitGenerator, seed for
3593-
random number generator. If np.random.RandomState or np.random.Generator,
3594-
use as given.
3591+
random_state : int, array-like, BitGenerator, np.random.RandomState, np.random.Generator, optional
3592+
If int, array-like, or BitGenerator, seed for random number generator.
3593+
If np.random.RandomState or np.random.Generator, use as given.
35953594
35963595
.. versionchanged:: 1.4.0
35973596
@@ -3651,7 +3650,7 @@ def sample(
36513650
5 black 5
36523651
2 blue 2
36533652
0 red 0
3654-
"""
3653+
""" # noqa:E501
36553654
size = sample.process_sampling_size(n, frac, replace)
36563655
if weights is not None:
36573656
weights_arr = sample.preprocess_weights(

pandas/core/groupby/grouper.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,10 @@ class Grouper:
106106
However, loffset is also deprecated for ``.resample(...)``
107107
See: :class:`DataFrame.resample`
108108
109-
origin : {{'epoch', 'start', 'start_day', 'end', 'end_day'}}, Timestamp
110-
or str, default 'start_day'
109+
origin : Timestamp or str, default 'start_day'
111110
The timestamp on which to adjust the grouping. The timezone of origin must
112111
match the timezone of the index.
113-
If a timestamp is not used, these values are also supported:
112+
If string, must be one of the following:
114113
115114
- 'epoch': `origin` is 1970-01-01
116115
- 'start': `origin` is the first value of the timeseries

pandas/core/strings/accessor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ def rstrip(self, to_strip=None):
19771977
Parameters
19781978
----------
19791979
%(side)s : str
1980-
%(side)s to remove.
1980+
Remove the %(side)s of the string.
19811981
19821982
Returns
19831983
-------

0 commit comments

Comments
 (0)