Skip to content

Commit ecb3d33

Browse files
committed
release docs and repr test
1 parent 411d6df commit ecb3d33

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

docs/release.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Fixes
2727
~~~~~
2828
* Fixes issue with ``Delta`` Zarr 3 codec not working with ``astype``.
2929
By :user:`Norman Rzepka <normanrz>`, :issue:`664`
30+
* Fixes issues with the upcoming ``zarr`` 3.0.0 release.
31+
By :user:`Norman Rzepka <normanrz>`, :issue:`675`
3032

3133

3234
Improvements

numcodecs/tests/test_zarr3.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,8 @@ def test_delta_astype(store: StorePath):
267267
a[:, :] = data.copy()
268268
a = zarr.open_array(store / "generic", mode="r")
269269
np.testing.assert_array_equal(data, a[:, :])
270+
271+
272+
def test_repr():
273+
codec = numcodecs.zarr3.LZ4(level=5)
274+
assert repr(codec) == "LZ4(codec_name='numcodecs.lz4', codec_config={'level': 5})"

numcodecs/zarr3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def compute_encoded_size(self, input_byte_length: int, chunk_spec: ArraySpec) ->
122122

123123
# Override __repr__ because dynamically constructed classes don't seem to work otherwise
124124
def __repr__(self) -> str:
125-
return f"{self.__class__.__name__}(codec_name={self.codec_name!r}, codec_config={self.codec_config!r})"
125+
codec_config = self.codec_config.copy()
126+
codec_config.pop("id", None)
127+
return f"{self.__class__.__name__}(codec_name={self.codec_name!r}, codec_config={codec_config!r})"
126128

127129

128130
class _NumcodecsBytesBytesCodec(_NumcodecsCodec, BytesBytesCodec):

0 commit comments

Comments
 (0)