Skip to content

Commit f750975

Browse files
Resolve GL03 docstring validation errors
1 parent cc4a7e5 commit f750975

File tree

12 files changed

+9
-23
lines changed

12 files changed

+9
-23
lines changed

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 2 deletions
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
--------
@@ -6027,7 +6026,6 @@ def unstack(self, level=-1, fill_value=None):
60276026
columns, considered measured variables (`value_vars`), are "unpivoted" to
60286027
the row axis, leaving just two non-identifier columns, 'variable' and
60296028
'value'.
6030-
60316029
%(versionadded)s
60326030
Parameters
60336031
----------

pandas/core/generic.py

Lines changed: 3 additions & 9 deletions
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()
@@ -4951,9 +4950,7 @@ def pipe(self, func, *args, **kwargs):
49514950

49524951
_shared_docs['aggregate'] = dedent("""
49534952
Aggregate using one or more operations over the specified axis.
4954-
49554953
%(versionadded)s
4956-
49574954
Parameters
49584955
----------
49594956
func : function, str, list or dict
@@ -4983,16 +4980,13 @@ def pipe(self, func, *args, **kwargs):
49834980
* DataFrame : when DataFrame.agg is called with several functions
49844981
49854982
Return scalar, Series or DataFrame.
4986-
49874983
%(see_also)s
4988-
49894984
Notes
49904985
-----
49914986
`agg` is an alias for `aggregate`. Use the alias.
49924987
49934988
A passed user-defined-function will be passed a Series for evaluation.
4994-
4995-
%(examples)s
4989+
%(examples)s\
49964990
""")
49974991

49984992
_shared_docs['transform'] = ("""
@@ -10307,7 +10301,7 @@ def _doc_parms(cls):
1030710301
1030810302
Returns
1030910303
-------
10310-
%(name1)s or %(name2)s (if level specified)
10304+
%(name1)s or %(name2)s (if level specified)\
1031110305
%(see_also)s
1031210306
%(examples)s\
1031310307
"""
@@ -10464,7 +10458,7 @@ def _doc_parms(cls):
1046410458
%(name2)s.cumsum : Return cumulative sum over %(name2)s axis.
1046510459
%(name2)s.cumprod : Return cumulative product over %(name2)s axis.
1046610460
10467-
%(examples)s
10461+
%(examples)s\
1046810462
"""
1046910463

1047010464
_cummin_examples = """\

pandas/core/groupby/base.py

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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)