Skip to content

Commit 214e04f

Browse files
committed
upgrade version of 'black'
1 parent 5e3623c commit 214e04f

File tree

23 files changed

+64
-64
lines changed

23 files changed

+64
-64
lines changed

asv_bench/benchmarks/arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def setup(self, op):
125125
arr1 = np.random.randn(n_rows, int(n_cols / 2)).astype("f8")
126126
arr2 = np.random.randn(n_rows, int(n_cols / 2)).astype("f4")
127127
df = pd.concat(
128-
[pd.DataFrame(arr1), pd.DataFrame(arr2)], axis=1, ignore_index=True,
128+
[pd.DataFrame(arr1), pd.DataFrame(arr2)], axis=1, ignore_index=True
129129
)
130130
# should already be the case, but just to be sure
131131
df._consolidate_inplace()

doc/make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def main():
286286

287287
joined = ",".join(cmds)
288288
argparser = argparse.ArgumentParser(
289-
description="pandas documentation builder", epilog=f"Commands: {joined}",
289+
description="pandas documentation builder", epilog=f"Commands: {joined}"
290290
)
291291

292292
joined = ", ".join(cmds)

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308

309309
for method in methods:
310310
# ... and each of its public methods
311-
moved_api_pages.append((f"{old}.{method}", f"{new}.{method}",))
311+
moved_api_pages.append((f"{old}.{method}", f"{new}.{method}"))
312312

313313
if pattern is None:
314314
html_additional_pages = {

pandas/_vendored/typing_extensions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,8 +2116,7 @@ def __init_subclass__(cls, *args, **kwargs):
21162116
raise TypeError(f"Cannot subclass {cls.__module__}.Annotated")
21172117

21182118
def _strip_annotations(t):
2119-
"""Strips the annotations from a given type.
2120-
"""
2119+
"""Strips the annotations from a given type."""
21212120
if isinstance(t, _AnnotatedAlias):
21222121
return _strip_annotations(t.__origin__)
21232122
if isinstance(t, typing._GenericAlias):

pandas/core/aggregation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def validate_func_kwargs(
387387

388388

389389
def transform(
390-
obj: FrameOrSeries, func: AggFuncType, axis: Axis, *args, **kwargs,
390+
obj: FrameOrSeries, func: AggFuncType, axis: Axis, *args, **kwargs
391391
) -> FrameOrSeries:
392392
"""
393393
Transform a DataFrame or Series

pandas/core/algorithms.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,11 +1023,10 @@ def checked_add_with_arr(arr, b, arr_mask=None, b_mask=None):
10231023
to_raise = ((np.iinfo(np.int64).max - b2 < arr) & not_nan).any()
10241024
else:
10251025
to_raise = (
1026-
((np.iinfo(np.int64).max - b2[mask1] < arr[mask1]) & not_nan[mask1]).any()
1027-
or (
1028-
(np.iinfo(np.int64).min - b2[mask2] > arr[mask2]) & not_nan[mask2]
1029-
).any()
1030-
)
1026+
(np.iinfo(np.int64).max - b2[mask1] < arr[mask1]) & not_nan[mask1]
1027+
).any() or (
1028+
(np.iinfo(np.int64).min - b2[mask2] > arr[mask2]) & not_nan[mask2]
1029+
).any()
10311030

10321031
if to_raise:
10331032
raise OverflowError("Overflow in int64 addition")

pandas/core/array_algos/replace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
def compare_or_regex_search(
20-
a: ArrayLike, b: Union[Scalar, Pattern], regex: bool, mask: ArrayLike,
20+
a: ArrayLike, b: Union[Scalar, Pattern], regex: bool, mask: ArrayLike
2121
) -> Union[ArrayLike, bool]:
2222
"""
2323
Compare two array_like inputs of the same shape or two scalar values

pandas/core/frame.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,7 @@ def __init__(
449449
if isinstance(data, BlockManager):
450450
if index is None and columns is None and dtype is None and copy is False:
451451
# GH#33357 fastpath
452-
NDFrame.__init__(
453-
self, data,
454-
)
452+
NDFrame.__init__(self, data)
455453
return
456454

457455
mgr = self._init_mgr(
@@ -5747,7 +5745,7 @@ def nsmallest(self, n, columns, keep="first") -> DataFrame:
57475745
population GDP alpha-2
57485746
Tuvalu 11300 38 TV
57495747
Anguilla 11300 311 AI
5750-
Iceland 337000 17036 IS
5748+
Iceland 337000 17036 IS
57515749
57525750
When using ``keep='last'``, ties are resolved in reverse order:
57535751
@@ -7142,7 +7140,7 @@ def unstack(self, level=-1, fill_value=None):
71427140

71437141
return unstack(self, level, fill_value)
71447142

7145-
@Appender(_shared_docs["melt"] % dict(caller="df.melt(", other="melt",))
7143+
@Appender(_shared_docs["melt"] % dict(caller="df.melt(", other="melt"))
71467144
def melt(
71477145
self,
71487146
id_vars=None,
@@ -8624,7 +8622,7 @@ def blk_func(values):
86248622
# After possibly _get_data and transposing, we are now in the
86258623
# simple case where we can use BlockManager.reduce
86268624
res = df._mgr.reduce(blk_func)
8627-
out = df._constructor(res,).iloc[0].rename(None)
8625+
out = df._constructor(res).iloc[0].rename(None)
86288626
if out_dtype is not None:
86298627
out = out.astype(out_dtype)
86308628
if axis == 0 and is_object_dtype(out.dtype):

pandas/core/series.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
199199
# Constructors
200200

201201
def __init__(
202-
self, data=None, index=None, dtype=None, name=None, copy=False, fastpath=False,
202+
self, data=None, index=None, dtype=None, name=None, copy=False, fastpath=False
203203
):
204204

205205
if (
@@ -209,9 +209,7 @@ def __init__(
209209
and copy is False
210210
):
211211
# GH#33357 called with just the SingleBlockManager
212-
NDFrame.__init__(
213-
self, data,
214-
)
212+
NDFrame.__init__(self, data)
215213
self.name = name
216214
return
217215

@@ -331,7 +329,8 @@ def __init__(
331329
data = SingleBlockManager.from_array(data, index)
332330

333331
generic.NDFrame.__init__(
334-
self, data,
332+
self,
333+
data,
335334
)
336335
self.name = name
337336
self._set_axis(0, index, fastpath=True)

pandas/core/sorting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def get_indexer_indexer(
7272
)
7373
elif isinstance(target, ABCMultiIndex):
7474
indexer = lexsort_indexer(
75-
target._get_codes_for_sorting(), orders=ascending, na_position=na_position,
75+
target._get_codes_for_sorting(), orders=ascending, na_position=na_position
7676
)
7777
else:
7878
# Check monotonic-ness before sort an index (GH 11080)

0 commit comments

Comments
 (0)