-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
Accept dictionaries for store
argument
#2164
Conversation
After thinking a bit more about this, I'm a bit concerned that we may not be ready for a generic |
I'm not sure how much faith to put in it, but the fact that mypy allows it gives me some comfort. |
If we accept anything that implements |
Ah, I see, the concern is specifically around the isinstance at https://github.com/zarr-developers/zarr-python/pull/2164/files#diff-9a2583a58394683284176a2d2db4df1e8ffafce4f34edc7a176c625863815518R99. In that case, yes, I think we should narrow it to just accept dictionaries, where there's no ambiguity about whether a |
* v3: fix: opening a group with unspecified format finds either v2 or v3 (zarr-developers#2183) test: check that store, array, and group classes are serializable (zarr-developers#2006) feature(store): V3 ZipStore (zarr-developers#2078) More typing fixes for tests (zarr-developers#2173) refactor: split metadata into v2 and v3 modules (zarr-developers#2163) Accept dictionaries for `store` argument (zarr-developers#2164) Simplify mypy config for tests (zarr-developers#2156) Fixed path segment duplication in open_array (zarr-developers#2167) Fixed test warnings (zarr-developers#2168) chore: update pre-commit hooks (zarr-developers#2165) Ensure that store_dict used for empty dicts (zarr-developers#2162) Bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1 in the actions group (zarr-developers#2160)
* Accept dictionaries for `store` * fixup doc build warnings * Only support dictionaries
This updates how we handle a plain dictionary provided to
open_group
and friends so that the following works:group = await zarr.api.asynchronous.open_group(store={}, mode="w")
The dictionary is interpreted as the
store_dict
argument ofzarr.store.MemoryStore
. This effectively mirrors the behavior of zarr-python v2, and I think doesn't introduce an ambiguity. Previously a TypeError was raised.This change will make it slightly easier to get xarray's test suite running with zarr v3.
TODO: