Skip to content

None compressor, dict store, shared data #79

Closed
@alimanfoo

Description

@alimanfoo

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])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions