Skip to content

Commit 1459e83

Browse files
committed
zarr3
1 parent 07edf73 commit 1459e83

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ dependencies = [
5656
"pyyaml",
5757
"semantic-version",
5858
"tqdm",
59-
"zarr<=2.17",
59+
# anemoi-datasets supports zarr 2 and zarr 3, but we still use only zarr 2:
60+
# - we don't want to create zarr 3 datasets yet, as they will no be readable by zarr 2
61+
# - anemoi-inference needs zarr 2 for patching
62+
# - anemoi-registry needs zarr 2
63+
"zarr<3",
6064
]
6165

6266
optional-dependencies.all = [

src/anemoi/datasets/create/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,13 @@ def __init__(self, path: str):
172172
"""
173173
self.path = path
174174

175+
if Zarr2AndZarr3.version == "3" and not os.environ.get("ANEMOI_DATASETS_ALLOW_BUILDING_ZARR3_DATASETS"):
176+
raise ValueError(
177+
"zarr 3 is installed. anemoi-datasets supports zarr 3, but the datasets build with zarr 3 will "
178+
"not be readable by zarr 2. It is likely that you do not want to create a dataset with zarr 3. "
179+
"Please uninstall zarr 3 and install zarr 2."
180+
)
181+
175182
_, ext = os.path.splitext(self.path)
176183
if ext != ".zarr":
177184
raise ValueError(f"Unsupported extension={ext} for path={self.path}")

0 commit comments

Comments
 (0)