Skip to content

None compressor, dict store, shared data #79

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

Closed
alimanfoo opened this issue Sep 25, 2016 · 0 comments
Closed

None compressor, dict store, shared data #79

alimanfoo opened this issue Sep 25, 2016 · 0 comments

Comments

@alimanfoo
Copy link
Member

When a Zarr array uses no compression, if data are stored in a dict, currently data can end up being shared with another array, which could lead to strange and unexpected behaviour. E.g.:

In [31]: a = np.arange(20)

In [32]: z = zarr.zeros(20, chunks=10, compressor=None, dtype=a.dtype)

In [35]: z[:] = a

In [36]: z[:]
Out[36]: 
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19])

In [37]: a[:] = 0

In [38]: z[:]
Out[38]: array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant