Skip to content

Commit

Permalink
little more
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Feb 7, 2025
1 parent 10e1158 commit 77e724b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions numcodecs/zarr3.py
Original file line number Diff line number Diff line change
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 self.codec_config.get("dtype") is None:
if self.codec_config.get("dtype", None) is None:

Check warning on line 311 in numcodecs/zarr3.py

View check run for this annotation

Codecov / codecov/patch

numcodecs/zarr3.py#L311

Added line #L311 was not covered by tests
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 self.codec_config.get("dtype") is None:
if self.codec_config.get("dtype", None) is None:

Check warning on line 324 in numcodecs/zarr3.py

View check run for this annotation

Codecov / codecov/patch

numcodecs/zarr3.py#L324

Added line #L324 was not covered by tests
return Quantize(**{**self.codec_config, "dtype": str(array_spec.dtype)})
return self

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

def evolve_from_array_spec(self, array_spec: ArraySpec) -> AsType:
decode_dtype = self.codec_config.get("decode_dtype")
if str(array_spec.dtype) != decode_dtype:
if self.codec_config.get("decode_dtype", None) is None:

Check warning on line 359 in numcodecs/zarr3.py

View check run for this annotation

Codecov / codecov/patch

numcodecs/zarr3.py#L359

Added line #L359 was not covered by tests
return AsType(**{**self.codec_config, "decode_dtype": str(array_spec.dtype)})
return self

Expand Down

0 comments on commit 77e724b

Please sign in to comment.