Skip to content

Commit 77e724b

Browse files
committed
little more
1 parent 10e1158 commit 77e724b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

numcodecs/zarr3.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def resolve_metadata(self, chunk_spec: ArraySpec) -> ArraySpec:
308308
return chunk_spec
309309

310310
def evolve_from_array_spec(self, array_spec: ArraySpec) -> FixedScaleOffset:
311-
if self.codec_config.get("dtype") is None:
311+
if self.codec_config.get("dtype", None) is None:
312312
return FixedScaleOffset(**{**self.codec_config, "dtype": str(array_spec.dtype)})
313313
return self
314314

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

323323
def evolve_from_array_spec(self, array_spec: ArraySpec) -> Quantize:
324-
if self.codec_config.get("dtype") is None:
324+
if self.codec_config.get("dtype", None) is None:
325325
return Quantize(**{**self.codec_config, "dtype": str(array_spec.dtype)})
326326
return self
327327

@@ -356,8 +356,7 @@ def resolve_metadata(self, chunk_spec: ArraySpec) -> ArraySpec:
356356
return replace(chunk_spec, dtype=np.dtype(self.codec_config["encode_dtype"])) # type: ignore[arg-type]
357357

358358
def evolve_from_array_spec(self, array_spec: ArraySpec) -> AsType:
359-
decode_dtype = self.codec_config.get("decode_dtype")
360-
if str(array_spec.dtype) != decode_dtype:
359+
if self.codec_config.get("decode_dtype", None) is None:
361360
return AsType(**{**self.codec_config, "decode_dtype": str(array_spec.dtype)})
362361
return self
363362

0 commit comments

Comments
 (0)