-
-
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
Move metadata handling to a class (updated) #839
Merged
joshmoore
merged 51 commits into
zarr-developers:master
from
grlee77:metadata-classes-v2
Nov 4, 2021
Merged
Move metadata handling to a class (updated) #839
joshmoore
merged 51 commits into
zarr-developers:master
from
grlee77:metadata-classes-v2
Nov 4, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add assert statements to test_capabilities
update version in Store docstring
TST: initialize stores with KVStore(dict()) instead of bare dict()
ensures Attributes.store is a Store
ensures open_array, etc can work when the user supplies a dict
want to test the non-Store code path in _ensure_store
Codecov Report
@@ Coverage Diff @@
## master #839 +/- ##
=======================================
Coverage 99.94% 99.94%
=======================================
Files 32 32
Lines 11175 11204 +29
=======================================
+ Hits 11169 11198 +29
Misses 6 6
|
BaseStore does not have the listdir or rmdir methods cleaned up some type declerations, making sure mypy passes
This is done to ease transition to Zarr v3 support. When adding v3 support, we can override encode and decode methods to account for changes in the metadata format. The classmethods are also exported under the old function names for backwards compatibility. Co-authored-by: Matthias Bussonier <bussonniermatthias@gmail.com>
Because existing functions allow coerce of dict to store, there are a lot of hasattr calls here. We can remove these checks if we start enforcing that the input MUST be a Store. Use of this _metadata_class will ease the transition to v3
This will make it easier to reuse existing testing code when adding v3 support
use _metadata_class methods
In these cases self._store was created using _ensure_store, so it will always have the attribute
grlee77
force-pushed
the
metadata-classes-v2
branch
from
October 21, 2021 00:20
6ac75bf
to
15d4d78
Compare
Otherwise the save_array doc example fails to write to a ZipStore
@grlee77 : sorry, but it looks like some process of merging/updating has led to conflicts. |
should be fixed now (assuming CI passes) |
No vetoes during the community call yesterday. Rolling into |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR is an update of #581 and builds upon #789 (only the last few commits, starting from 0e1fbe8 are new). This PR is not changing existing metadata function behavior, only moving the existing functions to class methods.
The
Store
from #789 gets a new_metadata_class
attribute that other higher level functions can use to call functions that encode/decode metadata. To transition to v3 support, we would just make a new v3 version of this metadata class that overrides encode/decode methods to account for the changes in metadata format.TODO: