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

Create a Base store class for Zarr Store (update) #789

Merged
merged 39 commits into from
Oct 21, 2021
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9d6d07d
fix conflicts
grlee77 Jun 23, 2021
1e5ed1a
cleanup naming
Carreau Feb 27, 2021
6ca9631
zip move
Carreau Feb 27, 2021
b3db0f1
fix erasability test
Carreau Feb 27, 2021
1db3be2
test for warning
Carreau Feb 27, 2021
8d28678
please flake
Carreau Mar 10, 2021
b5240e4
remove uncovered lines
Carreau Mar 10, 2021
b7aa2d8
remove uncovered lines in tests
Carreau Mar 10, 2021
30afcbb
pragma no cover for exceptional case
Carreau Mar 10, 2021
8136713
minor docstring fixes
grlee77 Jun 23, 2021
2a95219
Merge branch 'master' into base-store-v2
grlee77 Jun 23, 2021
e38a968
pep8 fix
grlee77 Jun 23, 2021
eb2a6da
avoid NumPy 1.21.0 due to https://github.com/numpy/numpy/issues/19325
grlee77 Jun 24, 2021
3c7e90e
Merge remote-tracking branch 'upstream/master' into base-store-v2
grlee77 Jun 25, 2021
e2c57a9
Merge remote-tracking branch 'upstream/master' into base-store-v2
grlee77 Sep 10, 2021
6796f79
move Store class and some helper functions to zarr._storage.store
grlee77 Sep 10, 2021
d0a1b00
BUG: ABSStore should inherit from Store
grlee77 Sep 10, 2021
3d39d8c
pep8 fix
grlee77 Sep 10, 2021
c2d6159
Merge branch 'master' into base-store-v2
joshmoore Sep 22, 2021
5f7c7f5
TST: make CustomMapping a subclass of Store
grlee77 Sep 22, 2021
7e1e92a
Merge remote-tracking branch 'upstream/master' into base-store-v2
grlee77 Sep 22, 2021
b72be38
Merge branch 'base-store-v2' of github.com:grlee77/zarr-python into b…
grlee77 Sep 22, 2021
52deac0
update version mentioned in Store docstring
grlee77 Sep 22, 2021
a7cc4db
update version mentioned in warning message
grlee77 Sep 22, 2021
c59f3be
use Store._ensure_store in Attributes class
grlee77 Sep 22, 2021
a9a98a9
TST: add Attributes test case ensuring store gets coerced to a Store
grlee77 Sep 22, 2021
0a6d923
use Store._ensure_store in normalize_store_arg
grlee77 Sep 22, 2021
a40ed54
TST: make sure high level creation functions also work when passed a …
grlee77 Sep 22, 2021
3fa6f51
TST: add test case with group initialized from dict
grlee77 Sep 22, 2021
0f34ad2
TST: add test case with Array initialized from dict
grlee77 Sep 22, 2021
52fe871
change CustomMapping back to type object, not Store
grlee77 Sep 22, 2021
cb1c5f0
pep8 fixes
grlee77 Sep 24, 2021
6ce0981
update/fix new hierarchy test case to complete code coverage
grlee77 Sep 24, 2021
bb2e8f9
Merge remote-tracking branch 'origin/master' into pr-789
joshmoore Oct 19, 2021
82f7376
create a BaseStore parent for Store
grlee77 Oct 20, 2021
278037e
flake8
grlee77 Oct 21, 2021
57a51c5
Merge remote-tracking branch 'upstream/master' into base-store-v2
grlee77 Oct 21, 2021
06086dc
restore is_erasable check to rmdir function
grlee77 Oct 21, 2021
487b477
Merge branch 'master' into base-store-v2
joshmoore Oct 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def rmdir(store: StoreLike, path: Path = None):
this will be called, otherwise will fall back to implementation via the
`Store` interface."""
path = normalize_storage_path(path)
if hasattr(store, "rmdir"):
if hasattr(store, "rmdir") and store.is_erasable(): # type: ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker for getting this into a 2.11 alpha build but is the hasattr not now redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite yet. There are calls to rmdir from _init_array_metadata (via init_array which still allows a MutableMapping for the store). This is why I put store as StoreLike in the type annotation, but then I had to add "# type: ignore" on this line or mypy complained that MutableMappings do not have an is_erasable attribute.

# pass through
store.rmdir(path) # type: ignore
else:
Expand Down