Skip to content

Commit ce6b4b5

Browse files
committed
fix validate
1 parent 8cfce5b commit ce6b4b5

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

numcodecs/zarr3.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import math
55
from dataclasses import dataclass, replace
66
from functools import cached_property
7+
from typing import Any
78
from warnings import warn
89

910
import numpy as np
@@ -23,12 +24,7 @@
2324
from zarr.core.array_spec import ArraySpec
2425
from zarr.core.buffer import Buffer, BufferPrototype, NDBuffer
2526
from zarr.core.buffer.cpu import as_numpy_array_wrapper
26-
from zarr.core.common import (
27-
JSON,
28-
parse_named_configuration,
29-
product,
30-
)
31-
from zarr.core.metadata import ArrayMetadata
27+
from zarr.core.common import JSON, parse_named_configuration, product
3228

3329
CODEC_PREFIX = "numcodecs."
3430

@@ -59,7 +55,6 @@ def __init__(self, *, codec_id: str | None = None, codec_config: dict[str, JSON]
5955
raise ValueError(f"Codec id does not match {codec_id}. Got: {codec_config['id']}.")
6056

6157
object.__setattr__(self, "codec_config", codec_config)
62-
print("HELLO")
6358
warn(
6459
"Numcodecs codecs are not in the Zarr version 3 specification and "
6560
"may not be supported by other zarr implementations.",
@@ -269,9 +264,9 @@ def resolve_metadata(self, chunk_spec: ArraySpec) -> ArraySpec:
269264
dtype=np.dtype("uint8"),
270265
)
271266

272-
def validate(self, array_metadata: ArrayMetadata) -> None:
273-
if array_metadata.dtype != np.dtype("bool"):
274-
raise ValueError(f"Packbits filter requires bool dtype. Got {array_metadata.dtype}.")
267+
def validate(self, *, dtype: np.dtype[Any], **_kwargs) -> None:
268+
if dtype != np.dtype("bool"):
269+
raise ValueError(f"Packbits filter requires bool dtype. Got {dtype}.")
275270

276271

277272
# bytes-to-bytes codecs

0 commit comments

Comments
 (0)