-
-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug in v2 codec pipeline #2501
Labels
bug
Potential issues with the zarr-python library
Comments
Ah this occurs when |
I just tried to reproduce this with >>> import zarr
>>> import numpy as np
>>> a = zarr.Array.create("test.zarr", shape=(12,12,12), chunks=(12,12,12), dtype="uint8", zarr_format=2)
>>> a
<Array file://test.zarr shape=(12, 12, 12) dtype=uint8>
>>> str(a.metadata.filters)
'None'
>>> str(a.metadata.compressor)
'None'
>>> a[:] = np.ones((12,12,12))
>>> a[:]
array([[[1, 1, 1, ..., 1, 1, 1], ... This seems to have worked. |
Here you go . When you set using a slice of a different array, it's not C-contiguous import numpy as np
import zarr
from zarr.storage import MemoryStore
a = zarr.Array.create(MemoryStore({}), shape=(10,8), chunks=(3,3), fill_value=np.nan, dtype="float64", zarr_format=2, exists_ok=True)
print(a.metadata)
array = np.ones(a.shape)
a[slice(6, 9, None), slice(3, 6, None)] = array[slice(6, 9, None), slice(3, 6, None)] # The slice on the RHS is important
# ValueError: ndarray is not C-contiguous |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Zarr version
main
Description
There is a bug in these lines:
cdata
is not of type bytes in theelse
clause:zarr-python/src/zarr/codecs/_v2.py
Lines 80 to 86 in eb85ee7
cc @normanrz
Steps to reproduce
This is triggering failures in xarray's test suite. I haven't succeeded at making a minimal reproducer.
Additional output
No response
The text was updated successfully, but these errors were encountered: