Skip to content

Commit 8907aa0

Browse files
committed
AsType
1 parent 6b57ca0 commit 8907aa0

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

numcodecs/tests/test_zarr3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def test_to_dict():
298298
numcodecs.zarr3.FixedScaleOffset,
299299
numcodecs.zarr3.Quantize,
300300
numcodecs.zarr3.PackBits,
301+
numcodecs.zarr3.AsType,
301302
],
302303
)
303304
def test_codecs_pickleable(codec_cls):

numcodecs/zarr3.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,7 @@ def validate(self, *, dtype: np.dtype[Any], **_kwargs) -> None:
321321
raise ValueError(f"Packbits filter requires bool dtype. Got {dtype}.")
322322

323323

324-
@_add_docstring_wrapper("numcodecs.astype.AsType")
325-
class AsType(_NumcodecsArrayArrayCodec):
326-
codec_name = f"{CODEC_PREFIX}astype"
327-
328-
def __init__(self, **codec_config: JSON) -> None:
329-
super().__init__(**codec_config)
330-
324+
class AsType(_NumcodecsArrayArrayCodec, codec_name="astype"):
331325
def resolve_metadata(self, chunk_spec: ArraySpec) -> ArraySpec:
332326
return replace(chunk_spec, dtype=np.dtype(self.codec_config["encode_dtype"])) # type: ignore[arg-type]
333327

0 commit comments

Comments
 (0)