Skip to content

Array._chunk_key does not respect FSStore's key_separator attribute #717

Description

@grlee77

Minimal, reproducible code sample, a copy-pastable example if possible

data = np.arange(1000).reshape(10, 10, 10)
name = 'raw'

store = FSStore('/tmp/test.zr', key_separator='/', auto_mkdir=True)
f = open_group(store, mode='w')
f.create_dataset(name, data=data, chunks=(5, 5, 5),
                 compressor=None)
h = open_group(store, mode='r')
# check below fails because h[name][:] will be all zeros
np.testing.assert_array_equal(h[name][:], data)  

Problem description

If an nested Zarr array is read in using an FSStore object initialized with key_separator='/', all array entries are reported as zeros.

This seems to be because the _chunk_key attribute of zarr.core.Array assumes that '.' is the separator

Version and installation information

'2.7.1.dev2' (current master branch)


I will make a PR addressing this now

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions