Skip to content

Commit 1be12d3

Browse files
chore: update pre-commit hooks (#542)
* chore: update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.10 → v0.5.1](astral-sh/ruff-pre-commit@v0.4.10...v0.5.1) * fix E721 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Norman Rzepka <[email protected]>
1 parent f2b11f0 commit 1be12d3

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ default_language_version:
77
python: python3
88
repos:
99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: 'v0.4.10'
10+
rev: 'v0.5.1'
1111
hooks:
1212
- id: ruff
1313
args: ["--fix", "--show-fixes"]

numcodecs/categorize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ def __init__(self, labels, dtype, astype='u1'):
4444
raise TypeError("only unicode ('U') and object ('O') dtypes are " "supported")
4545
self.labels = [ensure_text(label) for label in labels]
4646
self.astype = np.dtype(astype)
47-
if self.astype == object:
47+
if self.astype == np.dtype(object):
4848
raise TypeError('encoding as object array not supported')
4949

5050
def encode(self, buf):
5151
# normalise input
52-
if self.dtype == object:
52+
if self.dtype == np.dtype(object):
5353
arr = np.asarray(buf, dtype=object)
5454
else:
5555
arr = ensure_ndarray(buf).view(self.dtype)

numcodecs/delta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, dtype, astype=None):
4747
self.astype = self.dtype
4848
else:
4949
self.astype = np.dtype(astype)
50-
if self.dtype == object or self.astype == object:
50+
if self.dtype == np.dtype(object) or self.astype == np.dtype(object):
5151
raise ValueError('object arrays are not supported')
5252

5353
def encode(self, buf):

numcodecs/fixedscaleoffset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def __init__(self, offset, scale, dtype, astype=None):
7878
self.astype = self.dtype
7979
else:
8080
self.astype = np.dtype(astype)
81-
if self.dtype == object or self.astype == object:
81+
if self.dtype == np.dtype(object) or self.astype == np.dtype(object):
8282
raise ValueError('object arrays are not supported')
8383

8484
def encode(self, buf):

0 commit comments

Comments
 (0)