anemoi-utils 0.4.7__py3-none-any.whl → 0.4.9__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/remote/__init__.py +6 -2
- anemoi/utils/remote/s3.py +3 -0
- anemoi/utils/remote/ssh.py +3 -2
- {anemoi_utils-0.4.7.dist-info → anemoi_utils-0.4.9.dist-info}/METADATA +1 -1
- {anemoi_utils-0.4.7.dist-info → anemoi_utils-0.4.9.dist-info}/RECORD +10 -10
- {anemoi_utils-0.4.7.dist-info → anemoi_utils-0.4.9.dist-info}/LICENSE +0 -0
- {anemoi_utils-0.4.7.dist-info → anemoi_utils-0.4.9.dist-info}/WHEEL +0 -0
- {anemoi_utils-0.4.7.dist-info → anemoi_utils-0.4.9.dist-info}/entry_points.txt +0 -0
- {anemoi_utils-0.4.7.dist-info → anemoi_utils-0.4.9.dist-info}/top_level.txt +0 -0
anemoi/utils/_version.py
CHANGED
anemoi/utils/remote/__init__.py
CHANGED
|
@@ -138,6 +138,8 @@ class BaseDownload(Loader):
|
|
|
138
138
|
raise NotImplementedError
|
|
139
139
|
|
|
140
140
|
def get_temporary_target(self, target, pattern):
|
|
141
|
+
if pattern is None:
|
|
142
|
+
return target
|
|
141
143
|
dirname, basename = os.path.split(target)
|
|
142
144
|
return pattern.format(dirname=dirname, basename=basename)
|
|
143
145
|
|
|
@@ -197,15 +199,17 @@ class Transfer:
|
|
|
197
199
|
):
|
|
198
200
|
if target == ".":
|
|
199
201
|
target = os.path.basename(source)
|
|
202
|
+
if not target:
|
|
203
|
+
target = os.path.basename(os.path.dirname(source))
|
|
200
204
|
|
|
201
205
|
temporary_target = {
|
|
202
|
-
False:
|
|
206
|
+
False: None,
|
|
203
207
|
True: "{dirname}-downloading/{basename}",
|
|
204
208
|
"-tmp/*": "{dirname}-tmp/{basename}",
|
|
205
209
|
"*-tmp": "{dirname}/{basename}-tmp",
|
|
206
210
|
"tmp-*": "{dirname}/tmp-{basename}",
|
|
207
211
|
}.get(temporary_target, temporary_target)
|
|
208
|
-
assert isinstance(temporary_target, str), (type(temporary_target), temporary_target)
|
|
212
|
+
assert temporary_target is None or isinstance(temporary_target, str), (type(temporary_target), temporary_target)
|
|
209
213
|
|
|
210
214
|
self.source = source
|
|
211
215
|
self.target = target
|
anemoi/utils/remote/s3.py
CHANGED
|
@@ -192,6 +192,9 @@ class S3Download(BaseDownload):
|
|
|
192
192
|
_, _, bucket, key = source.split("/", 3)
|
|
193
193
|
s3 = s3_client(bucket)
|
|
194
194
|
|
|
195
|
+
if key.endswith("/"):
|
|
196
|
+
return 0
|
|
197
|
+
|
|
195
198
|
try:
|
|
196
199
|
response = s3.head_object(Bucket=bucket, Key=key)
|
|
197
200
|
except s3.exceptions.ClientError as e:
|
anemoi/utils/remote/ssh.py
CHANGED
|
@@ -51,8 +51,9 @@ class SshBaseUpload(BaseUpload):
|
|
|
51
51
|
|
|
52
52
|
def get_temporary_target(self, target, pattern):
|
|
53
53
|
hostname, path = self._parse_target(target)
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
if pattern is not None:
|
|
55
|
+
dirname, basename = os.path.split(path)
|
|
56
|
+
path = pattern.format(dirname=dirname, basename=basename)
|
|
56
57
|
return f"ssh://{hostname}:{path}"
|
|
57
58
|
|
|
58
59
|
def rename_target(self, target, new_target):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: anemoi-utils
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
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=0u0eIdu5-H1frf6V4KHpNmlh_SS-bJnxjzIejlsLqdw,702
|
|
2
2
|
anemoi/utils/__main__.py,sha256=5NW2A3OgTimB4ptwYThivIRSeCrvabMuvnr8mmnVx0E,715
|
|
3
|
-
anemoi/utils/_version.py,sha256=
|
|
3
|
+
anemoi/utils/_version.py,sha256=9cAnB-pA-T5W59CKIhPY3Faikq0QoZykRx3JmbTzzjE,411
|
|
4
4
|
anemoi/utils/caching.py,sha256=0cznpvaaox14NSVi-Q3PqumfuGtXo0YNcEFwDPxvMZw,1948
|
|
5
5
|
anemoi/utils/checkpoints.py,sha256=q8QqKlZ6qChjzEfq7KM1gVXuyqgsVRGIb4dJFtkGk58,7774
|
|
6
6
|
anemoi/utils/cli.py,sha256=rmMP60VY3em99rQP6TCrKibMngWwVe5h_0GDcf16c5U,4117
|
|
@@ -21,12 +21,12 @@ anemoi/utils/commands/__init__.py,sha256=O5W3yHZywRoAqmRUioAr3zMCh0hGVV18wZYGvc0
|
|
|
21
21
|
anemoi/utils/commands/config.py,sha256=zt4PFATYJ-zs0C5mpUlrQ4Fj5m1kM3CcsszUP1VBbzA,816
|
|
22
22
|
anemoi/utils/mars/__init__.py,sha256=kvbu-gSaYI9jSNEzfQltrtHPVIameYGoLjOJKwI7x_U,1723
|
|
23
23
|
anemoi/utils/mars/mars.yaml,sha256=R0dujp75lLA4wCWhPeOQnzJ45WZAYLT8gpx509cBFlc,66
|
|
24
|
-
anemoi/utils/remote/__init__.py,sha256
|
|
25
|
-
anemoi/utils/remote/s3.py,sha256=
|
|
26
|
-
anemoi/utils/remote/ssh.py,sha256=
|
|
27
|
-
anemoi_utils-0.4.
|
|
28
|
-
anemoi_utils-0.4.
|
|
29
|
-
anemoi_utils-0.4.
|
|
30
|
-
anemoi_utils-0.4.
|
|
31
|
-
anemoi_utils-0.4.
|
|
32
|
-
anemoi_utils-0.4.
|
|
24
|
+
anemoi/utils/remote/__init__.py,sha256=-_AA1xm9GpagW5zP0PGpz-3SRKEUjw_AGSNd_bhuh7g,11639
|
|
25
|
+
anemoi/utils/remote/s3.py,sha256=hykbVlh1_aFI00FWjgm_FWIMfVCTFiQf_cq8_gAo31s,11976
|
|
26
|
+
anemoi/utils/remote/ssh.py,sha256=3lqFpY9CEor_DvIK9ZxSmj3rND-366Sm9R3Vw61sWSs,4695
|
|
27
|
+
anemoi_utils-0.4.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
28
|
+
anemoi_utils-0.4.9.dist-info/METADATA,sha256=ArYQ4wg6khfNZpeSfzAbPKyRxcGAK5gnnYiiiewoVIU,15222
|
|
29
|
+
anemoi_utils-0.4.9.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
|
|
30
|
+
anemoi_utils-0.4.9.dist-info/entry_points.txt,sha256=LENOkn88xzFQo-V59AKoA_F_cfYQTJYtrNTtf37YgHY,60
|
|
31
|
+
anemoi_utils-0.4.9.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
|
|
32
|
+
anemoi_utils-0.4.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|