-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
zarr.open_array does not properly recognize NestedDirectoryStore #530
Comments
Thanks for opening an issue and the nice example @JimBiardCics! I'm able to reproduce the same behavior. When using a string path with Lines 130 to 142 in e7708c9
For a path like In your example, replacing a = zarr.open_array('foo.zarr', mode = 'r') with a = zarr.open_array(zarr.NestedDirectoryStore('foo.zarr'), mode = 'r') should fix things |
@jrbourbeau The problem, as I see it, is that the application using the file has no way to determine which type of store to use. It is not particularly reasonable to expect all applications to know ahead of time which store type to use when opening a zarr file. |
+1 for this issue! Instead of guessing the store from the file extension, can the |
FWIW I agree that ideally the application should not need to know ahead of
time which store path separator has been used for chunks, but should be
able to discover that from the array metadata. This is something I have
proposed to introduce in the v3 spec, although that is still just a draft.
For the current implementation based on the v2 spec we could either leave
it as is, and try to be clear in documentation that if you use nested store
you need to communicate this somehow to users of the data so they know how
to open correctly. Alternatively we could add some metadata field in the
.zarray to communicate which chunk path separator is used.
Given this will be fixed in the v3 spec, I'd be inclined to wait until
then. Happy to discuss though.
…On Fri, 28 Feb 2020, 18:31 Stuart Berg, ***@***.***> wrote:
+1 for this issue!
Instead of guessing the store from the file extension, can the store
class name simply be added to the metadata in .zarray?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#530?email_source=notifications&email_token=AAFLYQSAXJBOBXBYOIA6LZDRFFJ6TA5CNFSM4J4M52QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENJVNVQ#issuecomment-592664278>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFLYQR7UJYHOXA4MPRODZDRFFJ6TANCNFSM4J4M52QA>
.
|
A general big 👍 from me as well, and a cross link to zarr-developers/zarr-specs#49, but I'd add a caution that a class name will not necessarily be portable between implementations. |
@alimanfoo : do you imagine it would be possible to do something in v2 attributes as a prototype of the ultimate v3 implementation? |
Yes this should be doable. The code that constructs the chunk key is _chunk_key(). You could modify that to be something like:
You could then modify the implementation of the Array class constructor to look either in array metadata or attributes for a 'zarr_chunk_key_separator' field or something like that, store the value as an instance attribute, then use it within the |
I hit this as well, despite having previously seen this issue! I look forward to the fix in v3. |
(cross-posting from the linked neuroglancer PR) I will be looking at a PR for zarr-python ... which will use one of a small number of options for finding the key. Work on the Java side has taken place in bcdev/jzarr#17:
see also: ome/ngff#29 which references https://gitter.im/zarr-developers/community?at=601d471fc83ec358be27944f |
In Python, one should be able to resolve this with an |
I believe #716 now implements a solution for this issue. |
Problem description
A zarr 'file' created using NestedDirectoryStore will not load correctly when later opened using the path alone. The shape (and other metadata) is correct, but the values are not loaded. In the code sample above, the shape of the original and reloaded array is the same, but the contents don't match. The second array contains only zeroes.
Version and installation information
zarr.__version__
- 2.3.2numcodecs.__version__
- 0.6.4The text was updated successfully, but these errors were encountered: