Skip to content

Commit

Permalink
requires Zarr v2.13+
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Sep 9, 2022
1 parent a4703df commit e56dcd8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion python/benchmarks/single-node-io.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def run_zarr(args):
dir_path = args.dir / "zarr"

if not hasattr(zarr.Array, "meta_array"):
RuntimeError("Requires Zarr v2.13.0+ for CuPy support")
raise RuntimeError("requires Zarr v2.13+")

a = cupy.arange(args.nbytes, dtype="uint8")

Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_single_node_io(run_cmd, tmp_path, api):
if "zarr" in api:
zarr = pytest.importorskip("zarr")
if not hasattr(zarr.Array, "meta_array"):
pytest.skip("Requires Zarr v2.13.0+ for CuPy support")
pytest.skip("requires Zarr v2.13+")

retcode = run_cmd(
cmd=[
Expand Down
12 changes: 5 additions & 7 deletions python/tests/test_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
zarr = pytest.importorskip("zarr")
GDSStore = pytest.importorskip("kvikio.zarr").GDSStore


cupy_support = pytest.mark.skipif(
not hasattr(zarr.Array, "meta_array"),
reason="Requires Zarr v2.13.0+ for CuPy support",
)
# To support CuPy arrays, we need the `meta_array` argument introduced
# in Zarr v2.13
# See <https://github.com/zarr-developers/zarr-python/pull/934>
if not hasattr(zarr.Array, "meta_array"):
pytest.skip("requires Zarr v2.13+", allow_module_level=True)


@pytest.fixture
Expand All @@ -35,7 +35,6 @@ def test_direct_store_access(store, array_type):
cupy.testing.assert_array_equal(a, b)


@cupy_support
def test_array(store):
"""Test Zarr array"""

Expand All @@ -49,7 +48,6 @@ def test_array(store):
cupy.testing.assert_array_equal(a, z[:])


@cupy_support
def test_group(store):
"""Test Zarr group"""

Expand Down

0 comments on commit e56dcd8

Please sign in to comment.