Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies = [
"s3fs",
"xarray>=2024.10",
"xcube-resampling>=0.3.2",
"zarr>=3.0"
"zarr>=2.11,<3",
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion tests/amodes/test_sentinel2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions tests/amodes/test_sentinel3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
)
)

Expand Down Expand Up @@ -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")
)
)

Expand Down
6 changes: 3 additions & 3 deletions tests/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions xarray_eopf/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading