From e6a0c46405b4910ae25c2a7b76fae98388a1d19e Mon Sep 17 00:00:00 2001 From: Shlomi Nissan Date: Thu, 6 Jun 2024 15:34:14 -0700 Subject: [PATCH] Pass dimension_separator param when creating fixtures --- fixtures/generate_fixtures.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fixtures/generate_fixtures.py b/fixtures/generate_fixtures.py index 746d7af..791e368 100644 --- a/fixtures/generate_fixtures.py +++ b/fixtures/generate_fixtures.py @@ -7,13 +7,14 @@ FIXTURES_FOLDER = "./" -def create_simple_array(store, dtype, compression=None, order="C", ndim=2, write_chunks=False): +def create_simple_array(store, dtype, compression=None, order="C", ndim=2, write_chunks=False, dimension_separator=None): arr = zarr.open( store=store, shape=(8, 8) if ndim == 2 else (8, 8, 8), chunks=(2, None) if ndim == 2 else (2, None, None), dtype=dtype, fill_value=0, + dimension_separator=dimension_separator, mode="w", compression=compression, order=order, @@ -80,19 +81,18 @@ def generate_fixtures(): ) # nested - # TODO: Use latest zarr-python once https://github.com/zarr-developers/zarr-python/pull/716 is merged store = zarr.storage.FSStore( os.path.join(FIXTURES_FOLDER, "simple_nested.zarr"), key_separator="/", auto_mkdir=True, ) create_simple_array( - store=store, dtype=">i4", compression="blosc", write_chunks=True + store=store, + dtype=">i4", + compression="blosc", + write_chunks=True, + dimension_separator="/", ) - # Manually add dimension separator to array meta - meta = json_loads(store[".zarray"]) - meta["dimension_separator"] = "/" - store[".zarray"] = json_dumps(meta) # Float 16 path = os.path.join(FIXTURES_FOLDER, "simple_float16_LE.zarr")