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

n5: prevent failure on missing group metadata #651

Merged
merged 3 commits into from Nov 18, 2020

Conversation

joshmoore
Copy link
Member

In the N5 spec, https://github.com/saalfeldlab/n5#file-system-specification
point 3, the {"n5": "$version"} metadata is only expected at the root level.
Datasets missing the metadata on inner groups fail to load:

In [43]: list(zarr.hierarchy.Group(store=zarr.n5.N5Store("ex.n5")).groups())
...
ValueError: group not found at path 'setup0'

This changes the group parsing logic to not fail if the metadata is
missing. Suggestions welcome on how to detect the top group/array in
order to special case the parsing.

see tischi/i2k-2020-s3-zarr-workshop#1 (comment) for the original report

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/tutorial.rst
  • Changes documented in docs/release.rst
  • AppVeyor and Travis CI passes
  • Test coverage is 100% (Coveralls passes)

In the N5 spec, https://github.com/saalfeldlab/n5#file-system-specification
point 3, the `{"n5": "$version"}` metadata is only expected at the root level.
Datasets missing the metadata on inner groups fail to load:

```
In [43]: list(zarr.hierarchy.Group(store=zarr.n5.N5Store("ex.n5")).groups())
...
ValueError: group not found at path 'setup0'
```

This changes the group parsing logic to not fail if the metadata is
missing. Suggestions welcome on how to detect the top group/array in
order to special case the parsing.
zarr/n5.py Outdated Show resolved Hide resolved
joshmoore and others added 2 commits November 13, 2020 08:36
Co-authored-by: jakirkham <jakirkham@gmail.com>
@codecov
Copy link

codecov bot commented Nov 13, 2020

Codecov Report

Merging #651 (3272ba4) into master (06450d0) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #651   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines        10066     10084   +18     
=========================================
+ Hits         10066     10084   +18     
Impacted Files Coverage Δ
zarr/n5.py 100.00% <100.00%> (ø)
zarr/tests/test_creation.py 100.00% <100.00%> (ø)
zarr/hierarchy.py 100.00% <0.00%> (ø)

@Carreau Carreau merged commit 5d77292 into zarr-developers:master Nov 18, 2020
@joshmoore joshmoore deleted the n5-attrs branch November 18, 2020 17:55
@Carreau Carreau added this to the v2.6 milestone Dec 1, 2020
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 this pull request may close these issues.

None yet

3 participants