Skip to content

Commit f37d9be

Browse files
[pre-commit.ci] pre-commit autoupdate (#640)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.0](astral-sh/ruff-pre-commit@v0.1.14...v0.2.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix linting error caught by new Ruff. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Hameer Abbasi <[email protected]>
1 parent 078ac75 commit f37d9be

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
args: ["--autofix", "--no-ensure-ascii"]
1818

1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.1.14
20+
rev: v0.2.0
2121
hooks:
2222
- id: ruff
2323
args: ["--fix"]

sparse/_coo/common.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,9 @@ def stack(arrays, axis=0):
230230
shape.insert(axis, len(arrays))
231231

232232
nnz = 0
233-
dim = 0
234233
new = np.empty(shape=(coords.shape[1],), dtype=np.intp)
235-
for x in arrays:
234+
for dim, x in enumerate(arrays):
236235
new[nnz : x.nnz + nnz] = dim
237-
dim += 1
238236
nnz += x.nnz
239237

240238
coords = [coords[i] for i in range(coords.shape[0])]

sparse/_sparse_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def reduce(self, method, axis=(0,), keepdims=False, **kwargs):
383383
reduce_super_ufunc = None
384384

385385
if not equivalent(zero_reduce_result, self.fill_value):
386-
reduce_super_ufunc = _reduce_super_ufunc.get(method, None)
386+
reduce_super_ufunc = _reduce_super_ufunc.get(method)
387387

388388
if reduce_super_ufunc is None:
389389
raise ValueError(f"Performing this reduction operation would produce a dense result: {method!s}")

0 commit comments

Comments
 (0)