Skip to content

Commit a0d1ee9

Browse files
authored
Merge branch 'main' into dependabot/github_actions/conda-incubator/setup-miniconda-3.1.1
2 parents fba550a + a2bdbe5 commit a0d1ee9

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ repos:
1414
- id: debug-statements
1515

1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.8.6
17+
rev: v0.9.4
1818
hooks:
1919
- id: ruff
2020
args: ["--fix", "--show-fixes"]
2121
- id: ruff-format
2222

2323
- repo: https://github.com/scientific-python/cookie
24-
rev: 2024.08.19
24+
rev: 2025.01.22
2525
hooks:
2626
- id: sp-repo-review
2727

numcodecs/tests/test_vlen_bytes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import unittest
23

34
import numpy as np
@@ -86,7 +87,7 @@ def test_decode_errors():
8687

8788
# TODO: fix this test on GitHub actions somehow...
8889
# See https://github.com/zarr-developers/numcodecs/issues/683
89-
@pytest.mark.skip("Test is failing on GitHub actions.")
90+
@pytest.mark.skipif(sys.platform == "darwin", reason="Test is failing on macOS on GitHub actions.")
9091
def test_encode_none():
9192
a = np.array([b'foo', None, b'bar'], dtype=object)
9293
codec = VLenBytes()

numcodecs/tests/test_zarr3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_generic_compressor(
9191
(numcodecs.zarr3.Delta, {"dtype": "float32"}),
9292
(numcodecs.zarr3.FixedScaleOffset, {"offset": 0, "scale": 25.5}),
9393
(numcodecs.zarr3.FixedScaleOffset, {"offset": 0, "scale": 51, "astype": "uint16"}),
94-
(numcodecs.zarr3.AsType, {"encode_dtype": "float32", "decode_dtype": "float64"}),
94+
(numcodecs.zarr3.AsType, {"encode_dtype": "float32", "decode_dtype": "float32"}),
9595
],
9696
ids=[
9797
"delta",

numcodecs/zarr3.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def __init__(self, **codec_config: JSON) -> None:
271271
super().__init__(**codec_config)
272272

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

@@ -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 str(array_spec.dtype) != self.codec_config.get("dtype"):
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 str(array_spec.dtype) != self.codec_config.get("dtype"):
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

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ ignore = [
219219
"Q003",
220220
"COM812",
221221
"COM819",
222-
"ISC001",
223-
"ISC002",
224222
]
225223

226224
[tool.ruff.lint.extend-per-file-ignores]

0 commit comments

Comments
 (0)