Skip to content

Commit

Permalink
fix E721
Browse files Browse the repository at this point in the history
  • Loading branch information
normanrz committed Jul 9, 2024
1 parent 0a160c6 commit 418bbc9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions numcodecs/categorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def __init__(self, labels, dtype, astype='u1'):
raise TypeError("only unicode ('U') and object ('O') dtypes are " "supported")
self.labels = [ensure_text(label) for label in labels]
self.astype = np.dtype(astype)
if self.astype == object:
if self.astype == np.dtype(object):
raise TypeError('encoding as object array not supported')

def encode(self, buf):
# normalise input
if self.dtype == object:
if self.dtype == np.dtype(object):
arr = np.asarray(buf, dtype=object)
else:
arr = ensure_ndarray(buf).view(self.dtype)
Expand Down
2 changes: 1 addition & 1 deletion numcodecs/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, dtype, astype=None):
self.astype = self.dtype
else:
self.astype = np.dtype(astype)
if self.dtype == object or self.astype == object:
if self.dtype == np.dtype(object) or self.astype == np.dtype(object):
raise ValueError('object arrays are not supported')

def encode(self, buf):
Expand Down
2 changes: 1 addition & 1 deletion numcodecs/fixedscaleoffset.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, offset, scale, dtype, astype=None):
self.astype = self.dtype
else:
self.astype = np.dtype(astype)
if self.dtype == object or self.astype == object:
if self.dtype == np.dtype(object) or self.astype == np.dtype(object):
raise ValueError('object arrays are not supported')

def encode(self, buf):
Expand Down

0 comments on commit 418bbc9

Please sign in to comment.