Skip to content

Commit 6e605eb

Browse files
committed
fix failing example at top of zarr-codecs-numcodecs
1 parent 147b9e0 commit 6e605eb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/zarr/codecs/numcodecs/_codecs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
These codecs were previously defined in :py:mod:`numcodecs`, and have now been moved to `zarr`.
55
6+
>>> import numpy as np
67
>>> import zarr
78
>>> import zarr.codecs.numcodecs as numcodecs
89
>>>
@@ -11,9 +12,9 @@
1112
... shape=(1024, 1024),
1213
... chunks=(64, 64),
1314
... dtype="uint32",
14-
... filters=[numcodecs.zarr3.Delta()],
15-
... compressors=[numcodecs.zarr3.BZ2(level=5)])
16-
>>> array[:] = np.arange(*array.shape).astype(array.dtype)
15+
... filters=[numcodecs.Delta(dtype="uint32")],
16+
... compressors=[numcodecs.BZ2(level=5)])
17+
>>> array[:] = np.arange(np.prod(array.shape), dtype=array.dtype).reshape(*array.shape)
1718
1819
.. note::
1920

0 commit comments

Comments
 (0)