Skip to content

Commit

Permalink
pre-commit autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
hameerabbasi committed Jan 15, 2025
1 parent 80abc1c commit a6915e6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -17,7 +17,7 @@ repos:
args: ["--autofix", "--no-ensure-ascii"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
rev: v0.9.1
hooks:
- id: ruff
args: ["--fix"]
Expand Down
4 changes: 2 additions & 2 deletions docs/gen_logo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import xml.etree.ElementTree as et
import xml.etree.ElementTree as et # noqa: ICN001

import numpy as np

Expand Down Expand Up @@ -31,7 +31,7 @@ def fill(rs):
kwargs = {"x": "0", "y": "0", "width": f"{s}", "height": f"{s}", "stroke": "white"}

# large white squares for background
bg_kwargs = {**kwargs, "width": f"{5*s}", "height": f"{5*s}", "style": "fill:white;"}
bg_kwargs = {**kwargs, "width": f"{5 * s}", "height": f"{5 * s}", "style": "fill:white;"}


root = et.Element(
Expand Down
4 changes: 2 additions & 2 deletions sparse/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def save_npz(filename, matrix, compressed=True):
"fill_value": matrix.fill_value,
}

if type(matrix) == COO:
if type(matrix) is COO:
nodes["coords"] = matrix.coords
elif type(matrix) == GCXS:
elif type(matrix) is GCXS:
nodes["indices"] = matrix.indices
nodes["indptr"] = matrix.indptr
nodes["compressed_axes"] = matrix.compressed_axes
Expand Down
3 changes: 1 addition & 2 deletions sparse/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,7 @@ def check_zero_fill_value(*args):
for i, arg in enumerate(args):
if hasattr(arg, "fill_value") and not equivalent(arg.fill_value, _zero_of_dtype(arg.dtype)):
raise ValueError(
"This operation requires zero fill values, "
f"but argument {i:d} had a fill value of {arg.fill_value!s}."
f"This operation requires zero fill values, but argument {i:d} had a fill value of {arg.fill_value!s}."
)


Expand Down
2 changes: 1 addition & 1 deletion sparse/tests/test_compressed_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_transpose(random_sparse, copy):
assert random_sparse.shape == t.shape[::-1]

assert_eq(random_sparse, tt)
assert type(random_sparse) == type(tt)
assert type(random_sparse) is type(tt)


def test_transpose_error(random_sparse):
Expand Down

0 comments on commit a6915e6

Please sign in to comment.