Skip to content

Commit c677cd3

Browse files
committed
document changes and format
1 parent 96217d4 commit c677cd3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

changes/3128.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix `zarr.open` default for argument `mode` when `store` is `read_only`

tests/test_api.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
)
4040
from zarr.core.buffer import NDArrayLike
4141
from zarr.errors import MetadataValidationError
42-
from zarr.storage import MemoryStore, ZipStore, LocalStore
42+
from zarr.storage import LocalStore, MemoryStore, ZipStore
4343
from zarr.storage._utils import normalize_path
4444
from zarr.testing.utils import gpu_test
4545

@@ -399,6 +399,7 @@ def test_load_array(memory_store: Store) -> None:
399399
else:
400400
assert_array_equal(bar, array)
401401

402+
402403
@pytest.mark.parametrize("path", ["data", None])
403404
def test_load_zip(tmp_path: pathlib.Path, path: str | None) -> None:
404405
file = tmp_path / "test.zip"
@@ -411,10 +412,10 @@ def test_load_zip(tmp_path: pathlib.Path, path: str | None) -> None:
411412
assert np.array_equal(result, data)
412413
with ZipStore(file, mode="r") as zs:
413414
result = zarr.load(store=zs, path=path)
414-
assert np.array_equal(result, data)
415+
assert_array_equal(result, data)
415416
with ZipStore(file, read_only=True) as zs:
416417
result = zarr.load(store=zs, path=path)
417-
assert np.array_equal(result, data)
418+
assert_array_equal(result, data)
418419

419420

420421
@pytest.mark.parametrize("path", ["data", None])
@@ -426,10 +427,11 @@ def test_load_local(tmp_path: pathlib.Path, path: str | None) -> None:
426427
save(zs, data, path=path)
427428
with LocalStore(file, read_only=False) as zs:
428429
result = zarr.load(store=zs, path=path)
429-
assert np.array_equal(result, data)
430+
assert_array_equal(result, data)
430431
with LocalStore(file, read_only=True) as zs:
431432
result = zarr.load(store=zs, path=path)
432-
assert np.array_equal(result, data)
433+
assert_array_equal(result, data)
434+
433435

434436
def test_tree() -> None:
435437
pytest.importorskip("rich")

0 commit comments

Comments
 (0)