Repository navigation
Commit 07d24b1
Move metadata handling to a class (updated) (#839)
* fix conflicts
* cleanup naming
* zip move
* fix erasability test
* test for warning
* please flake
* remove uncovered lines
* remove uncovered lines in tests
* pragma no cover for exceptional case
* minor docstring fixes
add assert statements to test_capabilities
* pep8 fix
* avoid NumPy 1.21.0 due to numpy/numpy#19325
* move Store class and some helper functions to zarr._storage.store
update version in Store docstring
* BUG: ABSStore should inherit from Store
* pep8 fix
* TST: make CustomMapping a subclass of Store
TST: initialize stores with KVStore(dict()) instead of bare dict()
* update version mentioned in Store docstring
* update version mentioned in warning message
* use Store._ensure_store in Attributes class
ensures Attributes.store is a Store
* TST: add Attributes test case ensuring store gets coerced to a Store
* use Store._ensure_store in normalize_store_arg
ensures open_array, etc can work when the user supplies a dict
* TST: make sure high level creation functions also work when passed a dict for store
* TST: add test case with group initialized from dict
* TST: add test case with Array initialized from dict
* change CustomMapping back to type object, not Store
want to test the non-Store code path in _ensure_store
* pep8 fixes
* update/fix new hierarchy test case to complete code coverage
* create a BaseStore parent for Store
BaseStore does not have the listdir or rmdir methods
cleaned up some type declerations, making sure mypy passes
* Convert functions in zarr.meta to class methods
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 <[email protected]>
* Add a _metadata_class attribute to the Store class
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
* Use _metadata_class attribute in test_storage.py
This will make it easier to reuse existing testing code when adding v3 support
* remove unused imports
use _metadata_class methods
* remove unnecessary hasattr checks
In these cases self._store was created using _ensure_store, so it will always have the attribute
* test migrate1to2 with store=dict() and store=KVStore(dict())
* pep8: remove unused imports
* misc
* s
* remove unused FLOAT_FILLS
* mypy fixes
* sync metadata methods with current master branch
* flake8
* restore is_erasable check to rmdir function
Otherwise the save_array doc example fails to write to a ZipStore
Co-authored-by: Matthias Bussonnier <[email protected]>
Co-authored-by: Josh Moore <[email protected]>
Co-authored-by: jmoore <[email protected]>1 parent e499f07 commit 07d24b1
7 files changed
Lines changed: 265 additions & 246 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
213 | | - | |
| 212 | + | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
| |||
267 | 266 | | |
268 | 267 | | |
269 | 268 | | |
270 | | - | |
| 269 | + | |
271 | 270 | | |
272 | 271 | | |
273 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
137 | | - | |
138 | | - | |
| 136 | + | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
| |||
0 commit comments