Skip to content

Commit 92bde03

Browse files
Resolve GL03 docstring validation errors
1 parent 42b4c97 commit 92bde03

File tree

12 files changed

+9
-23
lines changed

12 files changed

+9
-23
lines changed

pandas/_libs/tslibs/timedeltas.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,6 @@ class Timedelta(_Timedelta):
11561156
Notes
11571157
-----
11581158
The ``.value`` attribute is always in ns.
1159-
11601159
"""
11611160
def __new__(cls, object value=_no_input, unit=None, **kwargs):
11621161
cdef _Timedelta td_base

pandas/core/arrays/datetimes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def f(self):
119119
return result
120120

121121
f.__name__ = name
122-
f.__doc__ = "\n{}\n".format(docstring)
122+
f.__doc__ = docstring
123123
return property(f)
124124

125125

pandas/core/arrays/sparse.py

-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@ class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin):
541541
3. ``data.dtype.fill_value`` if `fill_value` is None and `dtype`
542542
is not a ``SparseDtype`` and `data` is a ``SparseArray``.
543543
544-
545544
kind : {'integer', 'block'}, default 'integer'
546545
The type of storage for sparse locations.
547546

pandas/core/base.py

-1
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,6 @@ def to_numpy(self, dtype=None, copy=False):
870870
871871
.. versionadded:: 0.24.0
872872
873-
874873
Parameters
875874
----------
876875
dtype : str or numpy.dtype, optional

pandas/core/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,8 @@ def _build_option_description(k):
650650
s += (u(', use `{rkey}` instead.')
651651
.format(rkey=d.rkey if d.rkey else ''))
652652
s += u(')')
653+
s += '\n'
653654

654-
s += '\n\n'
655655
return s
656656

657657

pandas/core/frame.py

-2
Original file line numberDiff line numberDiff line change
@@ -2184,7 +2184,6 @@ def to_html(self, buf=None, columns=None, col_space=None, header=True,
21842184
Convert URLs to HTML links.
21852185
21862186
.. versionadded:: 0.24.0
2187-
21882187
%(returns)s
21892188
See Also
21902189
--------
@@ -6003,7 +6002,6 @@ def unstack(self, level=-1, fill_value=None):
60036002
columns, considered measured variables (`value_vars`), are "unpivoted" to
60046003
the row axis, leaving just two non-identifier columns, 'variable' and
60056004
'value'.
6006-
60076005
%(versionadded)s
60086006
Parameters
60096007
----------

pandas/core/generic.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,6 @@ def swaplevel(self, i=-2, j=-1, axis=0):
948948
949949
The indexes ``i`` and ``j`` are now optional, and default to
950950
the two innermost levels of the index.
951-
952951
"""
953952
axis = self._get_axis_number(axis)
954953
result = self.copy()
@@ -4929,9 +4928,7 @@ def pipe(self, func, *args, **kwargs):
49294928

49304929
_shared_docs['aggregate'] = dedent("""
49314930
Aggregate using one or more operations over the specified axis.
4932-
49334931
%(versionadded)s
4934-
49354932
Parameters
49364933
----------
49374934
func : function, str, list or dict
@@ -4961,16 +4958,13 @@ def pipe(self, func, *args, **kwargs):
49614958
* DataFrame : when DataFrame.agg is called with several functions
49624959
49634960
Return scalar, Series or DataFrame.
4964-
49654961
%(see_also)s
4966-
49674962
Notes
49684963
-----
49694964
`agg` is an alias for `aggregate`. Use the alias.
49704965
49714966
A passed user-defined-function will be passed a Series for evaluation.
4972-
4973-
%(examples)s
4967+
%(examples)s\
49744968
""")
49754969

49764970
_shared_docs['transform'] = ("""
@@ -10285,7 +10279,7 @@ def _doc_parms(cls):
1028510279
1028610280
Returns
1028710281
-------
10288-
%(name1)s or %(name2)s (if level specified)
10282+
%(name1)s or %(name2)s (if level specified)\
1028910283
%(see_also)s
1029010284
%(examples)s\
1029110285
"""
@@ -10442,7 +10436,7 @@ def _doc_parms(cls):
1044210436
%(name2)s.cumsum : Return cumulative sum over %(name2)s axis.
1044310437
%(name2)s.cumprod : Return cumulative product over %(name2)s axis.
1044410438
10445-
%(examples)s
10439+
%(examples)s\
1044610440
"""
1044710441

1044810442
_cummin_examples = """\

pandas/core/groupby/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def %(name)s(self) :
139139
# ugly, but we need the name string itself in the method.
140140
f = getattr(klass, name)
141141
doc = f.__doc__
142-
doc = doc if type(doc) == str else ''
142+
doc = doc.strip() if type(doc) == str else ''
143143
if isinstance(f, types.MethodType):
144144
wrapper_template = method_wrapper_template
145145
decl, args = make_signature(f)

pandas/core/groupby/groupby.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ class providing the base-class of operations.
4444
from pandas.core.series import Series
4545
from pandas.core.sorting import get_group_index_sorter
4646

47-
_common_see_also = """
47+
_common_see_also = """\
4848
See Also
4949
--------
5050
Series.%(name)s
5151
DataFrame.%(name)s
52-
Panel.%(name)s
52+
Panel.%(name)s\
5353
"""
5454

5555
_apply_docs = dict(
@@ -221,7 +221,7 @@ class providing the base-class of operations.
221221
222222
Examples
223223
--------
224-
%(examples)s
224+
%(examples)s\
225225
"""
226226

227227
_transform_template = """

pandas/core/indexes/base.py

-1
Original file line numberDiff line numberDiff line change
@@ -3104,7 +3104,6 @@ def reindex(self, target, method=None, level=None, limit=None,
31043104
Resulting index.
31053105
indexer : np.ndarray or None
31063106
Indices of output values in original index.
3107-
31083107
"""
31093108
# GH6552: preserve names when reindexing to non-named target
31103109
# (i.e. neither Index nor Series).

pandas/io/feather_format.py

-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ def read_feather(path, columns=None, use_threads=True):
110110
Returns
111111
-------
112112
type of object stored in file
113-
114113
"""
115114

116115
feather, pyarrow = _try_import()

pandas/plotting/_misc.py

-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ def andrews_curves(frame, class_column, ax=None, samples=200, color=None,
303303
Returns
304304
-------
305305
class:`matplotlip.axis.Axes`
306-
307306
"""
308307
from math import sqrt, pi
309308
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)