anemoi-utils 0.3.17__py3-none-any.whl → 0.3.18__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.3.17'
16
- __version_tuple__ = version_tuple = (0, 3, 17)
15
+ __version__ = version = '0.3.18'
16
+ __version_tuple__ = version_tuple = (0, 3, 18)
@@ -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,33 @@ def _module_versions(full):
143
144
  return versions, paths
144
145
 
145
146
 
147
+ @cache
148
+ def package_distributions():
149
+ # Takes a significant amount of time to run
150
+ # so cache the result
151
+ from importlib import metadata
152
+
153
+ return metadata.packages_distributions()
154
+
155
+
156
+ def import_name_to_distribution_name(packages: list):
157
+ distribution_names = {}
158
+ package_distribution_names = package_distributions()
159
+
160
+ for package in [p for p in packages if p in package_distribution_names]:
161
+ distr_name = package_distribution_names[package]
162
+ if isinstance(distr_name, list):
163
+ if len(distr_name) > 1:
164
+ # Multiple distributions for the same package, i.e. anemoi-graphs, anemoi-utils, ..., Don't know how to handle this
165
+ continue
166
+ distr_name = distr_name[0]
167
+
168
+ if distr_name != package:
169
+ distribution_names[package] = distr_name
170
+
171
+ return distribution_names
172
+
173
+
146
174
  def module_versions(full):
147
175
  versions, paths = _module_versions(full)
148
176
  git_versions = _check_for_git(paths, full)
@@ -339,6 +367,7 @@ def gather_provenance_info(assets=[], full=False) -> dict:
339
367
  time=datetime.datetime.utcnow().isoformat(),
340
368
  python=f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}",
341
369
  module_versions=versions,
370
+ distribution_names=import_name_to_distribution_name(versions.keys()),
342
371
  git_versions=git_versions,
343
372
  )
344
373
  else:
@@ -349,6 +378,7 @@ def gather_provenance_info(assets=[], full=False) -> dict:
349
378
  python_path=sys.path,
350
379
  config_paths=sysconfig.get_paths(),
351
380
  module_versions=versions,
381
+ distribution_names=import_name_to_distribution_name(versions.keys()),
352
382
  git_versions=git_versions,
353
383
  platform=platform_info(),
354
384
  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 .sanetise import sanetise as sanetize
8
+ from .sanitise import sanitise as sanitize
9
9
 
10
- __all__ = ["sanetize"]
10
+ __all__ = ["sanitize"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: anemoi-utils
3
- Version: 0.3.17
3
+ Version: 0.3.18
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=zZZpbKIoGWwdCOuo6YSruLR7C0GzvzI1Wzhyqaa0K7M,456
2
2
  anemoi/utils/__main__.py,sha256=cLA2PidDTOUHaDGzd0_E5iioKYNe-PSTv567Y2fuwQk,723
3
- anemoi/utils/_version.py,sha256=EanR9QKHDmsyYNdsvPdG4re1cWDyd1A_td5gwFF-ouQ,413
3
+ anemoi/utils/_version.py,sha256=QAzjzlQ8v3ZqOKXdT0jblmkqebjcDj2MPKGBvc_ei_4,413
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=EtlQrubTpEGkTG2UpoRlNGGjKMDcJ-9H3j96vedGyaI,9673
12
+ anemoi/utils/provenance.py,sha256=N0JYslg7foDgkQFGDytkYZhiDMELvJHzGYynetF0rW8,10726
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.3.17.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
23
- anemoi_utils-0.3.17.dist-info/METADATA,sha256=saT-_cFT11QQw7MU-ogdaBT1U_VKl_00zHqo5QRPVF4,15055
24
- anemoi_utils-0.3.17.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
25
- anemoi_utils-0.3.17.dist-info/entry_points.txt,sha256=LENOkn88xzFQo-V59AKoA_F_cfYQTJYtrNTtf37YgHY,60
26
- anemoi_utils-0.3.17.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
27
- anemoi_utils-0.3.17.dist-info/RECORD,,
22
+ anemoi_utils-0.3.18.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
23
+ anemoi_utils-0.3.18.dist-info/METADATA,sha256=uhfZ-zuzer9SQNNPAvvs-KaqRomfEiJYlXVX1VKdbhM,15055
24
+ anemoi_utils-0.3.18.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
25
+ anemoi_utils-0.3.18.dist-info/entry_points.txt,sha256=LENOkn88xzFQo-V59AKoA_F_cfYQTJYtrNTtf37YgHY,60
26
+ anemoi_utils-0.3.18.dist-info/top_level.txt,sha256=DYn8VPs-fNwr7fNH9XIBqeXIwiYYd2E2k5-dUFFqUz0,7
27
+ anemoi_utils-0.3.18.dist-info/RECORD,,