Skip to content

Docstring GL01 GL02 fixes #26526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Jun 21, 2019
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
70a5415
Fixed GL01 and GL02 in pandas.api
May 26, 2019
f31369c
Error code: GL01,GL02 fixes for pandas.HDFStore
May 26, 2019
1b6f06c
fixing the pep8 issue that was generated
May 26, 2019
bef77ae
Fixing GL01,GL02 on pandas.core.resample.Resampler.pipe
May 26, 2019
25674cb
GL01,GL02 fix for pandas.Series.T
May 26, 2019
a894109
fixed pandas.api GL01,GL02
May 26, 2019
01313a9
GL01 GL02 fix on read_html
May 26, 2019
c823d88
GL01 GL02 fix on read_sql_query
May 26, 2019
3855046
GL01,GL02 solved for pandas.IntervalIndex
May 26, 2019
a194e67
fixed .ix for DataFrame,Series and Panel
May 27, 2019
e546595
pandas.io.stata.StataReader.data deprecated method doc updated for GL…
May 27, 2019
41953de
GL01,GL02 error fix for pandas.eval
May 27, 2019
63b8e0c
Fixed GL01,GL02 for pandas.merge and pandas.merge_asof
May 27, 2019
5ad9a5e
fixed pandas.testing GL01,GL02
May 27, 2019
3a41220
fixed GL01,GL02 for pandas.plotting
May 27, 2019
4daacc5
fixed pandas.IntervalDtype GL01,GL02
May 27, 2019
6137562
Fixed GL01,GL02 pandas.PeriodDtype
May 27, 2019
6520521
Fixed GL01,GL02 pandas.DatetimeTZDtype errors
May 27, 2019
66486b8
GL01,GL02 fixes MultiIndex
May 27, 2019
2811f0a
GL01 for Panel.iteritems
May 28, 2019
8b0ace9
GL01 fix pandas.DataFrame.plot
May 28, 2019
281244e
GL01 fix for pandas.Categorical.codes
May 28, 2019
c6dfcf7
Reverting module level docstring to original as validate_docstrings d…
May 29, 2019
01acfd0
reverting module docstring
killerontherun1 May 29, 2019
1fbc33f
reverting module level docstring changes
killerontherun1 May 29, 2019
f19dc4b
reverting changes outside pandas.core
killerontherun1 May 29, 2019
27438f5
reverting changes outside pandas.core
killerontherun1 May 29, 2019
d8790f4
reverting changes outside pandas.core
killerontherun1 May 29, 2019
ff3ebab
reverting changes outside pandas.core
killerontherun1 May 29, 2019
63426eb
reverted changes outside pandas.core
killerontherun1 May 29, 2019
1b0527e
reverting changes outside pandas.core
killerontherun1 May 29, 2019
654b166
reverting changes outside pandas.core
killerontherun1 May 29, 2019
a3e9376
reverting changes outside pandas.core
killerontherun1 May 29, 2019
558a527
reverting changes outside pandas.core
killerontherun1 May 29, 2019
44368ae
reverting changes outside pandas.core
killerontherun1 May 29, 2019
8ff2110
correcting reverted changes to pandas.io.pytables
killerontherun1 May 29, 2019
31cb387
updating accessor
killerontherun1 May 31, 2019
e19bbc0
accessor fix
killerontherun1 May 31, 2019
31eaf26
added \n instead of line breaks
killerontherun1 May 31, 2019
4234703
updating line breaks with \n
killerontherun1 May 31, 2019
7a33496
Merge remote-tracking branch 'upstream/master' into docstring_GL01GL0…
Jun 14, 2019
2a81152
update to resolve
killerontherun1 Jun 14, 2019
fe41a8a
solving line break issue for to_tuples in pandas.arrays.InervalArray
Jun 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def decorator(accessor):
return decorator


_doc = """\
_doc = """
Register a custom accessor on %(klass)s objects.

Parameters
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def contains(cat, key, container):
return any(loc_ in container for loc_ in loc)


_codes_doc = """\
_codes_doc = """
The category codes of this categorical.
Level codes are an array if integer which are the positions of the real
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ def __array__(self, dtype=None):
result[i] = Interval(left[i], right[i], closed)
return result

_interval_shared_docs['to_tuples'] = """\
_interval_shared_docs['to_tuples'] = """
Return an %(return_type)s of tuples of the form (left, right)

Parameters
Expand All @@ -1001,7 +1001,7 @@ def __array__(self, dtype=None):
Returns
-------
tuples: %(return_type)s
%(examples)s\
%(examples)s
"""

@Appender(_interval_shared_docs['to_tuples'] % dict(
Expand Down
8 changes: 3 additions & 5 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,7 @@ def _is_builtin_func(self, arg):


class IndexOpsMixin:
""" common ops mixin to support a unified interface / docs for Series /
Index
"""
"""\nCommon ops mixin to support a unified interface / docs for Series / Index\n"""

# ndarray compatibility
__array_priority__ = 1000
Expand All @@ -656,8 +654,8 @@ def transpose(self, *args, **kwargs):
nv.validate_transpose(args, kwargs)
return self

T = property(transpose, doc="Return the transpose, which is by "
"definition self.")
T = property(transpose, doc="""\nReturn the transpose, which is by
definition self.\n""")

@property
def _is_homogeneous_type(self):
Expand Down
19 changes: 12 additions & 7 deletions pandas/core/computation/eval.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

"""Top level ``eval`` module.
"""
Top level ``eval`` module.
"""

import tokenize
Expand All @@ -15,7 +16,8 @@


def _check_engine(engine):
"""Make sure a valid engine is passed.
"""
Make sure a valid engine is passed.

Parameters
----------
Expand All @@ -31,7 +33,6 @@ def _check_engine(engine):
Returns
-------
string engine

"""
from pandas.core.computation.check import _NUMEXPR_INSTALLED

Expand Down Expand Up @@ -60,7 +61,8 @@ def _check_engine(engine):


def _check_parser(parser):
"""Make sure a valid parser is passed.
"""
Make sure a valid parser is passed.

Parameters
----------
Expand Down Expand Up @@ -88,7 +90,8 @@ def _check_resolvers(resolvers):


def _check_expression(expr):
"""Make sure an expression is not an empty string
"""
Make sure an expression is not an empty string

Parameters
----------
Expand All @@ -105,7 +108,8 @@ def _check_expression(expr):


def _convert_expression(expr):
"""Convert an object to an expression.
"""
Convert an object to an expression.

Thus function converts an object to an expression (a unicode string) and
checks to make sure it isn't empty after conversion. This is used to
Expand Down Expand Up @@ -155,7 +159,8 @@ def _check_for_locals(expr, stack_level, parser):
def eval(expr, parser='pandas', engine=None, truediv=True,
local_dict=None, global_dict=None, resolvers=(), level=0,
target=None, inplace=False):
"""Evaluate a Python expression as a string using various backends.
"""
Evaluate a Python expression as a string using various backends.

The following arithmetic operations are supported: ``+``, ``-``, ``*``,
``/``, ``**``, ``%``, ``//`` (python engine only) along with the following
Expand Down
16 changes: 12 additions & 4 deletions pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,16 @@ def __init__(self, unit="ns", tz=None):

@property
def unit(self):
"""The precision of the datetime data."""
"""
The precision of the datetime data.
"""
return self._unit

@property
def tz(self):
"""The timezone."""
"""
The timezone.
"""
return self._tz

@classmethod
Expand Down Expand Up @@ -777,7 +781,9 @@ def __new__(cls, freq=None):

@property
def freq(self):
"""The frequency object of this PeriodDtype."""
"""
The frequency object of this PeriodDtype.
"""
return self._freq

@classmethod
Expand Down Expand Up @@ -944,7 +950,9 @@ def __new__(cls, subtype=None):

@property
def subtype(self):
"""The dtype of the Interval bounds."""
"""
The dtype of the Interval bounds.
"""
return self._subtype

@classmethod
Expand Down
3 changes: 2 additions & 1 deletion pandas/core/dtypes/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ def is_named_tuple(obj):


def is_hashable(obj):
"""Return True if hash(obj) will succeed, False otherwise.
"""
Return True if hash(obj) will succeed, False otherwise.

Some types will pass a test against collections.abc.Hashable but fail when
they are actually hashed with hash().
Expand Down
6 changes: 4 additions & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,8 @@ def __iter__(self):

# can we get a better explanation of this?
def keys(self):
"""Get the 'info axis' (see Indexing for more)
"""
Get the 'info axis' (see Indexing for more)

This is index for Series, columns for DataFrame.

Expand All @@ -1844,7 +1845,8 @@ def keys(self):
return self._info_axis

def iteritems(self):
"""Iterate over (label, values) on info axis
"""
Iterate over (label, values) on info axis

This is index for Series, columns for DataFrame and so on.
"""
Expand Down
5 changes: 3 additions & 2 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class providing the base-class of operations.
{examples}
""")

_pipe_template = """\
_pipe_template = """
Apply a function `func` with arguments to this %(klass)s object and return
the function's result.

Expand Down Expand Up @@ -223,7 +223,8 @@ class providing the base-class of operations.

Examples
--------
%(examples)s"""
%(examples)s
"""

_transform_template = """
Call function producing a like-indexed %(klass)s on each group and
Expand Down
3 changes: 2 additions & 1 deletion pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,8 @@ def _find_non_overlapping_monotonic_bounds(self, key):
return start, stop

def get_loc(self, key, method=None):
"""Get integer location, slice or boolean mask for requested label.
"""
Get integer location, slice or boolean mask for requested label.

Parameters
----------
Expand Down
10 changes: 7 additions & 3 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ def _set_names(self, names, level=None, validate=True):
self.levels[l].rename(name, inplace=True)

names = property(fset=_set_names, fget=_get_names,
doc="Names of levels in MultiIndex")
doc="""\nNames of levels in MultiIndex\n""")

@Appender(_index_shared_docs['_get_grouper_for_level'])
def _get_grouper_for_level(self, mapper, level):
Expand Down Expand Up @@ -1773,12 +1773,16 @@ def remove_unused_levels(self):

@property
def nlevels(self):
"""Integer number of levels in this MultiIndex."""
"""
Integer number of levels in this MultiIndex.
"""
return len(self.levels)

@property
def levshape(self):
"""A tuple with the length of each level."""
"""
A tuple with the length of each level.
"""
return tuple(len(x) for x in self.levels)

def __reduce__(self):
Expand Down
3 changes: 2 additions & 1 deletion pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,8 @@ def _get_slice_axis(self, slice_obj, axis=None):


class _IXIndexer(_NDFrameIndexer):
"""A primarily label-location based indexer, with integer position
"""
A primarily label-location based indexer, with integer position
fallback.

Warning: Starting in 0.20.0, the .ix indexer is deprecated, in
Expand Down
3 changes: 1 addition & 2 deletions pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ def _assure_grouper(self):
>>> df.resample('2D').pipe(lambda x: x.max() - x.min())
A
2012-08-02 1
2012-08-04 1
""")
2012-08-04 1""")
@Appender(_pipe_template)
def pipe(self, func, *args, **kwargs):
return super().pipe(func, *args, **kwargs)
Expand Down
6 changes: 4 additions & 2 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def merge_ordered(left, right, on=None,
left_by=None, right_by=None,
fill_method=None, suffixes=('_x', '_y'),
how='outer'):
"""Perform merge with optional filling/interpolation designed for ordered
"""
Perform merge with optional filling/interpolation designed for ordered
data like time series data. Optionally perform group-wise merge (see
examples)

Expand Down Expand Up @@ -240,7 +241,8 @@ def merge_asof(left, right, on=None,
tolerance=None,
allow_exact_matches=True,
direction='backward'):
"""Perform an asof merge. This is similar to a left-join except that we
"""
Perform an asof merge. This is similar to a left-join except that we
match on nearest key rather than equal keys.

Both DataFrames must be sorted by the key.
Expand Down