Skip to content

Commit 3159731

Browse files
Altay Sansaltasansal
authored andcommitted
test cli tests and disable copy
1 parent fcc8d99 commit 3159731

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/mdio/api/convenience.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from mdio import MDIOReader
2222

2323

24-
# TODO(Altay): This is not implemented in Zarr v3 yet.
2524
def copy_mdio( # noqa: PLR0913
2625
source: MDIOReader,
2726
dest_path_or_buffer: str,
@@ -52,20 +51,22 @@ def copy_mdio( # noqa: PLR0913
5251
Default is None (will assume anonymous).
5352
overwrite: Overwrite destination or not.
5453
54+
Raises:
55+
NotImplementedError: because Zarr v3 doesn't support copy.
5556
"""
5657
if storage_options is None:
5758
storage_options = {}
5859

5960
dest_store = process_url(
6061
url=dest_path_or_buffer,
61-
mode="w",
62-
storage_options=storage_options,
63-
memory_cache_size=0,
6462
disk_cache=False,
6563
)
6664

6765
if_exists = "replace" if overwrite is True else "raise"
6866

67+
# TODO(Altay): Update this function when Zarr v3 supports copy.
68+
raise NotImplementedError("Zarr version 3.0.0+ does not support copy yet.")
69+
6970
zarr.copy_store(
7071
source=source.store,
7172
dest=dest_store,

src/mdio/commands/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def parse_grid(grid: Grid) -> dict[str, dict[str, int | str]]:
9595
def parse_access_patterns(reader: MDIOReader) -> dict[str, Any]:
9696
"""Extract access patterns and their info."""
9797
access_pattern_dict = {}
98-
for name, array in reader._data_group.items():
98+
for name, array in reader._data_group.arrays():
9999
pattern = name.replace("chunked_", "")
100100
chunks = str(array.chunks)
101101
format_ = str(array.dtype)

tests/test_main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def test_main_copy_succeeds(runner: CliRunner, zarr_tmp: Path, zarr_tmp2: Path)
5555
cli_args = ["copy", str(zarr_tmp), str(zarr_tmp2)]
5656

5757
result = runner.invoke(__main__.main, args=cli_args)
58-
assert result.exit_code == 0
58+
59+
# TODO(Altay): Update exit code to zero once Zarr v3 store supports copy.
60+
assert result.exit_code == 1
5961

6062

6163
def test_cli_version(runner: CliRunner) -> None:

0 commit comments

Comments
 (0)