Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions numcodecs/zarr3.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def __init__(self, **codec_config: JSON) -> None:
super().__init__(**codec_config)

def evolve_from_array_spec(self, array_spec: ArraySpec) -> Shuffle:
if array_spec.dtype.itemsize != self.codec_config.get("elementsize"):
if self.codec_config.get("elementsize", None) is None:
return Shuffle(**{**self.codec_config, "elementsize": array_spec.dtype.itemsize})
return self # pragma: no cover

Expand Down Expand Up @@ -308,7 +308,7 @@ def resolve_metadata(self, chunk_spec: ArraySpec) -> ArraySpec:
return chunk_spec

def evolve_from_array_spec(self, array_spec: ArraySpec) -> FixedScaleOffset:
if str(array_spec.dtype) != self.codec_config.get("dtype"):
if self.codec_config.get("dtype") is None:
return FixedScaleOffset(**{**self.codec_config, "dtype": str(array_spec.dtype)})
return self

Expand All @@ -321,7 +321,7 @@ def __init__(self, **codec_config: JSON) -> None:
super().__init__(**codec_config)

def evolve_from_array_spec(self, array_spec: ArraySpec) -> Quantize:
if str(array_spec.dtype) != self.codec_config.get("dtype"):
if self.codec_config.get("dtype") is None:
return Quantize(**{**self.codec_config, "dtype": str(array_spec.dtype)})
return self

Expand Down
Loading