Skip to content

Commit 5c9c8a9

Browse files
ShaharNavehproost
authored andcommitted
DOC: Cleaned doctrings (pandas-dev#30165)
1 parent 96dc90f commit 5c9c8a9

File tree

2 files changed

+26
-30
lines changed

2 files changed

+26
-30
lines changed

pandas/compat/pickle_compat.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import copy
66
import pickle as pkl
7-
from typing import TYPE_CHECKING
7+
from typing import TYPE_CHECKING, Optional
88
import warnings
99

1010
from pandas import Index
@@ -219,8 +219,9 @@ def load_newobj_ex(self):
219219
pass
220220

221221

222-
def load(fh, encoding=None, is_verbose=False):
223-
"""load a pickle, with a provided encoding
222+
def load(fh, encoding: Optional[str] = None, is_verbose: bool = False):
223+
"""
224+
Load a pickle, with a provided encoding,
224225
225226
Parameters
226227
----------

pandas/conftest.py

+22-27
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def ordered_fixture(request):
163163
@pytest.fixture(params=_all_arithmetic_operators)
164164
def all_arithmetic_operators(request):
165165
"""
166-
Fixture for dunder names for common arithmetic operations
166+
Fixture for dunder names for common arithmetic operations.
167167
"""
168168
return request.param
169169

@@ -190,7 +190,9 @@ def all_arithmetic_functions(request):
190190
"""
191191
Fixture for operator and roperator arithmetic functions.
192192
193-
Note: This includes divmod and rdivmod, whereas all_arithmetic_operators
193+
Notes
194+
-----
195+
This includes divmod and rdivmod, whereas all_arithmetic_operators
194196
does not.
195197
"""
196198
return request.param
@@ -213,7 +215,7 @@ def all_arithmetic_functions(request):
213215
@pytest.fixture(params=_all_numeric_reductions)
214216
def all_numeric_reductions(request):
215217
"""
216-
Fixture for numeric reduction names
218+
Fixture for numeric reduction names.
217219
"""
218220
return request.param
219221

@@ -224,7 +226,7 @@ def all_numeric_reductions(request):
224226
@pytest.fixture(params=_all_boolean_reductions)
225227
def all_boolean_reductions(request):
226228
"""
227-
Fixture for boolean reduction names
229+
Fixture for boolean reduction names.
228230
"""
229231
return request.param
230232

@@ -251,7 +253,7 @@ def _get_cython_table_params(ndframe, func_names_and_expected):
251253
252254
Returns
253255
-------
254-
results : list
256+
list
255257
List of three items (DataFrame, function, expected result)
256258
"""
257259
results = []
@@ -310,7 +312,7 @@ def all_logical_operators(request):
310312
@pytest.fixture(params=[None, "gzip", "bz2", "zip", "xz"])
311313
def compression(request):
312314
"""
313-
Fixture for trying common compression types in compression tests
315+
Fixture for trying common compression types in compression tests.
314316
"""
315317
return request.param
316318

@@ -319,15 +321,15 @@ def compression(request):
319321
def compression_only(request):
320322
"""
321323
Fixture for trying common compression types in compression tests excluding
322-
uncompressed case
324+
uncompressed case.
323325
"""
324326
return request.param
325327

326328

327329
@pytest.fixture(params=[True, False])
328330
def writable(request):
329331
"""
330-
Fixture that an array is writable
332+
Fixture that an array is writable.
331333
"""
332334
return request.param
333335

@@ -340,15 +342,15 @@ def datetime_tz_utc():
340342
@pytest.fixture(params=["utc", "dateutil/UTC", utc, tzutc(), timezone.utc])
341343
def utc_fixture(request):
342344
"""
343-
Fixture to provide variants of UTC timezone strings and tzinfo objects
345+
Fixture to provide variants of UTC timezone strings and tzinfo objects.
344346
"""
345347
return request.param
346348

347349

348350
@pytest.fixture(params=["inner", "outer", "left", "right"])
349351
def join_type(request):
350352
"""
351-
Fixture for trying all types of join operations
353+
Fixture for trying all types of join operations.
352354
"""
353355
return request.param
354356

@@ -370,7 +372,7 @@ def datapath(strict_data_files):
370372
371373
Returns
372374
-------
373-
path : path including ``pandas/tests``.
375+
path including ``pandas/tests``.
374376
375377
Raises
376378
------
@@ -383,11 +385,11 @@ def deco(*args):
383385
path = os.path.join(BASE_PATH, *args)
384386
if not os.path.exists(path):
385387
if strict_data_files:
386-
msg = "Could not find file {} and --strict-data-files is set."
387-
raise ValueError(msg.format(path))
388+
raise ValueError(
389+
f"Could not find file {path} and --strict-data-files is set."
390+
)
388391
else:
389-
msg = "Could not find {}."
390-
pytest.skip(msg.format(path))
392+
pytest.skip(f"Could not find {path}.")
391393
return path
392394

393395
return deco
@@ -404,31 +406,31 @@ def iris(datapath):
404406
@pytest.fixture(params=["nlargest", "nsmallest"])
405407
def nselect_method(request):
406408
"""
407-
Fixture for trying all nselect methods
409+
Fixture for trying all nselect methods.
408410
"""
409411
return request.param
410412

411413

412414
@pytest.fixture(params=["left", "right", "both", "neither"])
413415
def closed(request):
414416
"""
415-
Fixture for trying all interval closed parameters
417+
Fixture for trying all interval closed parameters.
416418
"""
417419
return request.param
418420

419421

420422
@pytest.fixture(params=["left", "right", "both", "neither"])
421423
def other_closed(request):
422424
"""
423-
Secondary closed fixture to allow parametrizing over all pairs of closed
425+
Secondary closed fixture to allow parametrizing over all pairs of closed.
424426
"""
425427
return request.param
426428

427429

428430
@pytest.fixture(params=[None, np.nan, pd.NaT, float("nan"), np.float("NaN")])
429431
def nulls_fixture(request):
430432
"""
431-
Fixture for each null type in pandas
433+
Fixture for each null type in pandas.
432434
"""
433435
return request.param
434436

@@ -439,7 +441,7 @@ def nulls_fixture(request):
439441
@pytest.fixture(params=[None, np.nan, pd.NaT])
440442
def unique_nulls_fixture(request):
441443
"""
442-
Fixture for each null type in pandas, each null type exactly once
444+
Fixture for each null type in pandas, each null type exactly once.
443445
"""
444446
return request.param
445447

@@ -589,7 +591,6 @@ def float_dtype(request):
589591
* 'float32'
590592
* 'float64'
591593
"""
592-
593594
return request.param
594595

595596

@@ -602,7 +603,6 @@ def complex_dtype(request):
602603
* 'complex64'
603604
* 'complex128'
604605
"""
605-
606606
return request.param
607607

608608

@@ -617,7 +617,6 @@ def sint_dtype(request):
617617
* 'int32'
618618
* 'int64'
619619
"""
620-
621620
return request.param
622621

623622

@@ -631,7 +630,6 @@ def uint_dtype(request):
631630
* 'uint32'
632631
* 'uint64'
633632
"""
634-
635633
return request.param
636634

637635

@@ -650,7 +648,6 @@ def any_int_dtype(request):
650648
* 'int64'
651649
* 'uint64'
652650
"""
653-
654651
return request.param
655652

656653

@@ -690,7 +687,6 @@ def any_real_dtype(request):
690687
* 'float32'
691688
* 'float64'
692689
"""
693-
694690
return request.param
695691

696692

@@ -728,7 +724,6 @@ def any_numpy_dtype(request):
728724
* object
729725
* 'object'
730726
"""
731-
732727
return request.param
733728

734729

0 commit comments

Comments
 (0)