anemoi-utils 0.4.11__py3-none-any.whl → 0.4.12__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 CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.4.11'
16
- __version_tuple__ = version_tuple = (0, 4, 11)
15
+ __version__ = version = '0.4.12'
16
+ __version_tuple__ = version_tuple = (0, 4, 12)
@@ -6,6 +6,7 @@
6
6
  # nor does it submit to any jurisdiction.
7
7
 
8
8
  import json
9
+ import sys
9
10
 
10
11
  from anemoi.utils.mars.requests import print_request
11
12
 
@@ -22,8 +23,11 @@ class Requests(Command):
22
23
  command_parser.add_argument("--only-one-field", action="store_true")
23
24
 
24
25
  def run(self, args):
25
- with open(args.input) as f:
26
- requests = json.load(f)
26
+ if args.input == "-":
27
+ requests = json.load(sys.stdin)
28
+ else:
29
+ with open(args.input) as f:
30
+ requests = json.load(f)
27
31
 
28
32
  if args.only_one_field:
29
33
  for r in requests:
anemoi/utils/dates.py CHANGED
@@ -155,12 +155,19 @@ def as_timedelta(frequency) -> datetime.timedelta:
155
155
  unit = {"h": "hours", "d": "days", "s": "seconds", "m": "minutes"}[unit]
156
156
  return datetime.timedelta(**{unit: v})
157
157
 
158
- m = frequency.split(":")
159
- if len(m) == 2:
160
- return datetime.timedelta(hours=int(m[0]), minutes=int(m[1]))
161
-
162
- if len(m) == 3:
163
- return datetime.timedelta(hours=int(m[0]), minutes=int(m[1]), seconds=int(m[2]))
158
+ if re.match(r"^\d+:\d+(:\d+)?$", frequency):
159
+ m = frequency.split(":")
160
+ if len(m) == 2:
161
+ return datetime.timedelta(hours=int(m[0]), minutes=int(m[1]))
162
+
163
+ if len(m) == 3:
164
+ return datetime.timedelta(hours=int(m[0]), minutes=int(m[1]), seconds=int(m[2]))
165
+
166
+ if re.match(r"^\d+ days?, \d+:\d+:\d+$", frequency):
167
+ m = frequency.split(", ")
168
+ days = int(m[0].split()[0])
169
+ hms = m[1].split(":")
170
+ return datetime.timedelta(days=days, hours=int(hms[0]), minutes=int(hms[1]), seconds=int(hms[2]))
164
171
 
165
172
  # ISO8601
166
173
  try:
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [yyyy] [name of copyright owner]
189
+ Copyright 2024-2025 Anemoi Contributors
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: anemoi-utils
3
- Version: 0.4.11
3
+ Version: 0.4.12
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
@@ -191,7 +191,7 @@ License: Apache License
191
191
  same "printed page" as the copyright notice for easier
192
192
  identification within third-party archives.
193
193
 
194
- Copyright [yyyy] [name of copyright owner]
194
+ Copyright 2024-2025 Anemoi Contributors
195
195
 
196
196
  Licensed under the Apache License, Version 2.0 (the "License");
197
197
  you may not use this file except in compliance with the License.
@@ -1,12 +1,12 @@
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=XaB1qSGFgL3t6k654LeY_W4E2hovj_ZK7X1yDkanD5E,413
3
+ anemoi/utils/_version.py,sha256=sg-lGJqAzZSE-Cr-6X2XM20x4P3h_gsFXHtA5vFf4qs,413
4
4
  anemoi/utils/caching.py,sha256=UkHQOKcBoB6xni83qgTEGfkyam7iqu1YiuBLZQIn9RM,3208
5
5
  anemoi/utils/checkpoints.py,sha256=q8QqKlZ6qChjzEfq7KM1gVXuyqgsVRGIb4dJFtkGk58,7774
6
6
  anemoi/utils/cli.py,sha256=rmMP60VY3em99rQP6TCrKibMngWwVe5h_0GDcf16c5U,4117
7
7
  anemoi/utils/compatibility.py,sha256=0_nIcbdQbNMrS6AkqrBgJGJlSJXW8R23ncaZaDwdJ4c,2190
8
8
  anemoi/utils/config.py,sha256=ADCksBl6qrJpU9eebVebwkthNanzgCOxBgzlqCUTwbg,10962
9
- anemoi/utils/dates.py,sha256=wwYD5_QI7EWY_jhpENNYtL5O7fjwYkzmqHkNoayvmrY,12452
9
+ anemoi/utils/dates.py,sha256=brsBEje1w8sJ1RbVJl-_nxbSUYsn1h0zaF6EY54zpDs,12785
10
10
  anemoi/utils/devtools.py,sha256=Mns5vU9o2HrO4zS1e0-W4gBIhk8xHrhcB7wLR_q6OiA,2172
11
11
  anemoi/utils/grib.py,sha256=zBICyOsYtR_9px1C5UDT6wL_D6kiIhUi_00kjFmas5c,3047
12
12
  anemoi/utils/grids.py,sha256=tqhH8ZiRS9Re7xQZHVKtl8bBtqH_kDVOGHfDTxu3RuI,2708
@@ -22,16 +22,16 @@ anemoi/utils/text.py,sha256=Xfr_3wvsjg7m-BwvdJVz1bV6f5KNMnGIIFRtXaiMfbs,10496
22
22
  anemoi/utils/timer.py,sha256=Twnr3GZu-n0WzgboELRKJWs87qyDYqy6Dwr9cQ_JG18,1803
23
23
  anemoi/utils/commands/__init__.py,sha256=O5W3yHZywRoAqmRUioAr3zMCh0hGVV18wZYGvc00ioM,698
24
24
  anemoi/utils/commands/config.py,sha256=zt4PFATYJ-zs0C5mpUlrQ4Fj5m1kM3CcsszUP1VBbzA,816
25
- anemoi/utils/commands/requests.py,sha256=7joRYnJUzJh5O8Pqkqa-s9M9woHy-Z86czp00uCZXGc,1448
25
+ anemoi/utils/commands/requests.py,sha256=NZPtQ2-PEtj7w5nNzTq5Tvj5axtsVAeuTUOKIQt-Faw,1555
26
26
  anemoi/utils/mars/__init__.py,sha256=kvbu-gSaYI9jSNEzfQltrtHPVIameYGoLjOJKwI7x_U,1723
27
27
  anemoi/utils/mars/mars.yaml,sha256=R0dujp75lLA4wCWhPeOQnzJ45WZAYLT8gpx509cBFlc,66
28
28
  anemoi/utils/mars/requests.py,sha256=0khe_mbq4GNueR_B8fGPTBoWHtCfjQvtoKXOSVm6La4,759
29
29
  anemoi/utils/remote/__init__.py,sha256=-_AA1xm9GpagW5zP0PGpz-3SRKEUjw_AGSNd_bhuh7g,11639
30
30
  anemoi/utils/remote/s3.py,sha256=hykbVlh1_aFI00FWjgm_FWIMfVCTFiQf_cq8_gAo31s,11976
31
31
  anemoi/utils/remote/ssh.py,sha256=3lqFpY9CEor_DvIK9ZxSmj3rND-366Sm9R3Vw61sWSs,4695
32
- anemoi_utils-0.4.11.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
33
- anemoi_utils-0.4.11.dist-info/METADATA,sha256=YYQUqE12vxm1wx4kNf-ey148QJGs0Ik823cWX8tufRM,15258
34
- anemoi_utils-0.4.11.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
35
- anemoi_utils-0.4.11.dist-info/entry_points.txt,sha256=LENOkn88xzFQo-V59AKoA_F_cfYQTJYtrNTtf37YgHY,60
36
- anemoi_utils-0.4.11.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
37
- anemoi_utils-0.4.11.dist-info/RECORD,,
32
+ anemoi_utils-0.4.12.dist-info/LICENSE,sha256=8HznKF1Vi2IvfLsKNE5A2iVyiri3pRjRPvPC9kxs6qk,11354
33
+ anemoi_utils-0.4.12.dist-info/METADATA,sha256=-9E31lmUv9bhpu_e4ZlLRgWtZdrRdeAo5KFzfJg42HU,15255
34
+ anemoi_utils-0.4.12.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
35
+ anemoi_utils-0.4.12.dist-info/entry_points.txt,sha256=LENOkn88xzFQo-V59AKoA_F_cfYQTJYtrNTtf37YgHY,60
36
+ anemoi_utils-0.4.12.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
37
+ anemoi_utils-0.4.12.dist-info/RECORD,,