From 2a8dd1989e60417ade2d132cb768546e229b2f66 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Sat, 17 Aug 2019 20:55:18 -0500 Subject: [PATCH 1/9] style: Docstring text should be on the next line after opening `"""` and be followed immediately by the line with closing `"""`. --- pandas/conftest.py | 35 ++++++++++++++++++++++++----------- pandas/io/html.py | 24 ++++++++++++++++-------- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index 2cf7bf6a6df41..b987e77c77082 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -123,18 +123,22 @@ def ip(): @pytest.fixture(params=[True, False, None]) def observed(request): - """ pass in the observed keyword to groupby for [True, False] + """ + pass in the observed keyword to groupby for [True, False] This indicates whether categoricals should return values for values which are not in the grouper [False / None], or only values which appear in the grouper [True]. [None] is supported for future compatibility if we decide to change the default (and would need to warn if this - parameter is not passed)""" + parameter is not passed) + """ return request.param @pytest.fixture(params=[True, False, None]) def ordered_fixture(request): - """Boolean 'ordered' parameter for Categorical.""" + """ + Boolean 'ordered' parameter for Categorical. + """ return request.param @@ -234,7 +238,8 @@ def cython_table_items(request): def _get_cython_table_params(ndframe, func_names_and_expected): - """combine frame, functions from SelectionMixin._cython_table + """ + combine frame, functions from SelectionMixin._cython_table keys and expected result. Parameters @@ -341,7 +346,8 @@ def strict_data_files(pytestconfig): @pytest.fixture def datapath(strict_data_files): - """Get the path to a data file. + """ + Get the path to a data file. Parameters ---------- @@ -375,7 +381,9 @@ def deco(*args): @pytest.fixture def iris(datapath): - """The iris dataset as a DataFrame.""" + """ + The iris dataset as a DataFrame. + """ return pd.read_csv(datapath("data", "iris.csv")) @@ -504,7 +512,8 @@ def tz_aware_fixture(request): @pytest.fixture(params=STRING_DTYPES) def string_dtype(request): - """Parametrized fixture for string dtypes. + """ + Parametrized fixture for string dtypes. * str * 'str' @@ -515,7 +524,8 @@ def string_dtype(request): @pytest.fixture(params=BYTES_DTYPES) def bytes_dtype(request): - """Parametrized fixture for bytes dtypes. + """ + Parametrized fixture for bytes dtypes. * bytes * 'bytes' @@ -525,7 +535,8 @@ def bytes_dtype(request): @pytest.fixture(params=OBJECT_DTYPES) def object_dtype(request): - """Parametrized fixture for object dtypes. + """ + Parametrized fixture for object dtypes. * object * 'object' @@ -535,7 +546,8 @@ def object_dtype(request): @pytest.fixture(params=DATETIME64_DTYPES) def datetime64_dtype(request): - """Parametrized fixture for datetime64 dtypes. + """ + Parametrized fixture for datetime64 dtypes. * 'datetime64[ns]' * 'M8[ns]' @@ -545,7 +557,8 @@ def datetime64_dtype(request): @pytest.fixture(params=TIMEDELTA64_DTYPES) def timedelta64_dtype(request): - """Parametrized fixture for timedelta64 dtypes. + """ + Parametrized fixture for timedelta64 dtypes. * 'timedelta64[ns]' * 'm8[ns]' diff --git a/pandas/io/html.py b/pandas/io/html.py index 9d2647f226f00..490c574463b9b 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -1,4 +1,5 @@ -""":mod:`pandas.io.html` is a module containing functionality for dealing with +""" +:mod:`pandas.io.html` is a module containing functionality for dealing with HTML IO. """ @@ -58,7 +59,8 @@ def _importers(): def _remove_whitespace(s, regex=_RE_WHITESPACE): - """Replace extra whitespace inside of a string with a single space. + """ + Replace extra whitespace inside of a string with a single space. Parameters ---------- @@ -77,7 +79,8 @@ def _remove_whitespace(s, regex=_RE_WHITESPACE): def _get_skiprows(skiprows): - """Get an iterator given an integer, slice or container. + """ + Get an iterator given an integer, slice or container. Parameters ---------- @@ -107,7 +110,8 @@ def _get_skiprows(skiprows): def _read(obj): - """Try to read from a url, file or string. + """ + Try to read from a url, file or string. Parameters ---------- @@ -136,7 +140,8 @@ def _read(obj): class _HtmlFrameParser: - """Base class for parsers that parse HTML into DataFrames. + """ + Base class for parsers that parse HTML into DataFrames. Parameters ---------- @@ -515,7 +520,8 @@ def _handle_hidden_tables(self, tbl_list, attr_name): class _BeautifulSoupHtml5LibFrameParser(_HtmlFrameParser): - """HTML to DataFrame parser that uses BeautifulSoup under the hood. + """ + HTML to DataFrame parser that uses BeautifulSoup under the hood. See Also -------- @@ -622,7 +628,8 @@ def _build_xpath_expr(attrs): class _LxmlFrameParser(_HtmlFrameParser): - """HTML to DataFrame parser that uses lxml under the hood. + """ + HTML to DataFrame parser that uses lxml under the hood. Warning ------- @@ -937,7 +944,8 @@ def read_html( keep_default_na=True, displayed_only=True, ): - r"""Read HTML tables into a ``list`` of ``DataFrame`` objects. + r""" + Read HTML tables into a ``list`` of ``DataFrame`` objects. Parameters ---------- From 318bd9a02fdbd359de787c5f0f1504e63c76a360 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Sat, 17 Aug 2019 23:16:42 -0500 Subject: [PATCH 2/9] style: Docstring text should be on the next line after opening `"""` and be followed immediately by the line with closing `"""`. --- pandas/util/_depr_module.py | 3 ++- pandas/util/_doctools.py | 8 +++--- pandas/util/_exceptions.py | 4 ++- pandas/util/_validators.py | 10 +++++--- pandas/util/testing.py | 49 ++++++++++++++++++++++++------------- 5 files changed, 49 insertions(+), 25 deletions(-) diff --git a/pandas/util/_depr_module.py b/pandas/util/_depr_module.py index 54f090ede3fc4..e70c4dc8fa666 100644 --- a/pandas/util/_depr_module.py +++ b/pandas/util/_depr_module.py @@ -8,7 +8,8 @@ class _DeprecatedModule: - """ Class for mocking deprecated modules. + """ + Class for mocking deprecated modules. Parameters ---------- diff --git a/pandas/util/_doctools.py b/pandas/util/_doctools.py index 11156bc972857..e697b22dd7cc1 100644 --- a/pandas/util/_doctools.py +++ b/pandas/util/_doctools.py @@ -6,7 +6,7 @@ class TablePlotter: """ Layout some DataFrames in vertical/horizontal layout for explanation. - Used in merging.rst + Used in merging.rst. """ def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5): @@ -16,7 +16,7 @@ def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5): def _shape(self, df): """ - Calculate table chape considering index levels. + Calculate table shape considering index levels. """ row, col = df.shape @@ -96,7 +96,9 @@ def plot(self, left, right, labels=None, vertical=True): return fig def _conv(self, data): - """Convert each input to appropriate for table outplot""" + """ + Convert each input to appropriate for table outplot. + """ if isinstance(data, pd.Series): if data.name is None: data = data.to_frame(name="") diff --git a/pandas/util/_exceptions.py b/pandas/util/_exceptions.py index 953c8a43a21b8..9ae0e89d7d234 100644 --- a/pandas/util/_exceptions.py +++ b/pandas/util/_exceptions.py @@ -3,7 +3,9 @@ @contextlib.contextmanager def rewrite_exception(old_name, new_name): - """Rewrite the message of an exception.""" + """ + Rewrite the message of an exception. + """ try: yield except Exception as e: diff --git a/pandas/util/_validators.py b/pandas/util/_validators.py index 8d5f9f7749682..85452b2161ef4 100644 --- a/pandas/util/_validators.py +++ b/pandas/util/_validators.py @@ -229,7 +229,9 @@ def validate_args_and_kwargs(fname, args, kwargs, max_fname_arg_count, compat_ar def validate_bool_kwarg(value, arg_name): - """ Ensures that argument passed in arg_name is of type bool. """ + """ + Ensures that argument passed in arg_name is of type bool. + """ if not (is_bool(value) or value is None): raise ValueError( 'For argument "{arg}" expected type bool, received ' @@ -239,7 +241,8 @@ def validate_bool_kwarg(value, arg_name): def validate_axis_style_args(data, args, kwargs, arg_name, method_name): - """Argument handler for mixed index, columns / axis functions + """ + Argument handler for mixed index, columns / axis functions In an attempt to handle both `.method(index, columns)`, and `.method(arg, axis=.)`, we have to do some bad things to argument @@ -335,7 +338,8 @@ def validate_axis_style_args(data, args, kwargs, arg_name, method_name): def validate_fillna_kwargs(value, method, validate_scalar_dict_value=True): - """Validate the keyword arguments to 'fillna'. + """ + Validate the keyword arguments to 'fillna'. This checks that exactly one of 'value' and 'method' is specified. If 'method' is specified, this validates that it's a valid method. diff --git a/pandas/util/testing.py b/pandas/util/testing.py index cf8452cdd0c59..5fbc9621f3ce0 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -476,7 +476,8 @@ def close(fignum=None): @contextmanager def ensure_clean(filename=None, return_filelike=False): - """Gets a temporary path and agrees to remove on close. + """ + Gets a temporary path and agrees to remove on close. Parameters ---------- @@ -566,7 +567,8 @@ def ensure_safe_environment_variables(): def equalContents(arr1, arr2): - """Checks if the set of unique elements of arr1 and arr2 are equivalent. + """ + Checks if the set of unique elements of arr1 and arr2 are equivalent. """ return frozenset(arr1) == frozenset(arr2) @@ -581,7 +583,8 @@ def assert_index_equal( check_categorical: bool = True, obj: str = "Index", ) -> None: - """Check that left and right Index are equal. + """ + Check that left and right Index are equal. Parameters ---------- @@ -603,7 +606,7 @@ def assert_index_equal( Whether to compare internal Categorical exactly. obj : str, default 'Index' Specify object name being compared, internally used to show appropriate - assertion message + assertion message. """ __tracebackhide__ = True @@ -707,7 +710,9 @@ def _get_ilevel_values(index, level): def assert_class_equal(left, right, exact=True, obj="Input"): - """checks classes are equal.""" + """ + Checks classes are equal. + """ __tracebackhide__ = True def repr_class(x): @@ -734,7 +739,8 @@ def repr_class(x): def assert_attr_equal(attr, left, right, obj="Attributes"): - """checks attributes are equal. Both objects must have attribute. + """ + Checks attributes are equal. Both objects must have attribute. Parameters ---------- @@ -801,7 +807,9 @@ def isiterable(obj): def assert_is_sorted(seq): - """Assert that the sequence is sorted.""" + """ + Assert that the sequence is sorted. + """ if isinstance(seq, (Index, Series)): seq = seq.values # sorting does not change precisions @@ -811,7 +819,8 @@ def assert_is_sorted(seq): def assert_categorical_equal( left, right, check_dtype=True, check_category_order=True, obj="Categorical" ): - """Test that Categoricals are equivalent. + """ + Test that Categoricals are equivalent. Parameters ---------- @@ -856,7 +865,8 @@ def assert_categorical_equal( def assert_interval_array_equal(left, right, exact="equiv", obj="IntervalArray"): - """Test that two IntervalArrays are equivalent. + """ + Test that two IntervalArrays are equivalent. Parameters ---------- @@ -919,11 +929,13 @@ def raise_assert_detail(obj, message, left, right, diff=None): elif is_categorical_dtype(right): right = repr(right) - msg = """{obj} are different - -{message} -[left]: {left} -[right]: {right}""".format( + msg = """ + {obj} are different + + {message} + [left]: {left} + [right]: {right} + """.format( obj=obj, message=message, left=left, right=right ) @@ -942,7 +954,8 @@ def assert_numpy_array_equal( check_same=None, obj="numpy array", ): - """ Checks that 'np.ndarray' is equivalent + """ + Checks that 'np.ndarray' is equivalent Parameters ---------- @@ -1019,7 +1032,8 @@ def _raise(left, right, err_msg): def assert_extension_array_equal( left, right, check_dtype=True, check_less_precise=False, check_exact=False ): - """Check that left and right ExtensionArrays are equal. + """ + Check that left and right ExtensionArrays are equal. Parameters ---------- @@ -1082,7 +1096,8 @@ def assert_series_equal( check_categorical=True, obj="Series", ): - """Check that left and right Series are equal. + """ + Check that left and right Series are equal. Parameters ---------- From 65f2b4327a1ffc40e3fee577ad7d0407ef103769 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Sun, 18 Aug 2019 00:00:38 -0500 Subject: [PATCH 3/9] style: remove white space on blank line #934 in pandas/util/testing.py --- pandas/util/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index 5fbc9621f3ce0..f8e2f1d003b94 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -931,7 +931,7 @@ def raise_assert_detail(obj, message, left, right, diff=None): msg = """ {obj} are different - + {message} [left]: {left} [right]: {right} From 86381ecfa4f3b3f094ac588a22e7b04ef14cb048 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Sun, 18 Aug 2019 09:05:51 -0500 Subject: [PATCH 4/9] style: Docstring text should be on the next line after opening `"""` and be followed immediately by the line with closing `"""`. --- pandas/tseries/frequencies.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/tseries/frequencies.py b/pandas/tseries/frequencies.py index dfe91b514bbe1..20cb920c5ea4e 100644 --- a/pandas/tseries/frequencies.py +++ b/pandas/tseries/frequencies.py @@ -53,7 +53,9 @@ def get_period_alias(offset_str): - """ alias to closest period strings BQ->Q etc""" + """ + Alias to closest period strings BQ->Q etc. + """ return _offset_to_period_map.get(offset_str, None) From c6dd33351c5986c639de982245cbdd23fe0ae6b4 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Sun, 18 Aug 2019 09:16:54 -0500 Subject: [PATCH 5/9] style: Docstring text should be on the next line after opening `"""` and be followed immediately by the line with closing `"""`. --- pandas/tests/io/conftest.py | 15 +++++++++++---- pandas/tests/io/generate_legacy_storage_files.py | 4 +++- pandas/tests/io/msgpack/test_read_size.py | 4 +++- pandas/tests/io/msgpack/test_unpack_raw.py | 4 +++- pandas/tests/io/test_clipboard.py | 3 ++- pandas/tests/io/test_common.py | 4 +++- pandas/tests/io/test_html.py | 4 +++- pandas/tests/io/test_stata.py | 9 +++++---- pandas/tests/scalar/timedelta/test_timedelta.py | 4 +++- pandas/tests/test_base.py | 8 ++++++-- pandas/tests/test_expressions.py | 2 +- pandas/tests/test_multilevel.py | 8 ++++++-- pandas/tests/test_register_accessor.py | 6 ++++-- 13 files changed, 53 insertions(+), 22 deletions(-) diff --git a/pandas/tests/io/conftest.py b/pandas/tests/io/conftest.py index 7b6b9b6380a36..e42d3ba240a04 100644 --- a/pandas/tests/io/conftest.py +++ b/pandas/tests/io/conftest.py @@ -9,25 +9,32 @@ @pytest.fixture def tips_file(datapath): - """Path to the tips dataset""" + """ + Path to the tips dataset. + """ return datapath("io", "parser", "data", "tips.csv") @pytest.fixture def jsonl_file(datapath): - """Path a JSONL dataset""" + """ + Path a JSONL dataset. + """ return datapath("io", "parser", "data", "items.jsonl") @pytest.fixture def salaries_table(datapath): - """DataFrame with the salaries dataset""" + """ + DataFrame with the salaries dataset. + """ return read_csv(datapath("io", "parser", "data", "salaries.csv"), sep="\t") @pytest.fixture def s3_resource(tips_file, jsonl_file): - """Fixture for mocking S3 interaction. + """ + Fixture for mocking S3 interaction. The primary bucket name is "pandas-test". The following datasets are loaded. diff --git a/pandas/tests/io/generate_legacy_storage_files.py b/pandas/tests/io/generate_legacy_storage_files.py index 2d2938697bd80..ae541a8ebe25a 100755 --- a/pandas/tests/io/generate_legacy_storage_files.py +++ b/pandas/tests/io/generate_legacy_storage_files.py @@ -131,7 +131,9 @@ def _create_sp_frame(): def create_data(): - """ create the pickle/msgpack data """ + """ + Create the pickle/msgpack data. + """ data = { "A": [0.0, 1.0, 2.0, 3.0, np.nan], diff --git a/pandas/tests/io/msgpack/test_read_size.py b/pandas/tests/io/msgpack/test_read_size.py index 7d2b539f12085..6239c69ff80b3 100644 --- a/pandas/tests/io/msgpack/test_read_size.py +++ b/pandas/tests/io/msgpack/test_read_size.py @@ -1,4 +1,6 @@ -"""Test Unpacker's read_array_header and read_map_header methods""" +""" +Test Unpacker's read_array_header and read_map_header methods. +""" from pandas.io.msgpack import OutOfData, Unpacker, packb UnexpectedTypeException = ValueError diff --git a/pandas/tests/io/msgpack/test_unpack_raw.py b/pandas/tests/io/msgpack/test_unpack_raw.py index f844553bfc34a..545cb5298e006 100644 --- a/pandas/tests/io/msgpack/test_unpack_raw.py +++ b/pandas/tests/io/msgpack/test_unpack_raw.py @@ -1,4 +1,6 @@ -"""Tests for cases where the user seeks to obtain packed msgpack objects""" +""" +Tests for cases where the user seeks to obtain packed msgpack objects. +""" import io diff --git a/pandas/tests/io/test_clipboard.py b/pandas/tests/io/test_clipboard.py index fccd52f9916b8..bc8e1229589a7 100644 --- a/pandas/tests/io/test_clipboard.py +++ b/pandas/tests/io/test_clipboard.py @@ -111,7 +111,8 @@ def df(request): @pytest.fixture def mock_clipboard(monkeypatch, request): - """Fixture mocking clipboard IO. + """ + Fixture mocking clipboard IO. This mocks pandas.io.clipboard.clipboard_get and pandas.io.clipboard.clipboard_set. diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py index 8e09e96fbd471..2665dfb905ed9 100644 --- a/pandas/tests/io/test_common.py +++ b/pandas/tests/io/test_common.py @@ -17,7 +17,9 @@ class CustomFSPath: - """For testing fspath on unknown objects""" + """ + For testing fspath on unknown objects. + """ def __init__(self, path): self.path = path diff --git a/pandas/tests/io/test_html.py b/pandas/tests/io/test_html.py index 615e2735cd288..1662d3855b53c 100644 --- a/pandas/tests/io/test_html.py +++ b/pandas/tests/io/test_html.py @@ -33,7 +33,9 @@ ] ) def html_encoding_file(request, datapath): - """Parametrized fixture for HTML encoding test filenames.""" + """ + Parametrized fixture for HTML encoding test filenames. + """ return datapath("io", "data", "html_encoding", request.param) diff --git a/pandas/tests/io/test_stata.py b/pandas/tests/io/test_stata.py index 1e7d568602656..47b84b949bc57 100644 --- a/pandas/tests/io/test_stata.py +++ b/pandas/tests/io/test_stata.py @@ -1769,10 +1769,11 @@ def test_strl_latin1(self): def test_encoding_latin1_118(self): # GH 25960 msg = """ -One or more strings in the dta file could not be decoded using utf-8, and -so the fallback encoding of latin-1 is being used. This can happen when a file -has been incorrectly encoded by Stata or some other software. You should verify -the string values returned are correct.""" + One or more strings in the dta file could not be decoded using utf-8, and + so the fallback encoding of latin-1 is being used. This can happen when a file + has been incorrectly encoded by Stata or some other software. You should verify + the string values returned are correct. + """ with tm.assert_produces_warning(UnicodeWarning) as w: encoded = read_stata(self.dta_encoding_118) assert len(w) == 151 diff --git a/pandas/tests/scalar/timedelta/test_timedelta.py b/pandas/tests/scalar/timedelta/test_timedelta.py index e4980be49d35f..7dd83ad818fb1 100644 --- a/pandas/tests/scalar/timedelta/test_timedelta.py +++ b/pandas/tests/scalar/timedelta/test_timedelta.py @@ -1,4 +1,6 @@ -""" test the scalar Timedelta """ +""" +Test the scalar Timedelta. +""" from datetime import timedelta import re diff --git a/pandas/tests/test_base.py b/pandas/tests/test_base.py index c760c75e44f6b..4963ed296bf0e 100644 --- a/pandas/tests/test_base.py +++ b/pandas/tests/test_base.py @@ -112,7 +112,9 @@ def _get_foo(self): foo = property(_get_foo, _set_foo, doc="foo property") def bar(self, *args, **kwargs): - """ a test bar method """ + """ + A test bar method. + """ pass class Delegate(PandasDelegate, PandasObject): @@ -158,7 +160,9 @@ def test_memory_usage(self): class Ops: def _allow_na_ops(self, obj): - """Whether to skip test cases including NaN""" + """ + Whether to skip test cases including NaN. + """ if isinstance(obj, Index) and (obj.is_boolean() or not obj._can_hold_na): # don't test boolean / int64 index return False diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py index 4070624985068..209581838bbfd 100644 --- a/pandas/tests/test_expressions.py +++ b/pandas/tests/test_expressions.py @@ -102,7 +102,7 @@ def run_binary( numexpr_ops={"gt", "lt", "ge", "le", "eq", "ne"}, ): """ - tests solely that the result is the same whether or not numexpr is + Tests solely that the result is the same whether or not numexpr is enabled. Need to test whether the function does the correct thing elsewhere. """ diff --git a/pandas/tests/test_multilevel.py b/pandas/tests/test_multilevel.py index dc4db6e7902a8..916a68c53fd94 100644 --- a/pandas/tests/test_multilevel.py +++ b/pandas/tests/test_multilevel.py @@ -715,7 +715,9 @@ def test_unstack_period_frame(self): tm.assert_frame_equal(result3, expected) def test_stack_multiple_bug(self): - """ bug when some uniques are not present in the data #3170""" + """ + Bug when some uniques are not present in the data #3170. + """ id_col = ([1] * 3) + ([2] * 3) name = (["a"] * 3) + (["b"] * 3) date = pd.to_datetime(["2013-01-03", "2013-01-04", "2013-01-05"] * 2) @@ -1914,7 +1916,9 @@ def test_repeat(self): class TestSorted(Base): - """ everything you wanted to test about sorting """ + """ + Everything you wanted to test about sorting. + """ def test_sort_index_preserve_levels(self): result = self.frame.sort_index() diff --git a/pandas/tests/test_register_accessor.py b/pandas/tests/test_register_accessor.py index 97086f8ab1e85..08546fb1fd684 100644 --- a/pandas/tests/test_register_accessor.py +++ b/pandas/tests/test_register_accessor.py @@ -8,8 +8,10 @@ @contextlib.contextmanager def ensure_removed(obj, attr): - """Ensure that an attribute added to 'obj' during the test is - removed when we're done""" + """ + Ensure that an attribute added to 'obj' during the test is + removed when we're done. + """ try: yield finally: From ced6b62a57dbcca34de77bb230183d564a96ed18 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Sun, 18 Aug 2019 09:19:46 -0500 Subject: [PATCH 6/9] style: Docstring text should be on the next line after opening `"""` and be followed immediately by the line with closing `"""`. --- pandas/plotting/_matplotlib/hist.py | 4 +++- pandas/plotting/_matplotlib/style.py | 4 +++- pandas/plotting/_matplotlib/timeseries.py | 4 +++- pandas/plotting/_matplotlib/tools.py | 3 ++- pandas/plotting/_misc.py | 6 ++++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pandas/plotting/_matplotlib/hist.py b/pandas/plotting/_matplotlib/hist.py index 5213e09f14067..b4b63bf1ae402 100644 --- a/pandas/plotting/_matplotlib/hist.py +++ b/pandas/plotting/_matplotlib/hist.py @@ -84,7 +84,9 @@ def _make_plot(self): self._add_legend_handle(artists[0], label, index=i) def _make_plot_keywords(self, kwds, y): - """merge BoxPlot/KdePlot properties to passed kwds""" + """ + Merge BoxPlot/KdePlot properties to passed kwds. + """ # y is required for KdePlot kwds["bottom"] = self.bottom kwds["bins"] = self.bins diff --git a/pandas/plotting/_matplotlib/style.py b/pandas/plotting/_matplotlib/style.py index e1bba5856e271..72a5440ae0ddf 100644 --- a/pandas/plotting/_matplotlib/style.py +++ b/pandas/plotting/_matplotlib/style.py @@ -43,7 +43,9 @@ def _get_standard_colors( elif color_type == "random": def random_color(column): - """ Returns a random color represented as a list of length 3""" + """ + Returns a random color represented as a list of length 3. + """ # GH17525 use common._random_state to avoid resetting the seed rs = com.random_state(column) return rs.rand(3).tolist() diff --git a/pandas/plotting/_matplotlib/timeseries.py b/pandas/plotting/_matplotlib/timeseries.py index f3fcb090e9883..a8b88e20ee45e 100644 --- a/pandas/plotting/_matplotlib/timeseries.py +++ b/pandas/plotting/_matplotlib/timeseries.py @@ -169,7 +169,9 @@ def _replot_ax(ax, freq, kwargs): def _decorate_axes(ax, freq, kwargs): - """Initialize axes for time-series plotting""" + """ + Initialize axes for time-series plotting. + """ if not hasattr(ax, "_plot_data"): ax._plot_data = [] diff --git a/pandas/plotting/_matplotlib/tools.py b/pandas/plotting/_matplotlib/tools.py index 8472eb3a3d887..5b43394124378 100644 --- a/pandas/plotting/_matplotlib/tools.py +++ b/pandas/plotting/_matplotlib/tools.py @@ -106,7 +106,8 @@ def _subplots( layout_type="box", **fig_kw ): - """Create a figure with a set of subplots already made. + """ + Create a figure with a set of subplots already made. This utility wrapper makes it convenient to create common layouts of subplots, including the enclosing figure object, in a single call. diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 1cba0e7354182..7ed0ffc6d0115 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -329,7 +329,8 @@ def parallel_coordinates( sort_labels=False, **kwds ): - """Parallel coordinates plotting. + """ + Parallel coordinates plotting. Parameters ---------- @@ -392,7 +393,8 @@ def parallel_coordinates( def lag_plot(series, lag=1, ax=None, **kwds): - """Lag plot for time series. + """ + Lag plot for time series. Parameters ---------- From 397f2659b4aa0ede1d944d96d7a5d4b03bc7dab6 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Thu, 22 Aug 2019 21:41:26 -0500 Subject: [PATCH 7/9] DOC: revert to previous indentation level of docstring, position 0 --- pandas/tests/io/test_stata.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/tests/io/test_stata.py b/pandas/tests/io/test_stata.py index 47b84b949bc57..5a6d4578c3f8e 100644 --- a/pandas/tests/io/test_stata.py +++ b/pandas/tests/io/test_stata.py @@ -1769,10 +1769,10 @@ def test_strl_latin1(self): def test_encoding_latin1_118(self): # GH 25960 msg = """ - One or more strings in the dta file could not be decoded using utf-8, and - so the fallback encoding of latin-1 is being used. This can happen when a file - has been incorrectly encoded by Stata or some other software. You should verify - the string values returned are correct. +One or more strings in the dta file could not be decoded using utf-8, and +so the fallback encoding of latin-1 is being used. This can happen when a file +has been incorrectly encoded by Stata or some other software. You should verify +the string values returned are correct. """ with tm.assert_produces_warning(UnicodeWarning) as w: encoded = read_stata(self.dta_encoding_118) From 1284936063ae824ec2d66ce4eb13731f3c70e283 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Fri, 23 Aug 2019 23:59:15 -0500 Subject: [PATCH 8/9] DOC: Going at this a bit more slowly, back out changes that caused the CI problems. --- pandas/plotting/_matplotlib/hist.py | 4 +- pandas/plotting/_matplotlib/style.py | 4 +- pandas/plotting/_matplotlib/timeseries.py | 4 +- pandas/plotting/_matplotlib/tools.py | 3 +- pandas/plotting/_misc.py | 6 +-- pandas/tests/io/conftest.py | 15 ++---- .../tests/io/generate_legacy_storage_files.py | 4 +- pandas/tests/io/msgpack/test_read_size.py | 4 +- pandas/tests/io/msgpack/test_unpack_raw.py | 4 +- pandas/tests/io/test_clipboard.py | 3 +- pandas/tests/io/test_common.py | 4 +- pandas/tests/io/test_html.py | 4 +- pandas/tests/io/test_stata.py | 3 +- .../tests/scalar/timedelta/test_timedelta.py | 4 +- pandas/tests/test_base.py | 8 +--- pandas/tests/test_expressions.py | 2 +- pandas/tests/test_multilevel.py | 8 +--- pandas/tests/test_register_accessor.py | 6 +-- pandas/tseries/frequencies.py | 4 +- pandas/util/_depr_module.py | 3 +- pandas/util/_doctools.py | 8 ++-- pandas/util/_exceptions.py | 4 +- pandas/util/_validators.py | 10 ++-- pandas/util/testing.py | 47 +++++++------------ 24 files changed, 50 insertions(+), 116 deletions(-) diff --git a/pandas/plotting/_matplotlib/hist.py b/pandas/plotting/_matplotlib/hist.py index b4b63bf1ae402..5213e09f14067 100644 --- a/pandas/plotting/_matplotlib/hist.py +++ b/pandas/plotting/_matplotlib/hist.py @@ -84,9 +84,7 @@ def _make_plot(self): self._add_legend_handle(artists[0], label, index=i) def _make_plot_keywords(self, kwds, y): - """ - Merge BoxPlot/KdePlot properties to passed kwds. - """ + """merge BoxPlot/KdePlot properties to passed kwds""" # y is required for KdePlot kwds["bottom"] = self.bottom kwds["bins"] = self.bins diff --git a/pandas/plotting/_matplotlib/style.py b/pandas/plotting/_matplotlib/style.py index 72a5440ae0ddf..e1bba5856e271 100644 --- a/pandas/plotting/_matplotlib/style.py +++ b/pandas/plotting/_matplotlib/style.py @@ -43,9 +43,7 @@ def _get_standard_colors( elif color_type == "random": def random_color(column): - """ - Returns a random color represented as a list of length 3. - """ + """ Returns a random color represented as a list of length 3""" # GH17525 use common._random_state to avoid resetting the seed rs = com.random_state(column) return rs.rand(3).tolist() diff --git a/pandas/plotting/_matplotlib/timeseries.py b/pandas/plotting/_matplotlib/timeseries.py index a8b88e20ee45e..f3fcb090e9883 100644 --- a/pandas/plotting/_matplotlib/timeseries.py +++ b/pandas/plotting/_matplotlib/timeseries.py @@ -169,9 +169,7 @@ def _replot_ax(ax, freq, kwargs): def _decorate_axes(ax, freq, kwargs): - """ - Initialize axes for time-series plotting. - """ + """Initialize axes for time-series plotting""" if not hasattr(ax, "_plot_data"): ax._plot_data = [] diff --git a/pandas/plotting/_matplotlib/tools.py b/pandas/plotting/_matplotlib/tools.py index 597dae1ef7eca..67fa79ad5da8c 100644 --- a/pandas/plotting/_matplotlib/tools.py +++ b/pandas/plotting/_matplotlib/tools.py @@ -106,8 +106,7 @@ def _subplots( layout_type="box", **fig_kw ): - """ - Create a figure with a set of subplots already made. + """Create a figure with a set of subplots already made. This utility wrapper makes it convenient to create common layouts of subplots, including the enclosing figure object, in a single call. diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 7ed0ffc6d0115..1cba0e7354182 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -329,8 +329,7 @@ def parallel_coordinates( sort_labels=False, **kwds ): - """ - Parallel coordinates plotting. + """Parallel coordinates plotting. Parameters ---------- @@ -393,8 +392,7 @@ def parallel_coordinates( def lag_plot(series, lag=1, ax=None, **kwds): - """ - Lag plot for time series. + """Lag plot for time series. Parameters ---------- diff --git a/pandas/tests/io/conftest.py b/pandas/tests/io/conftest.py index e42d3ba240a04..7b6b9b6380a36 100644 --- a/pandas/tests/io/conftest.py +++ b/pandas/tests/io/conftest.py @@ -9,32 +9,25 @@ @pytest.fixture def tips_file(datapath): - """ - Path to the tips dataset. - """ + """Path to the tips dataset""" return datapath("io", "parser", "data", "tips.csv") @pytest.fixture def jsonl_file(datapath): - """ - Path a JSONL dataset. - """ + """Path a JSONL dataset""" return datapath("io", "parser", "data", "items.jsonl") @pytest.fixture def salaries_table(datapath): - """ - DataFrame with the salaries dataset. - """ + """DataFrame with the salaries dataset""" return read_csv(datapath("io", "parser", "data", "salaries.csv"), sep="\t") @pytest.fixture def s3_resource(tips_file, jsonl_file): - """ - Fixture for mocking S3 interaction. + """Fixture for mocking S3 interaction. The primary bucket name is "pandas-test". The following datasets are loaded. diff --git a/pandas/tests/io/generate_legacy_storage_files.py b/pandas/tests/io/generate_legacy_storage_files.py index ae541a8ebe25a..2d2938697bd80 100755 --- a/pandas/tests/io/generate_legacy_storage_files.py +++ b/pandas/tests/io/generate_legacy_storage_files.py @@ -131,9 +131,7 @@ def _create_sp_frame(): def create_data(): - """ - Create the pickle/msgpack data. - """ + """ create the pickle/msgpack data """ data = { "A": [0.0, 1.0, 2.0, 3.0, np.nan], diff --git a/pandas/tests/io/msgpack/test_read_size.py b/pandas/tests/io/msgpack/test_read_size.py index 6239c69ff80b3..7d2b539f12085 100644 --- a/pandas/tests/io/msgpack/test_read_size.py +++ b/pandas/tests/io/msgpack/test_read_size.py @@ -1,6 +1,4 @@ -""" -Test Unpacker's read_array_header and read_map_header methods. -""" +"""Test Unpacker's read_array_header and read_map_header methods""" from pandas.io.msgpack import OutOfData, Unpacker, packb UnexpectedTypeException = ValueError diff --git a/pandas/tests/io/msgpack/test_unpack_raw.py b/pandas/tests/io/msgpack/test_unpack_raw.py index 545cb5298e006..f844553bfc34a 100644 --- a/pandas/tests/io/msgpack/test_unpack_raw.py +++ b/pandas/tests/io/msgpack/test_unpack_raw.py @@ -1,6 +1,4 @@ -""" -Tests for cases where the user seeks to obtain packed msgpack objects. -""" +"""Tests for cases where the user seeks to obtain packed msgpack objects""" import io diff --git a/pandas/tests/io/test_clipboard.py b/pandas/tests/io/test_clipboard.py index bc8e1229589a7..fccd52f9916b8 100644 --- a/pandas/tests/io/test_clipboard.py +++ b/pandas/tests/io/test_clipboard.py @@ -111,8 +111,7 @@ def df(request): @pytest.fixture def mock_clipboard(monkeypatch, request): - """ - Fixture mocking clipboard IO. + """Fixture mocking clipboard IO. This mocks pandas.io.clipboard.clipboard_get and pandas.io.clipboard.clipboard_set. diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py index 2665dfb905ed9..8e09e96fbd471 100644 --- a/pandas/tests/io/test_common.py +++ b/pandas/tests/io/test_common.py @@ -17,9 +17,7 @@ class CustomFSPath: - """ - For testing fspath on unknown objects. - """ + """For testing fspath on unknown objects""" def __init__(self, path): self.path = path diff --git a/pandas/tests/io/test_html.py b/pandas/tests/io/test_html.py index 1662d3855b53c..615e2735cd288 100644 --- a/pandas/tests/io/test_html.py +++ b/pandas/tests/io/test_html.py @@ -33,9 +33,7 @@ ] ) def html_encoding_file(request, datapath): - """ - Parametrized fixture for HTML encoding test filenames. - """ + """Parametrized fixture for HTML encoding test filenames.""" return datapath("io", "data", "html_encoding", request.param) diff --git a/pandas/tests/io/test_stata.py b/pandas/tests/io/test_stata.py index 5a6d4578c3f8e..1e7d568602656 100644 --- a/pandas/tests/io/test_stata.py +++ b/pandas/tests/io/test_stata.py @@ -1772,8 +1772,7 @@ def test_encoding_latin1_118(self): One or more strings in the dta file could not be decoded using utf-8, and so the fallback encoding of latin-1 is being used. This can happen when a file has been incorrectly encoded by Stata or some other software. You should verify -the string values returned are correct. - """ +the string values returned are correct.""" with tm.assert_produces_warning(UnicodeWarning) as w: encoded = read_stata(self.dta_encoding_118) assert len(w) == 151 diff --git a/pandas/tests/scalar/timedelta/test_timedelta.py b/pandas/tests/scalar/timedelta/test_timedelta.py index 7dd83ad818fb1..e4980be49d35f 100644 --- a/pandas/tests/scalar/timedelta/test_timedelta.py +++ b/pandas/tests/scalar/timedelta/test_timedelta.py @@ -1,6 +1,4 @@ -""" -Test the scalar Timedelta. -""" +""" test the scalar Timedelta """ from datetime import timedelta import re diff --git a/pandas/tests/test_base.py b/pandas/tests/test_base.py index 4963ed296bf0e..c760c75e44f6b 100644 --- a/pandas/tests/test_base.py +++ b/pandas/tests/test_base.py @@ -112,9 +112,7 @@ def _get_foo(self): foo = property(_get_foo, _set_foo, doc="foo property") def bar(self, *args, **kwargs): - """ - A test bar method. - """ + """ a test bar method """ pass class Delegate(PandasDelegate, PandasObject): @@ -160,9 +158,7 @@ def test_memory_usage(self): class Ops: def _allow_na_ops(self, obj): - """ - Whether to skip test cases including NaN. - """ + """Whether to skip test cases including NaN""" if isinstance(obj, Index) and (obj.is_boolean() or not obj._can_hold_na): # don't test boolean / int64 index return False diff --git a/pandas/tests/test_expressions.py b/pandas/tests/test_expressions.py index c52fcab37c1cb..ca514f62f451d 100644 --- a/pandas/tests/test_expressions.py +++ b/pandas/tests/test_expressions.py @@ -102,7 +102,7 @@ def run_binary( numexpr_ops={"gt", "lt", "ge", "le", "eq", "ne"}, ): """ - Tests solely that the result is the same whether or not numexpr is + tests solely that the result is the same whether or not numexpr is enabled. Need to test whether the function does the correct thing elsewhere. """ diff --git a/pandas/tests/test_multilevel.py b/pandas/tests/test_multilevel.py index 916a68c53fd94..dc4db6e7902a8 100644 --- a/pandas/tests/test_multilevel.py +++ b/pandas/tests/test_multilevel.py @@ -715,9 +715,7 @@ def test_unstack_period_frame(self): tm.assert_frame_equal(result3, expected) def test_stack_multiple_bug(self): - """ - Bug when some uniques are not present in the data #3170. - """ + """ bug when some uniques are not present in the data #3170""" id_col = ([1] * 3) + ([2] * 3) name = (["a"] * 3) + (["b"] * 3) date = pd.to_datetime(["2013-01-03", "2013-01-04", "2013-01-05"] * 2) @@ -1916,9 +1914,7 @@ def test_repeat(self): class TestSorted(Base): - """ - Everything you wanted to test about sorting. - """ + """ everything you wanted to test about sorting """ def test_sort_index_preserve_levels(self): result = self.frame.sort_index() diff --git a/pandas/tests/test_register_accessor.py b/pandas/tests/test_register_accessor.py index 08546fb1fd684..97086f8ab1e85 100644 --- a/pandas/tests/test_register_accessor.py +++ b/pandas/tests/test_register_accessor.py @@ -8,10 +8,8 @@ @contextlib.contextmanager def ensure_removed(obj, attr): - """ - Ensure that an attribute added to 'obj' during the test is - removed when we're done. - """ + """Ensure that an attribute added to 'obj' during the test is + removed when we're done""" try: yield finally: diff --git a/pandas/tseries/frequencies.py b/pandas/tseries/frequencies.py index 20cb920c5ea4e..dfe91b514bbe1 100644 --- a/pandas/tseries/frequencies.py +++ b/pandas/tseries/frequencies.py @@ -53,9 +53,7 @@ def get_period_alias(offset_str): - """ - Alias to closest period strings BQ->Q etc. - """ + """ alias to closest period strings BQ->Q etc""" return _offset_to_period_map.get(offset_str, None) diff --git a/pandas/util/_depr_module.py b/pandas/util/_depr_module.py index e70c4dc8fa666..54f090ede3fc4 100644 --- a/pandas/util/_depr_module.py +++ b/pandas/util/_depr_module.py @@ -8,8 +8,7 @@ class _DeprecatedModule: - """ - Class for mocking deprecated modules. + """ Class for mocking deprecated modules. Parameters ---------- diff --git a/pandas/util/_doctools.py b/pandas/util/_doctools.py index e697b22dd7cc1..11156bc972857 100644 --- a/pandas/util/_doctools.py +++ b/pandas/util/_doctools.py @@ -6,7 +6,7 @@ class TablePlotter: """ Layout some DataFrames in vertical/horizontal layout for explanation. - Used in merging.rst. + Used in merging.rst """ def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5): @@ -16,7 +16,7 @@ def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5): def _shape(self, df): """ - Calculate table shape considering index levels. + Calculate table chape considering index levels. """ row, col = df.shape @@ -96,9 +96,7 @@ def plot(self, left, right, labels=None, vertical=True): return fig def _conv(self, data): - """ - Convert each input to appropriate for table outplot. - """ + """Convert each input to appropriate for table outplot""" if isinstance(data, pd.Series): if data.name is None: data = data.to_frame(name="") diff --git a/pandas/util/_exceptions.py b/pandas/util/_exceptions.py index 9ae0e89d7d234..953c8a43a21b8 100644 --- a/pandas/util/_exceptions.py +++ b/pandas/util/_exceptions.py @@ -3,9 +3,7 @@ @contextlib.contextmanager def rewrite_exception(old_name, new_name): - """ - Rewrite the message of an exception. - """ + """Rewrite the message of an exception.""" try: yield except Exception as e: diff --git a/pandas/util/_validators.py b/pandas/util/_validators.py index 85452b2161ef4..8d5f9f7749682 100644 --- a/pandas/util/_validators.py +++ b/pandas/util/_validators.py @@ -229,9 +229,7 @@ def validate_args_and_kwargs(fname, args, kwargs, max_fname_arg_count, compat_ar def validate_bool_kwarg(value, arg_name): - """ - Ensures that argument passed in arg_name is of type bool. - """ + """ Ensures that argument passed in arg_name is of type bool. """ if not (is_bool(value) or value is None): raise ValueError( 'For argument "{arg}" expected type bool, received ' @@ -241,8 +239,7 @@ def validate_bool_kwarg(value, arg_name): def validate_axis_style_args(data, args, kwargs, arg_name, method_name): - """ - Argument handler for mixed index, columns / axis functions + """Argument handler for mixed index, columns / axis functions In an attempt to handle both `.method(index, columns)`, and `.method(arg, axis=.)`, we have to do some bad things to argument @@ -338,8 +335,7 @@ def validate_axis_style_args(data, args, kwargs, arg_name, method_name): def validate_fillna_kwargs(value, method, validate_scalar_dict_value=True): - """ - Validate the keyword arguments to 'fillna'. + """Validate the keyword arguments to 'fillna'. This checks that exactly one of 'value' and 'method' is specified. If 'method' is specified, this validates that it's a valid method. diff --git a/pandas/util/testing.py b/pandas/util/testing.py index 8e00287d65856..a8f0d0da52e1f 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -475,8 +475,7 @@ def close(fignum=None): @contextmanager def ensure_clean(filename=None, return_filelike=False): - """ - Gets a temporary path and agrees to remove on close. + """Gets a temporary path and agrees to remove on close. Parameters ---------- @@ -566,8 +565,7 @@ def ensure_safe_environment_variables(): def equalContents(arr1, arr2): - """ - Checks if the set of unique elements of arr1 and arr2 are equivalent. + """Checks if the set of unique elements of arr1 and arr2 are equivalent. """ return frozenset(arr1) == frozenset(arr2) @@ -582,8 +580,7 @@ def assert_index_equal( check_categorical: bool = True, obj: str = "Index", ) -> None: - """ - Check that left and right Index are equal. + """Check that left and right Index are equal. Parameters ---------- @@ -605,7 +602,7 @@ def assert_index_equal( Whether to compare internal Categorical exactly. obj : str, default 'Index' Specify object name being compared, internally used to show appropriate - assertion message. + assertion message """ __tracebackhide__ = True @@ -709,9 +706,7 @@ def _get_ilevel_values(index, level): def assert_class_equal(left, right, exact=True, obj="Input"): - """ - Checks classes are equal. - """ + """checks classes are equal.""" __tracebackhide__ = True def repr_class(x): @@ -738,8 +733,7 @@ def repr_class(x): def assert_attr_equal(attr, left, right, obj="Attributes"): - """ - Checks attributes are equal. Both objects must have attribute. + """checks attributes are equal. Both objects must have attribute. Parameters ---------- @@ -806,9 +800,7 @@ def isiterable(obj): def assert_is_sorted(seq): - """ - Assert that the sequence is sorted. - """ + """Assert that the sequence is sorted.""" if isinstance(seq, (Index, Series)): seq = seq.values # sorting does not change precisions @@ -818,8 +810,7 @@ def assert_is_sorted(seq): def assert_categorical_equal( left, right, check_dtype=True, check_category_order=True, obj="Categorical" ): - """ - Test that Categoricals are equivalent. + """Test that Categoricals are equivalent. Parameters ---------- @@ -864,8 +855,7 @@ def assert_categorical_equal( def assert_interval_array_equal(left, right, exact="equiv", obj="IntervalArray"): - """ - Test that two IntervalArrays are equivalent. + """Test that two IntervalArrays are equivalent. Parameters ---------- @@ -928,13 +918,11 @@ def raise_assert_detail(obj, message, left, right, diff=None): elif is_categorical_dtype(right): right = repr(right) - msg = """ - {obj} are different + msg = """{obj} are different - {message} - [left]: {left} - [right]: {right} - """.format( +{message} +[left]: {left} +[right]: {right}""".format( obj=obj, message=message, left=left, right=right ) @@ -953,8 +941,7 @@ def assert_numpy_array_equal( check_same=None, obj="numpy array", ): - """ - Checks that 'np.ndarray' is equivalent + """ Checks that 'np.ndarray' is equivalent Parameters ---------- @@ -1031,8 +1018,7 @@ def _raise(left, right, err_msg): def assert_extension_array_equal( left, right, check_dtype=True, check_less_precise=False, check_exact=False ): - """ - Check that left and right ExtensionArrays are equal. + """Check that left and right ExtensionArrays are equal. Parameters ---------- @@ -1095,8 +1081,7 @@ def assert_series_equal( check_categorical=True, obj="Series", ): - """ - Check that left and right Series are equal. + """Check that left and right Series are equal. Parameters ---------- From 99b58bd535a339ca70586cb0d3da521ed7dfc8c9 Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Sat, 24 Aug 2019 00:56:44 -0500 Subject: [PATCH 9/9] DOC: fix a couple PR08 and PR09 type errors while I'm in the code --- pandas/conftest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index b987e77c77082..b032e14d8f7e1 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -124,12 +124,12 @@ def ip(): @pytest.fixture(params=[True, False, None]) def observed(request): """ - pass in the observed keyword to groupby for [True, False] + Pass in the observed keyword to groupby for [True, False] This indicates whether categoricals should return values for values which are not in the grouper [False / None], or only values which appear in the grouper [True]. [None] is supported for future compatibility if we decide to change the default (and would need to warn if this - parameter is not passed) + parameter is not passed). """ return request.param @@ -239,7 +239,7 @@ def cython_table_items(request): def _get_cython_table_params(ndframe, func_names_and_expected): """ - combine frame, functions from SelectionMixin._cython_table + Combine frame, functions from SelectionMixin._cython_table keys and expected result. Parameters @@ -247,7 +247,7 @@ def _get_cython_table_params(ndframe, func_names_and_expected): ndframe : DataFrame or Series func_names_and_expected : Sequence of two items The first item is a name of a NDFrame method ('sum', 'prod') etc. - The second item is the expected return value + The second item is the expected return value. Returns -------