anemoi-utils 0.3.17__py3-none-any.whl → 0.4.0__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/provenance.py +34 -0
- anemoi/utils/{sanetize.py → sanitize.py} +2 -2
- {anemoi_utils-0.3.17.dist-info → anemoi_utils-0.4.0.dist-info}/METADATA +2 -1
- {anemoi_utils-0.3.17.dist-info → anemoi_utils-0.4.0.dist-info}/RECORD +9 -9
- {anemoi_utils-0.3.17.dist-info → anemoi_utils-0.4.0.dist-info}/LICENSE +0 -0
- {anemoi_utils-0.3.17.dist-info → anemoi_utils-0.4.0.dist-info}/WHEEL +0 -0
- {anemoi_utils-0.3.17.dist-info → anemoi_utils-0.4.0.dist-info}/entry_points.txt +0 -0
- {anemoi_utils-0.3.17.dist-info → anemoi_utils-0.4.0.dist-info}/top_level.txt +0 -0
anemoi/utils/_version.py
CHANGED
anemoi/utils/provenance.py
CHANGED
|
@@ -21,6 +21,7 @@ import os
|
|
|
21
21
|
import subprocess
|
|
22
22
|
import sys
|
|
23
23
|
import sysconfig
|
|
24
|
+
from functools import cache
|
|
24
25
|
|
|
25
26
|
LOG = logging.getLogger(__name__)
|
|
26
27
|
|
|
@@ -143,6 +144,37 @@ def _module_versions(full):
|
|
|
143
144
|
return versions, paths
|
|
144
145
|
|
|
145
146
|
|
|
147
|
+
@cache
|
|
148
|
+
def package_distributions() -> dict[str, list[str]]:
|
|
149
|
+
# Takes a significant amount of time to run
|
|
150
|
+
# so cache the result
|
|
151
|
+
from importlib import metadata
|
|
152
|
+
|
|
153
|
+
# For python 3.9 support
|
|
154
|
+
if not hasattr(metadata, "packages_distributions"):
|
|
155
|
+
import importlib_metadata as metadata
|
|
156
|
+
|
|
157
|
+
return metadata.packages_distributions()
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def import_name_to_distribution_name(packages: list):
|
|
161
|
+
distribution_names = {}
|
|
162
|
+
package_distribution_names = package_distributions()
|
|
163
|
+
|
|
164
|
+
for package in [p for p in packages if p in package_distribution_names]:
|
|
165
|
+
distr_name = package_distribution_names[package]
|
|
166
|
+
if isinstance(distr_name, list):
|
|
167
|
+
if len(distr_name) > 1:
|
|
168
|
+
# Multiple distributions for the same package, i.e. anemoi-graphs, anemoi-utils, ..., Don't know how to handle this
|
|
169
|
+
continue
|
|
170
|
+
distr_name = distr_name[0]
|
|
171
|
+
|
|
172
|
+
if distr_name != package:
|
|
173
|
+
distribution_names[package] = distr_name
|
|
174
|
+
|
|
175
|
+
return distribution_names
|
|
176
|
+
|
|
177
|
+
|
|
146
178
|
def module_versions(full):
|
|
147
179
|
versions, paths = _module_versions(full)
|
|
148
180
|
git_versions = _check_for_git(paths, full)
|
|
@@ -339,6 +371,7 @@ def gather_provenance_info(assets=[], full=False) -> dict:
|
|
|
339
371
|
time=datetime.datetime.utcnow().isoformat(),
|
|
340
372
|
python=f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}",
|
|
341
373
|
module_versions=versions,
|
|
374
|
+
distribution_names=import_name_to_distribution_name(versions.keys()),
|
|
342
375
|
git_versions=git_versions,
|
|
343
376
|
)
|
|
344
377
|
else:
|
|
@@ -349,6 +382,7 @@ def gather_provenance_info(assets=[], full=False) -> dict:
|
|
|
349
382
|
python_path=sys.path,
|
|
350
383
|
config_paths=sysconfig.get_paths(),
|
|
351
384
|
module_versions=versions,
|
|
385
|
+
distribution_names=import_name_to_distribution_name(versions.keys()),
|
|
352
386
|
git_versions=git_versions,
|
|
353
387
|
platform=platform_info(),
|
|
354
388
|
gpus=gpu_info(),
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
# granted to it by virtue of its status as an intergovernmental organisation
|
|
6
6
|
# nor does it submit to any jurisdiction.
|
|
7
7
|
|
|
8
|
-
from .
|
|
8
|
+
from .sanitise import sanitise as sanitize
|
|
9
9
|
|
|
10
|
-
__all__ = ["
|
|
10
|
+
__all__ = ["sanitize"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: anemoi-utils
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
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
|
|
@@ -227,6 +227,7 @@ Requires-Dist: aniso8601
|
|
|
227
227
|
Requires-Dist: pyyaml
|
|
228
228
|
Requires-Dist: tomli
|
|
229
229
|
Requires-Dist: tqdm
|
|
230
|
+
Requires-Dist: importlib-metadata ; python_version < "3.10"
|
|
230
231
|
Provides-Extra: all
|
|
231
232
|
Requires-Dist: anemoi-utils[grib,provenance,text] ; extra == 'all'
|
|
232
233
|
Provides-Extra: dev
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
anemoi/utils/__init__.py,sha256=zZZpbKIoGWwdCOuo6YSruLR7C0GzvzI1Wzhyqaa0K7M,456
|
|
2
2
|
anemoi/utils/__main__.py,sha256=cLA2PidDTOUHaDGzd0_E5iioKYNe-PSTv567Y2fuwQk,723
|
|
3
|
-
anemoi/utils/_version.py,sha256=
|
|
3
|
+
anemoi/utils/_version.py,sha256=j90u3VVU4UrJf1fgMUhaZarHK_Do2XGYXr-vZvOFzVo,411
|
|
4
4
|
anemoi/utils/caching.py,sha256=bCOjP1jcDbwi7BID3XaR9BbkD1k3UipkP74NbgJuEFA,1974
|
|
5
5
|
anemoi/utils/checkpoints.py,sha256=qWtqkQvMDlPIcfqz_GmOyUf0mmHZ6QEInpvgSJYIQjY,5275
|
|
6
6
|
anemoi/utils/cli.py,sha256=9TrBXkDjBsos2d0z6wdFDRZIjft3HWGutSgAFi0zCK4,3712
|
|
@@ -9,19 +9,19 @@ anemoi/utils/dates.py,sha256=dgGbTqpGOpYDGgWfXL_69HutXTCHDFI2DhvG-9I9WQI,12341
|
|
|
9
9
|
anemoi/utils/grib.py,sha256=mrk1drJm2jaPYERQX45QfX2MP4eUqRv0J-Y8IRSRTRE,3073
|
|
10
10
|
anemoi/utils/hindcasts.py,sha256=X8k-81ltmkTDHdviY0SJgvMg7XDu07xoc5ALlUxyPoo,1453
|
|
11
11
|
anemoi/utils/humanize.py,sha256=-xQraQWMLwNaLQAWfPi4K05qieQLgkiyYmV6bfhr10U,16611
|
|
12
|
-
anemoi/utils/provenance.py,sha256=
|
|
12
|
+
anemoi/utils/provenance.py,sha256=iSq4Y5eoWK_SNBMpMfInOB3shQlMZqE8iMBp-LgKtJk,10882
|
|
13
13
|
anemoi/utils/s3.py,sha256=MuY-PrHpt6iKM2RK7v74YoCdqvVJ8UjBDJh0wxUR9Co,18720
|
|
14
|
-
anemoi/utils/sanetize.py,sha256=cQ4r52bQuegMqsEzCN2flXYk_0y_amwpEhMx2-G78j4,488
|
|
15
14
|
anemoi/utils/sanitise.py,sha256=VKIUiwm0EHPdkFUR6FkAxe94933yQx2obQtN6YROH5M,2862
|
|
15
|
+
anemoi/utils/sanitize.py,sha256=6HJrfCMnrmH5lfxydcBc-AjxkmkFXdCc1wotzm9NBCw,488
|
|
16
16
|
anemoi/utils/text.py,sha256=WvxkRlPpmK7HLOpWZmyqPQG29GMF8IFaCJp7frfIWNI,10436
|
|
17
17
|
anemoi/utils/timer.py,sha256=EQcucuwUaGeSpt2S1APJlwSOu6kC47MK9f4h-r8c_AY,990
|
|
18
18
|
anemoi/utils/commands/__init__.py,sha256=qAybFZPBBQs0dyx7dZ3X5JsLpE90pwrqt1vSV7cqEIw,706
|
|
19
19
|
anemoi/utils/commands/config.py,sha256=KEffXZh0ZQfn8t6LXresfd94kDY0gEyulx9Wto5ttW0,824
|
|
20
20
|
anemoi/utils/mars/__init__.py,sha256=RAeY8gJ7ZvsPlcIvrQ4fy9xVHs3SphTAPw_XJDtNIKo,1750
|
|
21
21
|
anemoi/utils/mars/mars.yaml,sha256=R0dujp75lLA4wCWhPeOQnzJ45WZAYLT8gpx509cBFlc,66
|
|
22
|
-
anemoi_utils-0.
|
|
23
|
-
anemoi_utils-0.
|
|
24
|
-
anemoi_utils-0.
|
|
25
|
-
anemoi_utils-0.
|
|
26
|
-
anemoi_utils-0.
|
|
27
|
-
anemoi_utils-0.
|
|
22
|
+
anemoi_utils-0.4.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
23
|
+
anemoi_utils-0.4.0.dist-info/METADATA,sha256=k5BeXc7ZFltIC92FqulfU0PnQ0wY3OwVmyHyQKXjj6g,15114
|
|
24
|
+
anemoi_utils-0.4.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
25
|
+
anemoi_utils-0.4.0.dist-info/entry_points.txt,sha256=LENOkn88xzFQo-V59AKoA_F_cfYQTJYtrNTtf37YgHY,60
|
|
26
|
+
anemoi_utils-0.4.0.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
|
|
27
|
+
anemoi_utils-0.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|