Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary None provided as default #708

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
8 changes: 4 additions & 4 deletions numcodecs/zarr3.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
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:

Check warning on line 274 in numcodecs/zarr3.py

View check run for this annotation

Codecov / codecov/patch

numcodecs/zarr3.py#L274

Added line #L274 was not covered by tests
return Shuffle(**{**self.codec_config, "elementsize": array_spec.dtype.itemsize})
return self # pragma: no cover

Expand Down Expand Up @@ -308,7 +308,7 @@
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:

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 @@
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:

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,7 +356,7 @@
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:

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
Loading