diff --git a/CHANGES.md b/CHANGES.md index 1002f83..d050896 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,8 @@ - Add the CRS information from the STAC metadata stored in the datatree's attributes; Temporally fixes the issue https://gitlab.eopf.copernicus.eu/cpm/eopf-cpm/-/issues/932 +- Downgraded Zarr dependency to `zarr>=2,<3.0` for now, to be compatible with + `xcube-eopf`. ## Changes in 0.2.6 (from 2026-03-20) diff --git a/environment.yml b/environment.yml index 5f90160..5eb7fca 100644 --- a/environment.yml +++ b/environment.yml @@ -15,7 +15,7 @@ dependencies: - s3fs - xarray >=2024.10 - xcube-resampling >=0.3.2 - - zarr >=3.0 + - zarr >=2.11, <3 # Development Dependencies - Tools - black - isort diff --git a/pyproject.toml b/pyproject.toml index e331b01..3fe15a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ dependencies = [ "s3fs", "xarray>=2024.10", "xcube-resampling>=0.3.2", - "zarr>=3.0" + "zarr>=2.11,<3", ] [project.optional-dependencies] diff --git a/tests/amodes/test_sentinel2.py b/tests/amodes/test_sentinel2.py index 120b92d..ceaa5ef 100644 --- a/tests/amodes/test_sentinel2.py +++ b/tests/amodes/test_sentinel2.py @@ -211,7 +211,7 @@ def test_is_valid_source_ok(self): self.assertTrue(self.mode.is_valid_source("data/S2A_MSIL1C_20240201.zarr")) self.assertTrue( self.mode.is_valid_source( - zarr.storage.LocalStore("data/S2A_MSIL1C_20240201.zarr") + zarr.storage.DirectoryStore("data/S2A_MSIL1C_20240201.zarr") ) ) fs: fsspec.AbstractFileSystem = fsspec.filesystem("local") diff --git a/tests/amodes/test_sentinel3.py b/tests/amodes/test_sentinel3.py index e4e735c..57deb88 100644 --- a/tests/amodes/test_sentinel3.py +++ b/tests/amodes/test_sentinel3.py @@ -126,7 +126,7 @@ def test_is_valid_source_ok(self): self.assertTrue(self.mode.is_valid_source("data/S3A_OL_1_EFR_20240201.zarr")) self.assertTrue( self.mode.is_valid_source( - zarr.storage.LocalStore("data/S3B_OL_1_EFR_20240201.zarr") + zarr.storage.DirectoryStore("data/S3B_OL_1_EFR_20240201.zarr") ) ) fs: fsspec.AbstractFileSystem = fsspec.filesystem("local") @@ -195,7 +195,7 @@ def test_is_valid_source_ok(self): self.assertTrue(self.mode.is_valid_source("data/S3A_SL_1_RBT_20240201.zarr")) self.assertTrue( self.mode.is_valid_source( - zarr.storage.LocalStore("data/S3B_SL_1_RBT_20240201.zarr") + zarr.storage.DirectoryStore("data/S3B_SL_1_RBT_20240201.zarr") ) ) @@ -277,7 +277,7 @@ def test_is_valid_source_ok(self): self.assertTrue(self.mode.is_valid_source("data/S3A_SL_2_LST_20240201.zarr")) self.assertTrue( self.mode.is_valid_source( - zarr.storage.LocalStore("data/S3B_SL_2_LST_20240201.zarr") + zarr.storage.DirectoryStore("data/S3B_SL_2_LST_20240201.zarr") ) ) diff --git a/tests/test_source.py b/tests/test_source.py index ade453e..59b28f0 100644 --- a/tests/test_source.py +++ b/tests/test_source.py @@ -80,11 +80,11 @@ def test_from_mappings(self): self.assertEqual("test3.zarr", Path(root_path.root).name) self.assertEqual("", group_path) - # From zarr.storage.LocalStore - paths = normalize_source_path(zarr.storage.LocalStore("test4.zarr")) + # From zarr.storage.DirectoryStore + paths = normalize_source_path(zarr.storage.DirectoryStore("test4.zarr")) self.assertIsInstance(paths, tuple) root_path, group_path = paths - self.assertEqual("test4.zarr", Path(root_path.root).name) + self.assertEqual("test4.zarr", Path(root_path.path).name) self.assertEqual("", group_path) def test_fail(self): diff --git a/xarray_eopf/source.py b/xarray_eopf/source.py index c7303d8..83322af 100644 --- a/xarray_eopf/source.py +++ b/xarray_eopf/source.py @@ -36,6 +36,8 @@ def get_source_path(source: Any) -> str | None: path: str | None = None if isinstance(source, (str, Path)): path = source + elif hasattr(source, "path"): + path = str(source.path) elif hasattr(source, "root"): path = str(source.root) return path