Skip to content

Commit fe85cbf

Browse files
authored
STYLE upgrade black formatter (#51348)
upgrade black formatter Co-authored-by: MarcoGorelli <>
1 parent b196a09 commit fe85cbf

File tree

471 files changed

+43
-1655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

471 files changed

+43
-1655
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ repos:
125125
language: python
126126
require_serial: true
127127
types_or: [python, pyi]
128-
additional_dependencies: [black==22.10.0]
128+
additional_dependencies: [black==23.1.0]
129129
- id: pyright
130130
# note: assumes python env is setup and activated
131131
name: pyright

asv_bench/benchmarks/algorithms.py

-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
class Factorize:
18-
1918
params = [
2019
[True, False],
2120
[True, False],
@@ -65,7 +64,6 @@ def time_factorize(self, unique, sort, dtype):
6564

6665

6766
class Duplicated:
68-
6967
params = [
7068
[True, False],
7169
["first", "last", False],
@@ -96,7 +94,6 @@ def time_duplicated(self, unique, keep, dtype):
9694

9795

9896
class DuplicatedMaskedArray:
99-
10097
params = [
10198
[True, False],
10299
["first", "last", False],

asv_bench/benchmarks/algos/isin.py

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
class IsIn:
15-
1615
params = [
1716
"int64",
1817
"uint64",
@@ -183,7 +182,6 @@ def time_isin(self, dtype, M, offset_factor):
183182

184183

185184
class IsInFloat64:
186-
187185
params = [
188186
[np.float64, "Float64"],
189187
["many_different_values", "few_different_values", "only_nans_values"],

asv_bench/benchmarks/arithmetic.py

-5
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ def time_op_same_blocks(self, op, shape):
173173

174174

175175
class Ops:
176-
177176
params = [[True, False], ["default", 1]]
178177
param_names = ["use_numexpr", "threads"]
179178

@@ -257,7 +256,6 @@ def time_frame_series_dot(self):
257256

258257

259258
class Timeseries:
260-
261259
params = [None, "US/Eastern"]
262260
param_names = ["tz"]
263261

@@ -316,7 +314,6 @@ def time_categorical_op(self, op):
316314

317315

318316
class IndexArithmetic:
319-
320317
params = ["float", "int"]
321318
param_names = ["dtype"]
322319

@@ -387,7 +384,6 @@ def time_add_timedeltas(self, df):
387384

388385

389386
class AddOverflowScalar:
390-
391387
params = [1, -1, 0]
392388
param_names = ["scalar"]
393389

@@ -455,7 +451,6 @@ def time_add_overflow_both_arg_nan(self):
455451

456452

457453
class OffsetArrayArithmetic:
458-
459454
params = offsets
460455
param_names = ["offset"]
461456

asv_bench/benchmarks/array.py

-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def time_from_list(self):
7272

7373

7474
class ArrowStringArray:
75-
7675
params = [False, True]
7776
param_names = ["multiple_chunks"]
7877

@@ -107,7 +106,6 @@ def time_tolist(self, multiple_chunks):
107106

108107

109108
class ArrowExtensionArray:
110-
111109
params = [
112110
[
113111
"boolean[pyarrow]",

asv_bench/benchmarks/attrs_caching.py

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def time_set_index(self):
2222

2323

2424
class SeriesArrayAttribute:
25-
2625
params = [["numeric", "object", "category", "datetime64", "datetime64tz"]]
2726
param_names = ["dtype"]
2827

asv_bench/benchmarks/categoricals.py

-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ def time_concat_non_overlapping_index(self):
143143

144144

145145
class ValueCounts:
146-
147146
params = [True, False]
148147
param_names = ["dropna"]
149148

@@ -254,7 +253,6 @@ def time_categorical_contains(self):
254253

255254

256255
class CategoricalSlicing:
257-
258256
params = ["monotonic_incr", "monotonic_decr", "non_monotonic"]
259257
param_names = ["index"]
260258

asv_bench/benchmarks/ctors.py

-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def list_of_lists_with_none(arr):
4949

5050

5151
class SeriesConstructors:
52-
5352
param_names = ["data_fmt", "with_index", "dtype"]
5453
params = [
5554
[
@@ -124,7 +123,6 @@ def time_multiindex_from_iterables(self):
124123

125124
class DatetimeIndexConstructor:
126125
def setup(self):
127-
128126
N = 20_000
129127
dti = date_range("1900-01-01", periods=N)
130128

asv_bench/benchmarks/dtypes.py

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def time_pandas_dtype_invalid(self, dtype):
4949

5050

5151
class SelectDtypes:
52-
5352
try:
5453
params = [
5554
tm.ALL_INT_NUMPY_DTYPES

asv_bench/benchmarks/eval.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010

1111
class Eval:
12-
1312
params = [["numexpr", "python"], [1, "all"]]
1413
param_names = ["engine", "threads"]
1514

asv_bench/benchmarks/frame_ctor.py

-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def time_mi_series(self):
7474

7575

7676
class FromDictwithTimestamp:
77-
7877
params = [Nano(1), Hour(1)]
7978
param_names = ["offset"]
8079

@@ -89,7 +88,6 @@ def time_dict_with_timestamp_offsets(self, offset):
8988

9089

9190
class FromRecords:
92-
9391
params = [None, 1000]
9492
param_names = ["nrows"]
9593

@@ -116,7 +114,6 @@ def time_frame_from_ndarray(self):
116114

117115

118116
class FromLists:
119-
120117
goal_time = 0.2
121118

122119
def setup(self):
@@ -129,7 +126,6 @@ def time_frame_from_lists(self):
129126

130127

131128
class FromRange:
132-
133129
goal_time = 0.2
134130

135131
def setup(self):
@@ -162,7 +158,6 @@ def time_frame_from_scalar_ea_float64_na(self):
162158

163159

164160
class FromArrays:
165-
166161
goal_time = 0.2
167162

168163
def setup(self):

asv_bench/benchmarks/frame_methods.py

-8
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ def time_isnull_obj(self):
371371

372372

373373
class Fillna:
374-
375374
params = (
376375
[True, False],
377376
["pad", "bfill"],
@@ -412,7 +411,6 @@ def time_frame_fillna(self, inplace, method, dtype):
412411

413412

414413
class Dropna:
415-
416414
params = (["all", "any"], [0, 1])
417415
param_names = ["how", "axis"]
418416

@@ -432,7 +430,6 @@ def time_dropna_axis_mixed_dtypes(self, how, axis):
432430

433431

434432
class Count:
435-
436433
params = [0, 1]
437434
param_names = ["axis"]
438435

@@ -531,7 +528,6 @@ def time_frame_object_unequal(self):
531528

532529

533530
class Interpolate:
534-
535531
params = [None, "infer"]
536532
param_names = ["downcast"]
537533

@@ -616,7 +612,6 @@ def time_frame_duplicated_subset(self):
616612

617613

618614
class XS:
619-
620615
params = [0, 1]
621616
param_names = ["axis"]
622617

@@ -629,7 +624,6 @@ def time_frame_xs(self, axis):
629624

630625

631626
class SortValues:
632-
633627
params = [True, False]
634628
param_names = ["ascending"]
635629

@@ -657,7 +651,6 @@ def time_frame_sort_values_by_columns(self):
657651

658652

659653
class Quantile:
660-
661654
params = [0, 1]
662655
param_names = ["axis"]
663656

@@ -697,7 +690,6 @@ def time_info(self):
697690

698691

699692
class NSort:
700-
701693
params = ["first", "last", "all"]
702694
param_names = ["keep"]
703695

asv_bench/benchmarks/gil.py

-14
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,10 @@ def inner(*args, **kwargs):
8787

8888

8989
class ParallelGroupbyMethods:
90-
9190
params = ([2, 4, 8], ["count", "last", "max", "mean", "min", "prod", "sum", "var"])
9291
param_names = ["threads", "method"]
9392

9493
def setup(self, threads, method):
95-
9694
N = 10**6
9795
ngroups = 10**3
9896
df = DataFrame(
@@ -119,12 +117,10 @@ def time_loop(self, threads, method):
119117

120118

121119
class ParallelGroups:
122-
123120
params = [2, 4, 8]
124121
param_names = ["threads"]
125122

126123
def setup(self, threads):
127-
128124
size = 2**22
129125
ngroups = 10**3
130126
data = Series(np.random.randint(0, ngroups, size=size))
@@ -140,12 +136,10 @@ def time_get_groups(self, threads):
140136

141137

142138
class ParallelTake1D:
143-
144139
params = ["int64", "float64"]
145140
param_names = ["dtype"]
146141

147142
def setup(self, dtype):
148-
149143
N = 10**6
150144
df = DataFrame({"col": np.arange(N, dtype=dtype)})
151145
indexer = np.arange(100, len(df) - 100)
@@ -167,7 +161,6 @@ class ParallelKth:
167161
repeat = 5
168162

169163
def setup(self):
170-
171164
N = 10**7
172165
k = 5 * 10**5
173166
kwargs_list = [{"arr": np.random.randn(N)}, {"arr": np.random.randn(N)}]
@@ -184,7 +177,6 @@ def time_kth_smallest(self):
184177

185178
class ParallelDatetimeFields:
186179
def setup(self):
187-
188180
N = 10**6
189181
self.dti = date_range("1900-01-01", periods=N, freq="T")
190182
self.period = self.dti.to_period("D")
@@ -233,12 +225,10 @@ def run(period):
233225

234226

235227
class ParallelRolling:
236-
237228
params = ["median", "mean", "min", "max", "var", "skew", "kurt", "std"]
238229
param_names = ["method"]
239230

240231
def setup(self, method):
241-
242232
win = 100
243233
arr = np.random.rand(100000)
244234
if hasattr(DataFrame, "rolling"):
@@ -274,14 +264,12 @@ def time_rolling(self, method):
274264

275265

276266
class ParallelReadCSV(BaseIO):
277-
278267
number = 1
279268
repeat = 5
280269
params = ["float", "object", "datetime"]
281270
param_names = ["dtype"]
282271

283272
def setup(self, dtype):
284-
285273
rows = 10000
286274
cols = 50
287275
data = {
@@ -309,14 +297,12 @@ def time_read_csv(self, dtype):
309297

310298

311299
class ParallelFactorize:
312-
313300
number = 1
314301
repeat = 5
315302
params = [2, 4, 8]
316303
param_names = ["threads"]
317304

318305
def setup(self, threads):
319-
320306
strings = tm.makeStringIndex(100000)
321307

322308
@test_parallel(num_threads=threads)

0 commit comments

Comments
 (0)