Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c2796d

Browse files
[pre-commit.ci] pre-commit autoupdate (#61802)
* [pre-commit.ci] pre-commit autoupdateupdates:- [github.com/astral-sh/ruff-pre-commit: v0.11.12 → v0.12.2](astral-sh/ruff-pre-commit@v0.11.12...v0.12.2)- [github.com/MarcoGorelli/cython-lint: v0.16.6 → v0.16.7](MarcoGorelli/cython-lint@v0.16.6...v0.16.7)- [github.com/pre-commit/mirrors-clang-format: v20.1.5 → v20.1.7](pre-commit/mirrors-clang-format@v20.1.5...v20.1.7)- [github.com/trim21/pre-commit-mirror-meson: v1.8.1 → v1.8.2](trim21/pre-commit-mirror-meson@v1.8.1...v1.8.2)* [pre-commit.ci] auto fixes from pre-commit.com hooksfor more information, seehttps://pre-commit.ci* Rename method* ignore PLW0177* Noqa test---------Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
1 parentfea4f5b commit7c2796d

File tree

9 files changed

+27
-26
lines changed

9 files changed

+27
-26
lines changed

‎.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip:[pyright, mypy]
2020
repos:
2121
-repo:https://github.com/astral-sh/ruff-pre-commit
22-
rev:v0.11.12
22+
rev:v0.12.2
2323
hooks:
2424
-id:ruff
2525
args:[--exit-non-zero-on-fix]
@@ -47,7 +47,7 @@ repos:
4747
types_or:[python, rst, markdown, cython, c]
4848
additional_dependencies:[tomli]
4949
-repo:https://github.com/MarcoGorelli/cython-lint
50-
rev:v0.16.6
50+
rev:v0.16.7
5151
hooks:
5252
-id:cython-lint
5353
-id:double-quote-cython-strings
@@ -95,14 +95,14 @@ repos:
9595
-id:sphinx-lint
9696
args:["--enable", "all", "--disable", "line-too-long"]
9797
-repo:https://github.com/pre-commit/mirrors-clang-format
98-
rev:v20.1.5
98+
rev:v20.1.7
9999
hooks:
100100
-id:clang-format
101101
files:^pandas/_libs/src|^pandas/_libs/include
102102
args:[-i]
103103
types_or:[c, c++]
104104
-repo:https://github.com/trim21/pre-commit-mirror-meson
105-
rev:v1.8.1
105+
rev:v1.8.2
106106
hooks:
107107
-id:meson-fmt
108108
args:['--inplace']

‎asv_bench/benchmarks/gil.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from .pandas_vb_commonimportBaseIO# isort:skip
3737

3838

39-
deftest_parallel(num_threads=2,kwargs_list=None):
39+
defrun_parallel(num_threads=2,kwargs_list=None):
4040
"""
4141
Decorator to run the same function multiple times in parallel.
4242
@@ -95,7 +95,7 @@ def setup(self, threads, method):
9595
{"key":np.random.randint(0,ngroups,size=N),"data":np.random.randn(N)}
9696
)
9797

98-
@test_parallel(num_threads=threads)
98+
@run_parallel(num_threads=threads)
9999
defparallel():
100100
getattr(df.groupby("key")["data"],method)()
101101

@@ -123,7 +123,7 @@ def setup(self, threads):
123123
ngroups=10**3
124124
data=Series(np.random.randint(0,ngroups,size=size))
125125

126-
@test_parallel(num_threads=threads)
126+
@run_parallel(num_threads=threads)
127127
defget_groups():
128128
data.groupby(data).groups
129129

@@ -142,7 +142,7 @@ def setup(self, dtype):
142142
df=DataFrame({"col":np.arange(N,dtype=dtype)})
143143
indexer=np.arange(100,len(df)-100)
144144

145-
@test_parallel(num_threads=2)
145+
@run_parallel(num_threads=2)
146146
defparallel_take1d():
147147
take_nd(df["col"].values,indexer)
148148

@@ -163,7 +163,7 @@ def setup(self):
163163
k=5*10**5
164164
kwargs_list= [{"arr":np.random.randn(N)}, {"arr":np.random.randn(N)}]
165165

166-
@test_parallel(num_threads=2,kwargs_list=kwargs_list)
166+
@run_parallel(num_threads=2,kwargs_list=kwargs_list)
167167
defparallel_kth_smallest(arr):
168168
algos.kth_smallest(arr,k)
169169

@@ -180,42 +180,42 @@ def setup(self):
180180
self.period=self.dti.to_period("D")
181181

182182
deftime_datetime_field_year(self):
183-
@test_parallel(num_threads=2)
183+
@run_parallel(num_threads=2)
184184
defrun(dti):
185185
dti.year
186186

187187
run(self.dti)
188188

189189
deftime_datetime_field_day(self):
190-
@test_parallel(num_threads=2)
190+
@run_parallel(num_threads=2)
191191
defrun(dti):
192192
dti.day
193193

194194
run(self.dti)
195195

196196
deftime_datetime_field_daysinmonth(self):
197-
@test_parallel(num_threads=2)
197+
@run_parallel(num_threads=2)
198198
defrun(dti):
199199
dti.days_in_month
200200

201201
run(self.dti)
202202

203203
deftime_datetime_field_normalize(self):
204-
@test_parallel(num_threads=2)
204+
@run_parallel(num_threads=2)
205205
defrun(dti):
206206
dti.normalize()
207207

208208
run(self.dti)
209209

210210
deftime_datetime_to_period(self):
211-
@test_parallel(num_threads=2)
211+
@run_parallel(num_threads=2)
212212
defrun(dti):
213213
dti.to_period("s")
214214

215215
run(self.dti)
216216

217217
deftime_period_to_datetime(self):
218-
@test_parallel(num_threads=2)
218+
@run_parallel(num_threads=2)
219219
defrun(period):
220220
period.to_timestamp()
221221

@@ -232,7 +232,7 @@ def setup(self, method):
232232
ifhasattr(DataFrame,"rolling"):
233233
df=DataFrame(arr).rolling(win)
234234

235-
@test_parallel(num_threads=2)
235+
@run_parallel(num_threads=2)
236236
defparallel_rolling():
237237
getattr(df,method)()
238238

@@ -249,7 +249,7 @@ def parallel_rolling():
249249
"std":rolling_std,
250250
}
251251

252-
@test_parallel(num_threads=2)
252+
@run_parallel(num_threads=2)
253253
defparallel_rolling():
254254
rolling[method](arr,win)
255255

@@ -286,7 +286,7 @@ def setup(self, dtype):
286286
self.fname=f"__test_{dtype}__.csv"
287287
df.to_csv(self.fname)
288288

289-
@test_parallel(num_threads=2)
289+
@run_parallel(num_threads=2)
290290
defparallel_read_csv():
291291
read_csv(self.fname)
292292

@@ -305,7 +305,7 @@ class ParallelFactorize:
305305
defsetup(self,threads):
306306
strings=Index([f"i-{i}"foriinrange(100000)],dtype=object)
307307

308-
@test_parallel(num_threads=threads)
308+
@run_parallel(num_threads=threads)
309309
defparallel():
310310
factorize(strings)
311311

‎pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7235,7 +7235,7 @@ def sort_values(
72357235
indexer=lexsort_indexer(
72367236
keys_data,orders=ascending,na_position=na_position,key=key
72377237
)
7238-
eliflen(by):
7238+
elifby:
72397239
# len(by) == 1
72407240

72417241
k=self._get_label_or_level_values(by[0],axis=axis)

‎pandas/core/indexes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7635,7 +7635,7 @@ def ensure_index(index_like: Axes, copy: bool = False) -> Index:
76357635
# check in clean_index_list
76367636
index_like=list(index_like)
76377637

7638-
iflen(index_like)andlib.is_all_arraylike(index_like):
7638+
ifindex_likeandlib.is_all_arraylike(index_like):
76397639
frompandas.core.indexes.multiimportMultiIndex
76407640

76417641
returnMultiIndex.from_arrays(index_like)

‎pandas/io/parsers/base_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def extract(r):
243243
names.insert(single_ic,single_ic)
244244

245245
# Clean the column names (if we have an index_col).
246-
iflen(ic):
246+
ific:
247247
col_names= [
248248
r[ic[0]]
249249
if ((r[ic[0]]isnotNone)andr[ic[0]]notinself.unnamed_cols)

‎pandas/io/parsers/python_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def read(
281281

282282
index:Index|None
283283
columns:Sequence[Hashable]=list(self.orig_names)
284-
ifnotlen(content):# pragma: no cover
284+
ifnotcontent:# pragma: no cover
285285
# DataFrame with the right metadata, even though it's length 0
286286
# error: Cannot determine type of 'index_col'
287287
names=dedup_names(

‎pandas/tests/arithmetic/test_datetime64.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
)
1010
fromitertoolsimport (
1111
product,
12-
starmap,
1312
)
1413
importoperator
1514

@@ -2211,7 +2210,7 @@ def test_timedelta64_equal_timedelta_supported_ops(self, op, box_with_array):
22112210

22122211
deftimedelta64(*args):
22132212
# see casting notes in NumPy gh-12927
2214-
returnnp.sum(list(starmap(np.timedelta64,zip(args,intervals))))
2213+
returnnp.sum(list(map(np.timedelta64,args,intervals)))
22152214

22162215
ford,h,m,s,usinproduct(*([range(2)]*5)):
22172216
nptd=timedelta64(d,h,m,s,us)

‎pandas/util/_tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
PKG=os.path.dirname(os.path.dirname(__file__))
1313

1414

15-
deftest(extra_args:list[str]|None=None,run_doctests:bool=False)->None:
15+
deftest(extra_args:list[str]|None=None,run_doctests:bool=False)->None:# noqa: PT028
1616
"""
1717
Run the pandas test suite using pytest.
1818

‎pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ ignore = [
318318
"ISC001",
319319
# if-stmt-min-max
320320
"PLR1730",
321+
# nan-comparison
322+
"PLW0177",
321323

322324
### TODO: Enable gradually
323325
# Useless statement

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp