anemoi-utils 0.4.16__tar.gz → 0.4.17__tar.gz

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.

Files changed (98) hide show
  1. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.gitignore +2 -3
  2. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.pre-commit-config.yaml +6 -6
  3. anemoi_utils-0.4.17/.release-please-manifest.json +3 -0
  4. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/CHANGELOG.md +20 -0
  5. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/PKG-INFO +1 -1
  6. anemoi_utils-0.4.17/docs/_static/logo.png +0 -0
  7. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/conf.py +11 -0
  8. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/index.rst +4 -3
  9. anemoi_utils-0.4.17/docs/modules/testing.rst +8 -0
  10. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/_version.py +2 -2
  11. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/config.py +18 -0
  12. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/provenance.py +2 -2
  13. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/registry.py +4 -0
  14. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/remote/__init__.py +1 -1
  15. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi_utils.egg-info/PKG-INFO +1 -1
  16. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi_utils.egg-info/SOURCES.txt +1 -0
  17. anemoi_utils-0.4.16/.release-please-manifest.json +0 -3
  18. anemoi_utils-0.4.16/docs/_static/logo.png +0 -0
  19. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.gitattributes +0 -0
  20. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/CODEOWNERS +0 -0
  21. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/ci-hpc-config.yml +0 -0
  22. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/dependabot.yml +0 -0
  23. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/labeler.yml +0 -0
  24. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/pull_request_template.md +0 -0
  25. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/release.yml +0 -0
  26. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/workflows/downstream-ci-hpc.yml +0 -0
  27. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/workflows/pr-conventional-commit.yml +0 -0
  28. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/workflows/pr-label-conventional-commits.yml +0 -0
  29. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/workflows/pr-label-file-based.yml +0 -0
  30. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/workflows/pr-label-public.yml +0 -0
  31. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/workflows/python-publish.yml +0 -0
  32. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/workflows/python-pull-request.yml +0 -0
  33. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/workflows/readthedocs-pr-update.yml +0 -0
  34. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.github/workflows/release-please.yml +0 -0
  35. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.readthedocs.yaml +0 -0
  36. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/.release-please-config.json +0 -0
  37. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/CONTRIBUTORS.md +0 -0
  38. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/LICENSE +0 -0
  39. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/README.md +0 -0
  40. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/Makefile +0 -0
  41. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/_static/style.css +0 -0
  42. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/_templates/.gitkeep +0 -0
  43. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/installing.rst +0 -0
  44. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/modules/checkpoints.rst +0 -0
  45. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/modules/config.rst +0 -0
  46. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/modules/dates.rst +0 -0
  47. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/modules/grib.rst +0 -0
  48. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/modules/humanize.rst +0 -0
  49. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/modules/provenance.rst +0 -0
  50. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/modules/s3.rst +0 -0
  51. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/docs/modules/text.rst +0 -0
  52. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/pyproject.toml +0 -0
  53. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/setup.cfg +0 -0
  54. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/__init__.py +0 -0
  55. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/__main__.py +0 -0
  56. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/caching.py +0 -0
  57. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/checkpoints.py +0 -0
  58. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/cli.py +0 -0
  59. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/commands/__init__.py +0 -0
  60. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/commands/config.py +0 -0
  61. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/commands/requests.py +0 -0
  62. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/compatibility.py +0 -0
  63. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/dates.py +0 -0
  64. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/devtools.py +0 -0
  65. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/grib.py +0 -0
  66. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/grids.py +0 -0
  67. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/hindcasts.py +0 -0
  68. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/humanize.py +0 -0
  69. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/logs.py +0 -0
  70. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/mars/__init__.py +0 -0
  71. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/mars/mars.yaml +0 -0
  72. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/mars/requests.py +0 -0
  73. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/remote/s3.py +0 -0
  74. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/remote/ssh.py +0 -0
  75. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/s3.py +0 -0
  76. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/sanitise.py +0 -0
  77. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/sanitize.py +0 -0
  78. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/testing.py +0 -0
  79. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/text.py +0 -0
  80. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi/utils/timer.py +0 -0
  81. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi_utils.egg-info/dependency_links.txt +0 -0
  82. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi_utils.egg-info/entry_points.txt +0 -0
  83. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi_utils.egg-info/requires.txt +0 -0
  84. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/src/anemoi_utils.egg-info/top_level.txt +0 -0
  85. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test-transfer-data/directory/b/c/x +0 -0
  86. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test-transfer-data/directory/b/y +0 -0
  87. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test-transfer-data/directory/exotic filename ;^/"'[=.,#]()/303/252/303/274/303/247/303/262/342/234/205.txt" +0 -0
  88. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test-transfer-data/directory/z +0 -0
  89. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test-transfer-data/file +0 -0
  90. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test_caching.py +0 -0
  91. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test_compatibility.py +0 -0
  92. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test_dates.py +0 -0
  93. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test_frequency.py +0 -0
  94. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test_grids.py +0 -0
  95. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test_provenance.py +0 -0
  96. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test_remote.py +0 -0
  97. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test_sanetise.py +0 -0
  98. {anemoi_utils-0.4.16 → anemoi_utils-0.4.17}/tests/test_utils.py +0 -0
@@ -42,6 +42,7 @@ cover/
42
42
 
43
43
  # Documentation
44
44
  docs/_build/
45
+ docs/_api/
45
46
  /site
46
47
  *.mo
47
48
  *.pot
@@ -119,7 +120,7 @@ tmp/
119
120
  temp/
120
121
  logs/
121
122
  _dev/
122
- outputs/
123
+ outputs
123
124
  *tmp_data/
124
125
 
125
126
  # Project specific
@@ -130,9 +131,7 @@ bar
130
131
  ~$images.pptx
131
132
  test.py
132
133
  test.ipynb
133
- cutout.png
134
134
  _version.py
135
135
  *.to_upload
136
136
  tempCodeRunnerFile.python
137
137
  Untitled-*.py
138
- .*cache/
@@ -27,12 +27,12 @@ repos:
27
27
  - id: python-check-blanket-noqa # Check for # noqa: all
28
28
  - id: python-no-log-warn # Check for log.warn
29
29
  - repo: https://github.com/psf/black-pre-commit-mirror
30
- rev: 24.10.0
30
+ rev: 25.1.0
31
31
  hooks:
32
32
  - id: black
33
33
  args: [--line-length=120]
34
34
  - repo: https://github.com/pycqa/isort
35
- rev: 5.13.2
35
+ rev: 6.0.1
36
36
  hooks:
37
37
  - id: isort
38
38
  args:
@@ -40,7 +40,7 @@ repos:
40
40
  - --force-single-line-imports
41
41
  - --profile black
42
42
  - repo: https://github.com/astral-sh/ruff-pre-commit
43
- rev: v0.8.6
43
+ rev: v0.9.9
44
44
  hooks:
45
45
  - id: ruff
46
46
  args:
@@ -60,16 +60,16 @@ repos:
60
60
  - id: rstfmt
61
61
  exclude: '(cli|schemas)/.*' # Because we use argparse and pydantic sphinx directives
62
62
  - repo: https://github.com/b8raoult/pre-commit-docconvert
63
- rev: "0.1.4"
63
+ rev: "0.1.5"
64
64
  hooks:
65
65
  - id: docconvert
66
66
  args: ["numpy"]
67
67
  - repo: https://github.com/tox-dev/pyproject-fmt
68
- rev: "v2.5.0"
68
+ rev: "v2.5.1"
69
69
  hooks:
70
70
  - id: pyproject-fmt
71
71
  - repo: https://github.com/jshwi/docsig # Check docstrings against function sig
72
- rev: v0.66.1
72
+ rev: v0.69.1
73
73
  hooks:
74
74
  - id: docsig
75
75
  args:
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.4.17"
3
+ }
@@ -8,6 +8,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
  Please add your functional changes to the appropriate section in the PR.
9
9
  Keep it human-readable, your future self will thank you!
10
10
 
11
+ ## [0.4.17](https://github.com/ecmwf/anemoi-utils/compare/0.4.16...0.4.17) (2025-03-27)
12
+
13
+
14
+ ### Features
15
+
16
+ * add generic env variables to override anemoi user config ([#128](https://github.com/ecmwf/anemoi-utils/issues/128)) ([fdc7248](https://github.com/ecmwf/anemoi-utils/commit/fdc72485616a0c092356a9ffa4cdca838a0c1a9d))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * Iterate over copy of sys.modules. ([#127](https://github.com/ecmwf/anemoi-utils/issues/127)) ([7b0e7d0](https://github.com/ecmwf/anemoi-utils/commit/7b0e7d08264f7eb4c92fdcd744ff8c46eac82fb7))
22
+ * plugin name on error ([#120](https://github.com/ecmwf/anemoi-utils/issues/120)) ([a747f63](https://github.com/ecmwf/anemoi-utils/commit/a747f63d74bf1b108d913694915df59ffc4640c1))
23
+
24
+
25
+ ### Documentation
26
+
27
+ * add links to GitHub ([#123](https://github.com/ecmwf/anemoi-utils/issues/123)) ([cfe1ea2](https://github.com/ecmwf/anemoi-utils/commit/cfe1ea281e03a56b9a02108b6787c6c05b9518b0))
28
+ * Docathon ([#121](https://github.com/ecmwf/anemoi-utils/issues/121)) ([e1c9292](https://github.com/ecmwf/anemoi-utils/commit/e1c9292d65b1ffc8c9ce8eed41c7ffbe81f865a3))
29
+ * fix comment ([#125](https://github.com/ecmwf/anemoi-utils/issues/125)) ([ad3ed12](https://github.com/ecmwf/anemoi-utils/commit/ad3ed126f9a507dde7ce19064f1d32dae2cee6a3))
30
+
11
31
  ## [0.4.16](https://github.com/ecmwf/anemoi-utils/compare/0.4.15...0.4.16) (2025-03-22)
12
32
 
13
33
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anemoi-utils
3
- Version: 0.4.16
3
+ Version: 0.4.17
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
@@ -105,6 +105,10 @@ intersphinx_mapping = {
105
105
  "https://anemoi-transform.readthedocs.io/en/latest/",
106
106
  ("../../anemoi-transform/docs/_build/html/objects.inv", None),
107
107
  ),
108
+ "anemoi-plugins": (
109
+ "https://anemoi-plugins.readthedocs.io/en/latest/",
110
+ ("../../anemoi-plugins/docs/_build/html/objects.inv", None),
111
+ ),
108
112
  }
109
113
 
110
114
  # -- Options for HTML output -------------------------------------------------
@@ -124,3 +128,10 @@ html_css_files = ["style.css"]
124
128
  todo_include_todos = not read_the_docs_build
125
129
 
126
130
  autodoc_member_order = "bysource" # Keep file order
131
+
132
+ html_context = {
133
+ "display_github": True,
134
+ "github_user": "ecmwf",
135
+ "github_repo": "anemoi-utils",
136
+ "github_version": "main/docs/",
137
+ }
@@ -40,9 +40,9 @@ of the *Anemoi* packages.
40
40
 
41
41
  modules/*
42
42
 
43
- *****************
44
- Anemoi packages
45
- *****************
43
+ ***********************
44
+ Other Anemoi packages
45
+ ***********************
46
46
 
47
47
  - :ref:`anemoi-utils <anemoi-utils:index-page>`
48
48
  - :ref:`anemoi-transform <anemoi-transform:index-page>`
@@ -52,6 +52,7 @@ of the *Anemoi* packages.
52
52
  - :ref:`anemoi-training <anemoi-training:index-page>`
53
53
  - :ref:`anemoi-inference <anemoi-inference:index-page>`
54
54
  - :ref:`anemoi-registry <anemoi-registry:index-page>`
55
+ - :ref:`anemoi-plugins <anemoi-plugins:index-page>`
55
56
 
56
57
  *********
57
58
  License
@@ -0,0 +1,8 @@
1
+ #########
2
+ testing
3
+ #########
4
+
5
+ .. automodule:: anemoi.utils.testing
6
+ :members:
7
+ :no-undoc-members:
8
+ :show-inheritance:
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.4.16'
21
- __version_tuple__ = version_tuple = (0, 4, 16)
20
+ __version__ = version = '0.4.17'
21
+ __version_tuple__ = version_tuple = (0, 4, 17)
@@ -459,6 +459,24 @@ def _load_config(
459
459
  secret_config = _load_config(secret_name)
460
460
  _merge_dicts(config, secret_config)
461
461
 
462
+ for env, value in os.environ.items():
463
+
464
+ if not env.startswith("ANEMOI_CONFIG_"):
465
+ continue
466
+ rest = env[len("ANEMOI_CONFIG_") :]
467
+
468
+ package = rest.split("_")[0]
469
+ sub = rest[len(package) + 1 :]
470
+
471
+ package = package.lower()
472
+ sub = sub.lower()
473
+
474
+ LOG.info(f"Using environment variable {env} to override the anemoi config key '{package}.{sub}'")
475
+
476
+ if package not in config:
477
+ config[package] = {}
478
+ config[package][sub] = value
479
+
462
480
  CONFIG[key] = DotDict(config)
463
481
  return CONFIG[key]
464
482
 
@@ -199,12 +199,12 @@ def _module_versions(full: bool) -> Tuple[Dict[str, Any], set]:
199
199
 
200
200
  versions = {}
201
201
  namespaces = set()
202
- for k, v in sorted(sys.modules.items()):
202
+ for k, v in sorted(sys.modules.copy().items()):
203
203
  if "." not in k:
204
204
  version(versions, k, v, roots, namespaces, paths, full)
205
205
 
206
206
  # Catter for modules like "earthkit.meteo"
207
- for k, v in sorted(sys.modules.items()):
207
+ for k, v in sorted(sys.modules.copy().items()):
208
208
  bits = k.split(".")
209
209
  if len(bits) == 2 and bits[0] in namespaces:
210
210
  version(versions, k, v, roots, namespaces, paths, full)
@@ -162,12 +162,16 @@ class Registry:
162
162
  file : str
163
163
  The file to load.
164
164
  """
165
+
165
166
  name, _ = os.path.splitext(file)
167
+
166
168
  try:
167
169
  importlib.import_module(f".{name}", package=self.package)
168
170
  except Exception as e:
169
171
  if DEBUG_ANEMOI_REGISTRY:
170
172
  raise
173
+
174
+ name = name.replace("_", "-")
171
175
  self.__registered[name] = Error(e)
172
176
 
173
177
  def is_registered(self, name: str) -> bool:
@@ -627,7 +627,7 @@ def _find_transfer_class(source: str, target: str) -> type:
627
627
  raise TransferMethodNotImplementedError(f"Transfer from {source} to {target} is not implemented")
628
628
 
629
629
 
630
- # this is the public API
630
+ # This function is the main entry point for the transfer mechanism for the other anemoi packages
631
631
  def transfer(
632
632
  source, target, *, overwrite=False, resume=False, verbosity=1, progress=None, threads=1, temporary_target=False
633
633
  ) -> Loader:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anemoi-utils
3
- Version: 0.4.16
3
+ Version: 0.4.17
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
@@ -38,6 +38,7 @@ docs/modules/grib.rst
38
38
  docs/modules/humanize.rst
39
39
  docs/modules/provenance.rst
40
40
  docs/modules/s3.rst
41
+ docs/modules/testing.rst
41
42
  docs/modules/text.rst
42
43
  src/anemoi/utils/__init__.py
43
44
  src/anemoi/utils/__main__.py
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.4.16"
3
- }
Binary file
File without changes
File without changes
File without changes