Skip to content

Commit 2b945dd

Browse files
thooPingviinituutti
authored andcommitted
Fix validation error type SS05 and check in CI (pandas-dev#25133)
1 parent f631a99 commit 2b945dd

File tree

21 files changed

+70
-57
lines changed

21 files changed

+70
-57
lines changed

ci/code_checks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ fi
240240
### DOCSTRINGS ###
241241
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
242242

243-
MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04, RT04)' ; echo $MSG
244-
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04,RT04
243+
MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04, RT04, SS05)' ; echo $MSG
244+
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04,RT04,SS05
245245
RET=$(($RET + $?)) ; echo $MSG "DONE"
246246

247247
fi

pandas/_libs/tslibs/nattype.pyx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ cdef class _NaT(datetime):
183183
return np.datetime64(NPY_NAT, 'ns')
184184

185185
def to_datetime64(self):
186-
""" Returns a numpy.datetime64 object with 'ns' precision """
186+
"""
187+
Return a numpy.datetime64 object with 'ns' precision.
188+
"""
187189
return np.datetime64('NaT', 'ns')
188190

189191
def __repr__(self):
@@ -448,7 +450,7 @@ class NaTType(_NaT):
448450
"""
449451
Timestamp.now(tz=None)
450452
451-
Returns new Timestamp object representing current time local to
453+
Return new Timestamp object representing current time local to
452454
tz.
453455
454456
Parameters

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ cdef class _Timestamp(datetime):
340340
self.microsecond, self.tzinfo)
341341

342342
cpdef to_datetime64(self):
343-
""" Returns a numpy.datetime64 object with 'ns' precision """
343+
"""
344+
Return a numpy.datetime64 object with 'ns' precision.
345+
"""
344346
return np.datetime64(self.value, 'ns')
345347

346348
def __add__(self, other):
@@ -614,7 +616,7 @@ class Timestamp(_Timestamp):
614616
"""
615617
Timestamp.now(tz=None)
616618
617-
Returns new Timestamp object representing current time local to
619+
Return new Timestamp object representing current time local to
618620
tz.
619621
620622
Parameters

pandas/core/arrays/categorical.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def contains(cat, key, container):
214214

215215
class Categorical(ExtensionArray, PandasObject):
216216
"""
217-
Represents a categorical variable in classic R / S-plus fashion
217+
Represent a categorical variable in classic R / S-plus fashion
218218
219219
`Categoricals` can only take on only a limited, and usually fixed, number
220220
of possible values (`categories`). In contrast to statistical categorical
@@ -747,7 +747,7 @@ def _set_dtype(self, dtype):
747747

748748
def set_ordered(self, value, inplace=False):
749749
"""
750-
Sets the ordered attribute to the boolean value
750+
Set the ordered attribute to the boolean value
751751
752752
Parameters
753753
----------
@@ -793,7 +793,7 @@ def as_unordered(self, inplace=False):
793793
def set_categories(self, new_categories, ordered=None, rename=False,
794794
inplace=False):
795795
"""
796-
Sets the categories to the specified new_categories.
796+
Set the categories to the specified new_categories.
797797
798798
`new_categories` can include new categories (which will result in
799799
unused categories) or remove old categories (which results in values
@@ -864,7 +864,7 @@ def set_categories(self, new_categories, ordered=None, rename=False,
864864

865865
def rename_categories(self, new_categories, inplace=False):
866866
"""
867-
Renames categories.
867+
Rename categories.
868868
869869
Parameters
870870
----------
@@ -958,7 +958,7 @@ def rename_categories(self, new_categories, inplace=False):
958958

959959
def reorder_categories(self, new_categories, ordered=None, inplace=False):
960960
"""
961-
Reorders categories as specified in new_categories.
961+
Reorder categories as specified in new_categories.
962962
963963
`new_categories` need to include all old categories and no new category
964964
items.
@@ -1051,7 +1051,7 @@ def add_categories(self, new_categories, inplace=False):
10511051

10521052
def remove_categories(self, removals, inplace=False):
10531053
"""
1054-
Removes the specified categories.
1054+
Remove the specified categories.
10551055
10561056
`removals` must be included in the old categories. Values which were in
10571057
the removed categories will be set to NaN
@@ -1104,7 +1104,7 @@ def remove_categories(self, removals, inplace=False):
11041104

11051105
def remove_unused_categories(self, inplace=False):
11061106
"""
1107-
Removes categories which are not used.
1107+
Remove categories which are not used.
11081108
11091109
Parameters
11101110
----------
@@ -1454,7 +1454,7 @@ def dropna(self):
14541454

14551455
def value_counts(self, dropna=True):
14561456
"""
1457-
Returns a Series containing counts of each category.
1457+
Return a Series containing counts of each category.
14581458
14591459
Every category will have an entry, even those with a count of 0.
14601460
@@ -1570,7 +1570,7 @@ def argsort(self, *args, **kwargs):
15701570

15711571
def sort_values(self, inplace=False, ascending=True, na_position='last'):
15721572
"""
1573-
Sorts the Categorical by category value returning a new
1573+
Sort the Categorical by category value returning a new
15741574
Categorical by default.
15751575
15761576
While an ordering is applied to the category values, sorting in this

pandas/core/dtypes/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2006,7 +2006,7 @@ def _validate_date_like_dtype(dtype):
20062006

20072007
def pandas_dtype(dtype):
20082008
"""
2009-
Converts input into a pandas only dtype object or a numpy dtype object.
2009+
Convert input into a pandas only dtype object or a numpy dtype object.
20102010
20112011
Parameters
20122012
----------

pandas/core/dtypes/dtypes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818

1919
def register_extension_dtype(cls):
20-
"""Class decorator to register an ExtensionType with pandas.
20+
"""
21+
Register an ExtensionType with pandas as class decorator.
2122
2223
.. versionadded:: 0.24.0
2324

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6009,7 +6009,7 @@ def unstack(self, level=-1, fill_value=None):
60096009
return unstack(self, level, fill_value)
60106010

60116011
_shared_docs['melt'] = ("""
6012-
Unpivots a DataFrame from wide format to long format, optionally
6012+
Unpivot a DataFrame from wide format to long format, optionally
60136013
leaving identifier variables set.
60146014
60156015
This function is useful to massage a DataFrame into a format where one

pandas/core/generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10125,7 +10125,7 @@ def nanptp(values, axis=0, skipna=True):
1012510125

1012610126
cls.ptp = _make_stat_function(
1012710127
cls, 'ptp', name, name2, axis_descr,
10128-
"""Returns the difference between the maximum value and the
10128+
"""Return the difference between the maximum value and the
1012910129
minimum value in the object. This is the equivalent of the
1013010130
``numpy.ndarray`` method ``ptp``.\n\n.. deprecated:: 0.24.0
1013110131
Use numpy.ptp instead""",

pandas/core/groupby/generic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,9 @@ def true_and_notna(x, *args, **kwargs):
10211021
return filtered
10221022

10231023
def nunique(self, dropna=True):
1024-
""" Returns number of unique elements in the group """
1024+
"""
1025+
Return number of unique elements in the group.
1026+
"""
10251027
ids, _, _ = self.grouper.group_info
10261028

10271029
val = self.obj.get_values()

pandas/core/groupby/groupby.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ def curried(x):
625625

626626
def get_group(self, name, obj=None):
627627
"""
628-
Constructs NDFrame from group with provided name.
628+
Construct NDFrame from group with provided name.
629629
630630
Parameters
631631
----------
@@ -1047,7 +1047,7 @@ def result_to_bool(result):
10471047
@Appender(_common_see_also)
10481048
def any(self, skipna=True):
10491049
"""
1050-
Returns True if any value in the group is truthful, else False.
1050+
Return True if any value in the group is truthful, else False.
10511051
10521052
Parameters
10531053
----------
@@ -1060,7 +1060,7 @@ def any(self, skipna=True):
10601060
@Appender(_common_see_also)
10611061
def all(self, skipna=True):
10621062
"""
1063-
Returns True if all values in the group are truthful, else False.
1063+
Return True if all values in the group are truthful, else False.
10641064
10651065
Parameters
10661066
----------
@@ -1813,7 +1813,7 @@ def cumcount(self, ascending=True):
18131813
def rank(self, method='average', ascending=True, na_option='keep',
18141814
pct=False, axis=0):
18151815
"""
1816-
Provides the rank of values within each group.
1816+
Provide the rank of values within each group.
18171817
18181818
Parameters
18191819
----------
@@ -2039,7 +2039,7 @@ def pct_change(self, periods=1, fill_method='pad', limit=None, freq=None,
20392039
@Substitution(name='groupby', see_also=_common_see_also)
20402040
def head(self, n=5):
20412041
"""
2042-
Returns first n rows of each group.
2042+
Return first n rows of each group.
20432043
20442044
Essentially equivalent to ``.apply(lambda x: x.head(n))``,
20452045
except ignores as_index flag.
@@ -2067,7 +2067,7 @@ def head(self, n=5):
20672067
@Substitution(name='groupby', see_also=_common_see_also)
20682068
def tail(self, n=5):
20692069
"""
2070-
Returns last n rows of each group.
2070+
Return last n rows of each group.
20712071
20722072
Essentially equivalent to ``.apply(lambda x: x.tail(n))``,
20732073
except ignores as_index flag.

0 commit comments

Comments
 (0)