File: 0001-zarr3-compat.patch

package info (click to toggle)
xarray-eopf 0.2.7-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,712 kB
  • sloc: python: 3,300; makefile: 3
file content (116 lines) | stat: -rw-r--r-- 4,724 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Sun, 8 Mar 2026 19:04:57 +0000
Subject: zarr3-compat

Forwarded: not-needed
---
 pyproject.toml                  | 2 +-
 tests/amodes/test_sentinel2.py  | 2 +-
 tests/amodes/test_sentinel3.py  | 6 +++---
 tests/test_source.py            | 6 +++---
 xarray_eopf/amodes/sentinel2.py | 2 +-
 xarray_eopf/amodes/sentinel3.py | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index 3fe15a7..4b201dd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -51,7 +51,7 @@ dependencies = [
   "s3fs",
   "xarray>=2024.10",
   "xcube-resampling>=0.3.2",
-  "zarr>=2.11,<3",
+  "zarr",
 ]
 
 [project.optional-dependencies]
diff --git a/tests/amodes/test_sentinel2.py b/tests/amodes/test_sentinel2.py
index ceaa5ef..120b92d 100644
--- a/tests/amodes/test_sentinel2.py
+++ b/tests/amodes/test_sentinel2.py
@@ -211,7 +211,7 @@ class MsiL1CTest(MsiTestMixin, TestCase):
         self.assertTrue(self.mode.is_valid_source("data/S2A_MSIL1C_20240201.zarr"))
         self.assertTrue(
             self.mode.is_valid_source(
-                zarr.storage.DirectoryStore("data/S2A_MSIL1C_20240201.zarr")
+                zarr.storage.LocalStore("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 57deb88..e4e735c 100644
--- a/tests/amodes/test_sentinel3.py
+++ b/tests/amodes/test_sentinel3.py
@@ -126,7 +126,7 @@ class OlciEfrTest(Sen3TestMixin, TestCase):
         self.assertTrue(self.mode.is_valid_source("data/S3A_OL_1_EFR_20240201.zarr"))
         self.assertTrue(
             self.mode.is_valid_source(
-                zarr.storage.DirectoryStore("data/S3B_OL_1_EFR_20240201.zarr")
+                zarr.storage.LocalStore("data/S3B_OL_1_EFR_20240201.zarr")
             )
         )
         fs: fsspec.AbstractFileSystem = fsspec.filesystem("local")
@@ -195,7 +195,7 @@ class SlstrRbtTest(Sen3TestMixin, TestCase):
         self.assertTrue(self.mode.is_valid_source("data/S3A_SL_1_RBT_20240201.zarr"))
         self.assertTrue(
             self.mode.is_valid_source(
-                zarr.storage.DirectoryStore("data/S3B_SL_1_RBT_20240201.zarr")
+                zarr.storage.LocalStore("data/S3B_SL_1_RBT_20240201.zarr")
             )
         )
 
@@ -277,7 +277,7 @@ class SlstrLstTest(Sen3TestMixin, TestCase):
         self.assertTrue(self.mode.is_valid_source("data/S3A_SL_2_LST_20240201.zarr"))
         self.assertTrue(
             self.mode.is_valid_source(
-                zarr.storage.DirectoryStore("data/S3B_SL_2_LST_20240201.zarr")
+                zarr.storage.LocalStore("data/S3B_SL_2_LST_20240201.zarr")
             )
         )
 
diff --git a/tests/test_source.py b/tests/test_source.py
index 59b28f0..ade453e 100644
--- a/tests/test_source.py
+++ b/tests/test_source.py
@@ -80,11 +80,11 @@ class GetSourcePathsTest(TestCase):
         self.assertEqual("test3.zarr", Path(root_path.root).name)
         self.assertEqual("", group_path)
 
-        # From zarr.storage.DirectoryStore
-        paths = normalize_source_path(zarr.storage.DirectoryStore("test4.zarr"))
+        # From zarr.storage.LocalStore
+        paths = normalize_source_path(zarr.storage.LocalStore("test4.zarr"))
         self.assertIsInstance(paths, tuple)
         root_path, group_path = paths
-        self.assertEqual("test4.zarr", Path(root_path.path).name)
+        self.assertEqual("test4.zarr", Path(root_path.root).name)
         self.assertEqual("", group_path)
 
     def test_fail(self):
diff --git a/xarray_eopf/amodes/sentinel2.py b/xarray_eopf/amodes/sentinel2.py
index b120808..46a95a2 100644
--- a/xarray_eopf/amodes/sentinel2.py
+++ b/xarray_eopf/amodes/sentinel2.py
@@ -97,7 +97,7 @@ COMMON_BAND_NAMES_REVERSE = {v: k for k, v in COMMON_BAND_NAMES.items()}
 
 class Msi(AnalysisMode, ABC):
     def is_valid_source(self, source: Any) -> bool:
-        root_path = get_source_path(source)
+        root_path = str(get_source_path(source))
         return (
             (
                 f"S2A_{self.product_type}_" in root_path
diff --git a/xarray_eopf/amodes/sentinel3.py b/xarray_eopf/amodes/sentinel3.py
index ecb13b7..4fac5a8 100644
--- a/xarray_eopf/amodes/sentinel3.py
+++ b/xarray_eopf/amodes/sentinel3.py
@@ -35,7 +35,7 @@ class Sen3(AnalysisMode, ABC):
     default_resolution: int | None = None
 
     def is_valid_source(self, source: Any) -> bool:
-        root_path = get_source_path(source)
+        root_path = str(get_source_path(source))
         return (
             (
                 f"S3A_{self.product_type}_" in root_path