Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the dimension_separator param when creating fixtures #154

Merged
Merged
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions fixtures/generate_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand Down
Loading