Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fe49f5f
fix: zarr v2 compatability fixes
jhamman Sep 14, 2024
9a1580b
move zarr.store to zarr.storage
jhamman Sep 16, 2024
0d89912
make chunks a tuple
jhamman Sep 17, 2024
d78e384
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 17, 2024
e534279
Apply suggestions from code review
jhamman Sep 17, 2024
dea4a3d
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 18, 2024
7800f38
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 22, 2024
93b61fc
more merge conflict resolution
jhamman Sep 23, 2024
88afe52
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 29, 2024
fb6752d
fixups
jhamman Sep 29, 2024
0b1dedc
fixup zipstore
jhamman Sep 29, 2024
322918a
Apply suggestions from code review
jhamman Sep 29, 2024
a95d54a
Apply suggestions from code review
jhamman Sep 30, 2024
128eb53
add test
jhamman Sep 30, 2024
3c170ef
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Sep 30, 2024
54ab9ef
extend test
jhamman Sep 30, 2024
77f2938
clean up parents
jhamman Sep 30, 2024
2295d76
debug race condition
jhamman Sep 30, 2024
5879d67
more debug
jhamman Sep 30, 2024
f54f6f2
document storage classes and some developer apis
jhamman Oct 1, 2024
3940d22
Update src/zarr/core/array.py
jhamman Oct 1, 2024
c9d1c50
Merge branch 'fix/dask-compat' into doc/storage
jhamman Oct 2, 2024
83fa3ac
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Oct 7, 2024
f2137fb
Merge branch 'doc/storage' of github.com:jhamman/zarr-python into doc…
jhamman Oct 7, 2024
f44601b
Merge branch 'v3' into doc/storage
jhamman Oct 9, 2024
731c22a
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Oct 10, 2024
4e93aa0
inherit docstrings from baseclass
jhamman Oct 10, 2024
dad94e2
Merge branch 'doc/storage' of github.com:jhamman/zarr-python into doc…
jhamman Oct 10, 2024
5477d32
fix sphinx warning
jhamman Oct 11, 2024
728d4f7
# docstring inherited
jhamman Oct 11, 2024
e293b47
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Oct 11, 2024
cee730c
Merge branch 'v3' of https://github.com/zarr-developers/zarr-python i…
jhamman Oct 11, 2024
3f7290f
add storage guide
jhamman Oct 11, 2024
35a6428
add missing file
jhamman Oct 11, 2024
a78461e
update links
jhamman Oct 11, 2024
eff01ce
Merge branch 'v3' into doc/storage
jhamman Oct 11, 2024
c1f0923
Merge branch 'v3' into doc/storage
dstansby Oct 12, 2024
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
Prev Previous commit
Next Next commit
more merge conflict resolution
  • Loading branch information
jhamman committed Sep 23, 2024
commit 93b61fca2f7075b47d7bfc70976e24caccdd113e
8 changes: 7 additions & 1 deletion src/zarr/storage/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def make_store_path(
mode: AccessModeLiteral | None = None,
storage_options: dict[str, Any] | None = None,
) -> StorePath:
from zarr.store.remote import RemoteStore # circular import
from zarr.storage.remote import RemoteStore # circular import

used_storage_options = False

Expand All @@ -91,10 +91,14 @@ async def make_store_path(
raise ValueError(
f"mode mismatch (mode={mode} != store.mode={store_like.store.mode.str})"
)
if storage_options:
raise TypeError("storage_options passed but store has already been initialized")
return store_like
elif isinstance(store_like, Store):
if (mode is not None) and (AccessMode.from_literal(mode) != store_like.mode):
raise ValueError(f"mode mismatch (mode={mode} != store.mode={store_like.mode.str})")
if storage_options:
raise TypeError("storage_options passed but store has already been initialized")
await store_like._ensure_open()
result = StorePath(store_like)
elif store_like is None:
Expand All @@ -116,6 +120,8 @@ async def make_store_path(
elif isinstance(store_like, dict):
# We deliberate only consider dict[str, Buffer] here, and not arbitrary mutable mappings.
# By only allowing dictionaries, which are in-memory, we know that MemoryStore appropriate.
if mode is None:
mode = "r"
result = StorePath(await MemoryStore.open(store_dict=store_like, mode=mode))
else:
msg = f"Unsupported type for store_like: '{type(store_like).__name__}'" # type: ignore[unreachable]
Expand Down
4 changes: 2 additions & 2 deletions tests/v3/test_attributes.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import zarr.core
import zarr.core.attributes
import zarr.store
import zarr.storage


def test_put() -> None:
store = zarr.store.MemoryStore({}, mode="w")
store = zarr.storage.MemoryStore({}, mode="w")
attrs = zarr.core.attributes.Attributes(
zarr.Group.from_store(store, attributes={"a": 1, "b": 2})
)
Expand Down
2 changes: 1 addition & 1 deletion tests/v3/test_store/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def test_make_store_path_fsspec(monkeypatch) -> None:
)
async def test_make_store_path_storage_options_raises(store_like: StoreLike) -> None:
with pytest.raises(TypeError, match="storage_options"):
await make_store_path(store_like, storage_options={"foo": "bar"}, mode="w")
await make_store_path(store_like, storage_options={"foo": "bar"})


async def test_unsupported() -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/v3/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import zarr
from zarr.core.sync import SyncError, SyncMixin, _get_lock, _get_loop, sync
from zarr.store.memory import MemoryStore
from zarr.storage.memory import MemoryStore


@pytest.fixture(params=[True, False])
Expand Down