Skip to content

Commit e855e54

Browse files
committed
call to_dtype once in blosc evolve_from_array_spec
1 parent 2a7b5a8 commit e855e54

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/zarr/codecs/blosc.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,14 @@ def to_dict(self) -> dict[str, JSON]:
136136
}
137137

138138
def evolve_from_array_spec(self, array_spec: ArraySpec) -> Self:
139-
dtype = array_spec.dtype
139+
dtype = array_spec.dtype.to_dtype()
140140
new_codec = self
141141
if new_codec.typesize is None:
142-
new_codec = replace(new_codec, typesize=dtype.to_dtype().itemsize)
142+
new_codec = replace(new_codec, typesize=dtype.itemsize)
143143
if new_codec.shuffle is None:
144144
new_codec = replace(
145145
new_codec,
146-
shuffle=(
147-
BloscShuffle.bitshuffle
148-
if dtype.to_dtype().itemsize == 1
149-
else BloscShuffle.shuffle
150-
),
146+
shuffle=(BloscShuffle.bitshuffle if dtype.itemsize == 1 else BloscShuffle.shuffle),
151147
)
152148

153149
return new_codec

0 commit comments

Comments
 (0)