anemoi-utils 0.4.21__py3-none-any.whl → 0.4.22__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of anemoi-utils might be problematic. Click here for more details.
- anemoi/utils/_version.py +2 -2
- anemoi/utils/testing.py +25 -3
- {anemoi_utils-0.4.21.dist-info → anemoi_utils-0.4.22.dist-info}/METADATA +1 -1
- {anemoi_utils-0.4.21.dist-info → anemoi_utils-0.4.22.dist-info}/RECORD +8 -8
- {anemoi_utils-0.4.21.dist-info → anemoi_utils-0.4.22.dist-info}/WHEEL +0 -0
- {anemoi_utils-0.4.21.dist-info → anemoi_utils-0.4.22.dist-info}/entry_points.txt +0 -0
- {anemoi_utils-0.4.21.dist-info → anemoi_utils-0.4.22.dist-info}/licenses/LICENSE +0 -0
- {anemoi_utils-0.4.21.dist-info → anemoi_utils-0.4.22.dist-info}/top_level.txt +0 -0
anemoi/utils/_version.py
CHANGED
anemoi/utils/testing.py
CHANGED
|
@@ -68,6 +68,23 @@ def _check_path(path: str) -> None:
|
|
|
68
68
|
assert not path.startswith("."), f"Path '{path}' should not start with '.'"
|
|
69
69
|
|
|
70
70
|
|
|
71
|
+
def _temporary_directory_for_test_data(path: str) -> str:
|
|
72
|
+
"""Get the temporary directory for a test dataset.
|
|
73
|
+
|
|
74
|
+
Parameters
|
|
75
|
+
----------
|
|
76
|
+
path : str
|
|
77
|
+
The relative path to the test data in the object store.
|
|
78
|
+
|
|
79
|
+
Returns
|
|
80
|
+
-------
|
|
81
|
+
str
|
|
82
|
+
The path to the temporary directory.
|
|
83
|
+
"""
|
|
84
|
+
_check_path(path)
|
|
85
|
+
return os.path.normpath(os.path.join(_temporary_directory(), path))
|
|
86
|
+
|
|
87
|
+
|
|
71
88
|
def url_for_test_data(path: str) -> str:
|
|
72
89
|
"""Generate the URL for the test data based on the given path.
|
|
73
90
|
|
|
@@ -101,12 +118,11 @@ def get_test_data(path: str, gzipped=False) -> str:
|
|
|
101
118
|
str
|
|
102
119
|
The local path to the downloaded test data.
|
|
103
120
|
"""
|
|
104
|
-
_check_path(path)
|
|
105
121
|
|
|
106
122
|
if _offline():
|
|
107
123
|
raise RuntimeError("Offline mode: cannot download test data, add @pytest.mark.skipif(not offline(),...)")
|
|
108
124
|
|
|
109
|
-
target =
|
|
125
|
+
target = _temporary_directory_for_test_data(path)
|
|
110
126
|
with lock:
|
|
111
127
|
if os.path.exists(target):
|
|
112
128
|
return target
|
|
@@ -153,12 +169,18 @@ def get_test_archive(path: str, extension=".extracted") -> str:
|
|
|
153
169
|
|
|
154
170
|
with lock:
|
|
155
171
|
|
|
172
|
+
target = _temporary_directory_for_test_data(path) + extension
|
|
173
|
+
|
|
174
|
+
if os.path.exists(target):
|
|
175
|
+
return target
|
|
176
|
+
|
|
156
177
|
archive = get_test_data(path)
|
|
157
|
-
target = archive + extension
|
|
158
178
|
|
|
159
179
|
shutil.unpack_archive(archive, os.path.dirname(target) + ".tmp")
|
|
160
180
|
os.rename(os.path.dirname(target) + ".tmp", target)
|
|
161
181
|
|
|
182
|
+
os.remove(archive)
|
|
183
|
+
|
|
162
184
|
return target
|
|
163
185
|
|
|
164
186
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: anemoi-utils
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.22
|
|
4
4
|
Summary: A package to hold various functions to support training of ML models on ECMWF data.
|
|
5
5
|
Author-email: "European Centre for Medium-Range Weather Forecasts (ECMWF)" <software.support@ecmwf.int>
|
|
6
6
|
License: Apache License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
anemoi/utils/__init__.py,sha256=uVhpF-VjIl_4mMywOVtgTutgsdIsqz-xdkwxeMhzuag,730
|
|
2
2
|
anemoi/utils/__main__.py,sha256=6LlE4MYrPvqqrykxXh7XMi50UZteUY59NeM8P9Zs2dU,910
|
|
3
|
-
anemoi/utils/_version.py,sha256=
|
|
3
|
+
anemoi/utils/_version.py,sha256=ncPL58_Lzy93I55YUff3cwMUk7Kbpd4bhXC7ujoaqGw,513
|
|
4
4
|
anemoi/utils/caching.py,sha256=rXbeAmpBcMbbfN4EVblaHWKicsrtx1otER84FEBtz98,6183
|
|
5
5
|
anemoi/utils/checkpoints.py,sha256=N4WpAZXa4etrpSEKhHqUUtG2-x9w3FJMHcLO-dDAXPY,9600
|
|
6
6
|
anemoi/utils/cli.py,sha256=IyZfnSw0u0yYnrjOrzvm2RuuKvDk4cVb8pf8BkaChgA,6209
|
|
@@ -19,7 +19,7 @@ anemoi/utils/rules.py,sha256=VspUoPmw7tijrs6l_wl4vDjr_zVQsFjx9ITiBSvxgc8,6972
|
|
|
19
19
|
anemoi/utils/s3.py,sha256=xMT48kbcelcjjqsaU567WI3oZ5eqo88Rlgyx5ECszAU,4074
|
|
20
20
|
anemoi/utils/sanitise.py,sha256=ZYGdSX6qihQANr3pHZjbKnoapnzP1KcrWdW1Ul1mOGk,3668
|
|
21
21
|
anemoi/utils/sanitize.py,sha256=43ZKDcfVpeXSsJ9TFEc9aZnD6oe2cUh151XnDspM98M,462
|
|
22
|
-
anemoi/utils/testing.py,sha256=
|
|
22
|
+
anemoi/utils/testing.py,sha256=psfHfluNqXa-cXSDF4xD7xIQCVPvBGDNCWWZ-yVh_24,7750
|
|
23
23
|
anemoi/utils/text.py,sha256=HkzIvi24obDceFLpJEwBJ9PmPrJUkQN2TrElJ-A87gU,14441
|
|
24
24
|
anemoi/utils/timer.py,sha256=_leKMYza2faM7JKlGE7LCNy13rbdPnwaCF7PSrI_NmI,3895
|
|
25
25
|
anemoi/utils/commands/__init__.py,sha256=5u_6EwdqYczIAgJfCwRSyQAYFEqh2ZuHHT57g9g7sdI,808
|
|
@@ -33,9 +33,9 @@ anemoi/utils/remote/s3.py,sha256=spQ8l0rwQjLZh9dZu5cOsYIvNwKihQfCJ6YsFYegeqI,173
|
|
|
33
33
|
anemoi/utils/remote/ssh.py,sha256=xNtsawh8okytCKRehkRCVExbHZj-CRUQNormEHglfuw,8088
|
|
34
34
|
anemoi/utils/schemas/__init__.py,sha256=nkinKlsPLPXEjfTYQT1mpKC4cvs-14w_zBkDRxakwxw,698
|
|
35
35
|
anemoi/utils/schemas/errors.py,sha256=lgOXzVTYzAE0qWQf3OZ42vCWixv8lilSqLLhzARBmvI,1831
|
|
36
|
-
anemoi_utils-0.4.
|
|
37
|
-
anemoi_utils-0.4.
|
|
38
|
-
anemoi_utils-0.4.
|
|
39
|
-
anemoi_utils-0.4.
|
|
40
|
-
anemoi_utils-0.4.
|
|
41
|
-
anemoi_utils-0.4.
|
|
36
|
+
anemoi_utils-0.4.22.dist-info/licenses/LICENSE,sha256=8HznKF1Vi2IvfLsKNE5A2iVyiri3pRjRPvPC9kxs6qk,11354
|
|
37
|
+
anemoi_utils-0.4.22.dist-info/METADATA,sha256=DOdoppZLABKmpmK5DAgYtEl5BoKs7zMkWmquG6qFfgo,15439
|
|
38
|
+
anemoi_utils-0.4.22.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
39
|
+
anemoi_utils-0.4.22.dist-info/entry_points.txt,sha256=LENOkn88xzFQo-V59AKoA_F_cfYQTJYtrNTtf37YgHY,60
|
|
40
|
+
anemoi_utils-0.4.22.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
|
|
41
|
+
anemoi_utils-0.4.22.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|