Skip to content

DOC: Cleaned doctrings #30165

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 3 commits into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions pandas/compat/pickle_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import copy
import pickle as pkl
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Optional
import warnings

from pandas import Index
Expand Down Expand Up @@ -219,8 +219,9 @@ def load_newobj_ex(self):
pass


def load(fh, encoding=None, is_verbose=False):
"""load a pickle, with a provided encoding
def load(fh, encoding: Optional[str] = None, is_verbose: bool = False):
"""
Load a pickle, with a provided encoding,

Parameters
----------
Expand Down
49 changes: 22 additions & 27 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def ordered_fixture(request):
@pytest.fixture(params=_all_arithmetic_operators)
def all_arithmetic_operators(request):
"""
Fixture for dunder names for common arithmetic operations
Fixture for dunder names for common arithmetic operations.
"""
return request.param

Expand All @@ -190,7 +190,9 @@ def all_arithmetic_functions(request):
"""
Fixture for operator and roperator arithmetic functions.

Note: This includes divmod and rdivmod, whereas all_arithmetic_operators
Notes
-----
This includes divmod and rdivmod, whereas all_arithmetic_operators
does not.
"""
return request.param
Expand All @@ -213,7 +215,7 @@ def all_arithmetic_functions(request):
@pytest.fixture(params=_all_numeric_reductions)
def all_numeric_reductions(request):
"""
Fixture for numeric reduction names
Fixture for numeric reduction names.
"""
return request.param

Expand All @@ -224,7 +226,7 @@ def all_numeric_reductions(request):
@pytest.fixture(params=_all_boolean_reductions)
def all_boolean_reductions(request):
"""
Fixture for boolean reduction names
Fixture for boolean reduction names.
"""
return request.param

Expand All @@ -251,7 +253,7 @@ def _get_cython_table_params(ndframe, func_names_and_expected):

Returns
-------
results : list
list
List of three items (DataFrame, function, expected result)
"""
results = []
Expand Down Expand Up @@ -310,7 +312,7 @@ def all_logical_operators(request):
@pytest.fixture(params=[None, "gzip", "bz2", "zip", "xz"])
def compression(request):
"""
Fixture for trying common compression types in compression tests
Fixture for trying common compression types in compression tests.
"""
return request.param

Expand All @@ -319,15 +321,15 @@ def compression(request):
def compression_only(request):
"""
Fixture for trying common compression types in compression tests excluding
uncompressed case
uncompressed case.
"""
return request.param


@pytest.fixture(params=[True, False])
def writable(request):
"""
Fixture that an array is writable
Fixture that an array is writable.
"""
return request.param

Expand All @@ -340,15 +342,15 @@ def datetime_tz_utc():
@pytest.fixture(params=["utc", "dateutil/UTC", utc, tzutc(), timezone.utc])
def utc_fixture(request):
"""
Fixture to provide variants of UTC timezone strings and tzinfo objects
Fixture to provide variants of UTC timezone strings and tzinfo objects.
"""
return request.param


@pytest.fixture(params=["inner", "outer", "left", "right"])
def join_type(request):
"""
Fixture for trying all types of join operations
Fixture for trying all types of join operations.
"""
return request.param

Expand All @@ -370,7 +372,7 @@ def datapath(strict_data_files):

Returns
-------
path : path including ``pandas/tests``.
path including ``pandas/tests``.

Raises
------
Expand All @@ -383,11 +385,11 @@ def deco(*args):
path = os.path.join(BASE_PATH, *args)
if not os.path.exists(path):
if strict_data_files:
msg = "Could not find file {} and --strict-data-files is set."
raise ValueError(msg.format(path))
raise ValueError(
f"Could not find file {path} and --strict-data-files is set."
)
else:
msg = "Could not find {}."
pytest.skip(msg.format(path))
pytest.skip(f"Could not find {path}.")
return path

return deco
Expand All @@ -404,31 +406,31 @@ def iris(datapath):
@pytest.fixture(params=["nlargest", "nsmallest"])
def nselect_method(request):
"""
Fixture for trying all nselect methods
Fixture for trying all nselect methods.
"""
return request.param


@pytest.fixture(params=["left", "right", "both", "neither"])
def closed(request):
"""
Fixture for trying all interval closed parameters
Fixture for trying all interval closed parameters.
"""
return request.param


@pytest.fixture(params=["left", "right", "both", "neither"])
def other_closed(request):
"""
Secondary closed fixture to allow parametrizing over all pairs of closed
Secondary closed fixture to allow parametrizing over all pairs of closed.
"""
return request.param


@pytest.fixture(params=[None, np.nan, pd.NaT, float("nan"), np.float("NaN")])
def nulls_fixture(request):
"""
Fixture for each null type in pandas
Fixture for each null type in pandas.
"""
return request.param

Expand All @@ -439,7 +441,7 @@ def nulls_fixture(request):
@pytest.fixture(params=[None, np.nan, pd.NaT])
def unique_nulls_fixture(request):
"""
Fixture for each null type in pandas, each null type exactly once
Fixture for each null type in pandas, each null type exactly once.
"""
return request.param

Expand Down Expand Up @@ -589,7 +591,6 @@ def float_dtype(request):
* 'float32'
* 'float64'
"""

return request.param


Expand All @@ -602,7 +603,6 @@ def complex_dtype(request):
* 'complex64'
* 'complex128'
"""

return request.param


Expand All @@ -617,7 +617,6 @@ def sint_dtype(request):
* 'int32'
* 'int64'
"""

return request.param


Expand All @@ -631,7 +630,6 @@ def uint_dtype(request):
* 'uint32'
* 'uint64'
"""

return request.param


Expand All @@ -650,7 +648,6 @@ def any_int_dtype(request):
* 'int64'
* 'uint64'
"""

return request.param


Expand All @@ -672,7 +669,6 @@ def any_real_dtype(request):
* 'float32'
* 'float64'
"""

return request.param


Expand Down Expand Up @@ -710,7 +706,6 @@ def any_numpy_dtype(request):
* object
* 'object'
"""

return request.param


Expand Down