Skip to content
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

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

Closed
grlee77 opened this issue Apr 15, 2021 · 0 comments · Fixed by #718
Closed

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

grlee77 opened this issue Apr 15, 2021 · 0 comments · Fixed by #718

Comments

@grlee77
Copy link
Contributor

grlee77 commented Apr 15, 2021

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

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

Successfully merging a pull request may close this issue.

1 participant