From 0a9473b5522dcc75d3d5043b1a061a25abb3f274 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 13 Feb 2025 21:43:21 +0100 Subject: [PATCH] Unnecessary `None` provided as default --- numcodecs/zarr3.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/numcodecs/zarr3.py b/numcodecs/zarr3.py index f1743ffb..8435da83 100644 --- a/numcodecs/zarr3.py +++ b/numcodecs/zarr3.py @@ -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 self.codec_config.get("elementsize", None) is None: + if self.codec_config.get("elementsize") is None: return Shuffle(**{**self.codec_config, "elementsize": array_spec.dtype.itemsize}) return self # pragma: no cover @@ -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", None) is None: + if self.codec_config.get("dtype") is None: return FixedScaleOffset(**{**self.codec_config, "dtype": str(array_spec.dtype)}) return self @@ -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", None) is None: + if self.codec_config.get("dtype") is None: return Quantize(**{**self.codec_config, "dtype": str(array_spec.dtype)}) return self @@ -356,7 +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: - if self.codec_config.get("decode_dtype", None) is None: + if self.codec_config.get("decode_dtype") is None: return AsType(**{**self.codec_config, "decode_dtype": str(array_spec.dtype)}) return self