anemoi-utils 0.4.20__tar.gz → 0.4.21__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.
- anemoi_utils-0.4.21/.release-please-manifest.json +3 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/CHANGELOG.md +12 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/PKG-INFO +2 -1
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/pyproject.toml +2 -1
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/_version.py +2 -2
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/config.py +24 -1
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/rules.py +27 -0
- anemoi_utils-0.4.21/src/anemoi/utils/schemas/__init__.py +20 -0
- anemoi_utils-0.4.21/src/anemoi/utils/schemas/errors.py +54 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/testing.py +16 -3
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi_utils.egg-info/PKG-INFO +2 -1
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi_utils.egg-info/SOURCES.txt +2 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi_utils.egg-info/requires.txt +1 -0
- anemoi_utils-0.4.20/.release-please-manifest.json +0 -3
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.gitattributes +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/CODEOWNERS +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/ci-hpc-config.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/dependabot.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/labeler.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/pull_request_template.md +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/release.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/downstream-ci-hpc.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/pr-conventional-commit.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/pr-label-conventional-commits.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/pr-label-file-based.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/pr-label-public.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/python-publish.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/python-pull-request.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/readthedocs-pr-update.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/release-please.yml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.gitignore +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.pre-commit-config.yaml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.readthedocs.yaml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.release-please-config.json +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/CONTRIBUTORS.md +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/LICENSE +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/README.md +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/Makefile +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/_static/logo.png +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/_static/style.css +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/_templates/.gitkeep +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/_templates/apidoc/package.rst.jinja +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/conf.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/index.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/installing.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/modules/checkpoints.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/modules/config.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/modules/dates.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/modules/grib.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/modules/humanize.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/modules/provenance.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/modules/s3.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/modules/testing.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/modules/text.rst +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/docs/scripts/api_build.sh +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/setup.cfg +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/__init__.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/__main__.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/caching.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/checkpoints.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/cli.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/commands/__init__.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/commands/config.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/commands/requests.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/compatibility.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/dates.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/devtools.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/grib.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/grids.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/hindcasts.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/humanize.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/logs.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/mars/__init__.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/mars/mars.yaml +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/mars/requests.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/provenance.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/registry.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/remote/__init__.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/remote/s3.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/remote/ssh.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/s3.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/sanitise.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/sanitize.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/text.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi/utils/timer.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi_utils.egg-info/dependency_links.txt +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi_utils.egg-info/entry_points.txt +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/src/anemoi_utils.egg-info/top_level.txt +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test-transfer-data/directory/b/c/x +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test-transfer-data/directory/b/y +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test-transfer-data/directory/exotic filename ;^/"'[=.,#]()/303/252/303/274/303/247/303/262/342/234/205.txt" +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test-transfer-data/directory/z +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test-transfer-data/file +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test_caching.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test_compatibility.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test_dates.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test_frequency.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test_grids.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test_provenance.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test_remote.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test_sanetise.py +0 -0
- {anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/tests/test_utils.py +0 -0
|
@@ -8,6 +8,18 @@ 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.21](https://github.com/ecmwf/anemoi-utils/compare/0.4.20...0.4.21) (2025-04-07)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* allow temporary settings ([#143](https://github.com/ecmwf/anemoi-utils/issues/143)) ([38cefb5](https://github.com/ecmwf/anemoi-utils/commit/38cefb5c4ebd4e496d2c332e1d1d8b86d551615c))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* pydantic schemas ([#141](https://github.com/ecmwf/anemoi-utils/issues/141)) ([c30f804](https://github.com/ecmwf/anemoi-utils/commit/c30f804012a4200eee69f5fb0708d4af760cb5f7))
|
|
22
|
+
|
|
11
23
|
## [0.4.20](https://github.com/ecmwf/anemoi-utils/compare/0.4.19...0.4.20) (2025-04-04)
|
|
12
24
|
|
|
13
25
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: anemoi-utils
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.21
|
|
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
|
|
@@ -228,6 +228,7 @@ Requires-Dist: aniso8601
|
|
|
228
228
|
Requires-Dist: importlib-metadata; python_version < "3.10"
|
|
229
229
|
Requires-Dist: multiurl
|
|
230
230
|
Requires-Dist: numpy
|
|
231
|
+
Requires-Dist: pydantic>=2.9
|
|
231
232
|
Requires-Dist: python-dateutil
|
|
232
233
|
Requires-Dist: pyyaml
|
|
233
234
|
Requires-Dist: tomli; python_version < "3.11"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# (C) Copyright
|
|
1
|
+
# (C) Copyright 2025 Anemoi contributors.
|
|
2
2
|
#
|
|
3
3
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
4
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
@@ -44,6 +44,7 @@ dependencies = [
|
|
|
44
44
|
"importlib-metadata; python_version<'3.10'",
|
|
45
45
|
"multiurl",
|
|
46
46
|
"numpy",
|
|
47
|
+
"pydantic>=2.9",
|
|
47
48
|
"python-dateutil",
|
|
48
49
|
"pyyaml",
|
|
49
50
|
"tomli; python_version<'3.11'",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
from __future__ import annotations
|
|
12
12
|
|
|
13
|
+
import contextlib
|
|
13
14
|
import json
|
|
14
15
|
import logging
|
|
15
16
|
import os
|
|
@@ -239,6 +240,7 @@ CONFIG = {}
|
|
|
239
240
|
CHECKED = {}
|
|
240
241
|
CONFIG_LOCK = threading.RLock()
|
|
241
242
|
QUIET = False
|
|
243
|
+
CONFIG_PATCH = None
|
|
242
244
|
|
|
243
245
|
|
|
244
246
|
def _find(config: Union[dict, list], what: str, result: list = None) -> list:
|
|
@@ -550,7 +552,10 @@ def load_config(
|
|
|
550
552
|
"""
|
|
551
553
|
|
|
552
554
|
with CONFIG_LOCK:
|
|
553
|
-
|
|
555
|
+
config = _load_config(name, secrets, defaults)
|
|
556
|
+
if CONFIG_PATCH is not None:
|
|
557
|
+
config = CONFIG_PATCH(config)
|
|
558
|
+
return config
|
|
554
559
|
|
|
555
560
|
|
|
556
561
|
def load_raw_config(name: str, default: Any = None) -> Union[DotDict, str]:
|
|
@@ -668,3 +673,21 @@ def merge_configs(*configs: dict) -> dict:
|
|
|
668
673
|
_merge_dicts(result, config)
|
|
669
674
|
|
|
670
675
|
return result
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
@contextlib.contextmanager
|
|
679
|
+
def temporary_config(tmp: dict) -> None:
|
|
680
|
+
|
|
681
|
+
global CONFIG_PATCH
|
|
682
|
+
|
|
683
|
+
def patch_config(config: dict) -> dict:
|
|
684
|
+
return merge_configs(config, tmp)
|
|
685
|
+
|
|
686
|
+
with CONFIG_LOCK:
|
|
687
|
+
|
|
688
|
+
CONFIG_PATCH = patch_config
|
|
689
|
+
|
|
690
|
+
try:
|
|
691
|
+
yield
|
|
692
|
+
finally:
|
|
693
|
+
CONFIG_PATCH = None
|
|
@@ -51,10 +51,12 @@ class Rule:
|
|
|
51
51
|
|
|
52
52
|
@property
|
|
53
53
|
def result(self) -> Any:
|
|
54
|
+
"""The result associated with the rule."""
|
|
54
55
|
return self._result
|
|
55
56
|
|
|
56
57
|
@property
|
|
57
58
|
def condition(self) -> Dict[str, Any]:
|
|
59
|
+
"""The conditions that define the rule."""
|
|
58
60
|
return self._match
|
|
59
61
|
|
|
60
62
|
|
|
@@ -216,3 +218,28 @@ class RuleSet:
|
|
|
216
218
|
An iterator over the Rule objects in the RuleSet.
|
|
217
219
|
"""
|
|
218
220
|
return iter(self.rules)
|
|
221
|
+
|
|
222
|
+
def __len__(self) -> int:
|
|
223
|
+
"""Return the number of rules in the RuleSet.
|
|
224
|
+
|
|
225
|
+
Returns
|
|
226
|
+
-------
|
|
227
|
+
int
|
|
228
|
+
The number of rules in the RuleSet.
|
|
229
|
+
"""
|
|
230
|
+
return len(self.rules)
|
|
231
|
+
|
|
232
|
+
def __getitem__(self, index: int) -> Rule:
|
|
233
|
+
"""Retrieve a rule by its index.
|
|
234
|
+
|
|
235
|
+
Parameters
|
|
236
|
+
----------
|
|
237
|
+
index : int
|
|
238
|
+
The index of the rule to retrieve.
|
|
239
|
+
|
|
240
|
+
Returns
|
|
241
|
+
-------
|
|
242
|
+
Rule
|
|
243
|
+
The rule at the specified index.
|
|
244
|
+
"""
|
|
245
|
+
return self.rules[index]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# (C) Copyright 2025 ECMWF.
|
|
2
|
+
#
|
|
3
|
+
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
+
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
|
+
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
|
+
# nor does it submit to any jurisdiction.
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel as PydanticBaseModel
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class BaseModel(PydanticBaseModel):
|
|
13
|
+
class Config:
|
|
14
|
+
"""Pydantic BaseModel configuration."""
|
|
15
|
+
|
|
16
|
+
use_attribute_docstrings = True
|
|
17
|
+
use_enum_values = True
|
|
18
|
+
validate_assignment = True
|
|
19
|
+
validate_default = True
|
|
20
|
+
extra = "forbid"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# (C) Copyright 2025 ECMWF.
|
|
2
|
+
#
|
|
3
|
+
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
4
|
+
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
5
|
+
# In applying this licence, ECMWF does not waive the privileges and immunities
|
|
6
|
+
# granted to it by virtue of its status as an intergovernmental organisation
|
|
7
|
+
# nor does it submit to any jurisdiction.
|
|
8
|
+
|
|
9
|
+
from collections.abc import Iterator
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
from pydantic import BaseModel as PydanticBaseModel
|
|
13
|
+
from pydantic import ValidationError
|
|
14
|
+
from pydantic_core import ErrorDetails
|
|
15
|
+
|
|
16
|
+
CUSTOM_MESSAGES = {
|
|
17
|
+
"missing": "A config entry seems to be missing. If not please check for any typos.",
|
|
18
|
+
"extra_forbidden": "Extra entries in the config are forebidden. Please check for typos.",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def convert_errors(e: ValidationError, custom_messages: dict[str, str]) -> list[ErrorDetails]:
|
|
23
|
+
new_errors: list[ErrorDetails] = []
|
|
24
|
+
for error in e.errors():
|
|
25
|
+
custom_message = custom_messages.get(error["type"])
|
|
26
|
+
|
|
27
|
+
if custom_message:
|
|
28
|
+
|
|
29
|
+
ctx = error.get("ctx")
|
|
30
|
+
error["msg"] = custom_message.format(**ctx) if ctx else custom_message
|
|
31
|
+
new_errors.append(error)
|
|
32
|
+
return new_errors
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class ValidationError(Exception):
|
|
36
|
+
pass
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def allowed_values(v: Any, values: list[Any]) -> Any:
|
|
40
|
+
if v not in values:
|
|
41
|
+
msg = {f"Value {v} not in {values}"}
|
|
42
|
+
raise ValidationError(msg)
|
|
43
|
+
return v
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def required_fields(model: type[PydanticBaseModel], recursive: bool = False) -> Iterator[str]:
|
|
47
|
+
for name, field in model.model_fields.items():
|
|
48
|
+
if not field.is_required():
|
|
49
|
+
continue
|
|
50
|
+
t = field.annotation
|
|
51
|
+
if recursive and isinstance(t, type) and issubclass(t, PydanticBaseModel):
|
|
52
|
+
yield from required_fields(t, recursive=True)
|
|
53
|
+
else:
|
|
54
|
+
yield name
|
|
@@ -162,7 +162,7 @@ def get_test_archive(path: str, extension=".extracted") -> str:
|
|
|
162
162
|
return target
|
|
163
163
|
|
|
164
164
|
|
|
165
|
-
def packages_installed(*names) -> bool:
|
|
165
|
+
def packages_installed(*names: str) -> bool:
|
|
166
166
|
"""Check if all the given packages are installed.
|
|
167
167
|
|
|
168
168
|
Use this function to check if the required packages are installed before running tests.
|
|
@@ -196,7 +196,7 @@ def packages_installed(*names) -> bool:
|
|
|
196
196
|
return True
|
|
197
197
|
|
|
198
198
|
|
|
199
|
-
def _missing_packages(*names) -> list[str]:
|
|
199
|
+
def _missing_packages(*names: str) -> list[str]:
|
|
200
200
|
"""Check if the given packages are missing.
|
|
201
201
|
|
|
202
202
|
Use this function to check if the required packages are missing before running tests.
|
|
@@ -254,7 +254,20 @@ skip_if_offline = pytest.mark.skipif(_offline(), reason="No internet connection"
|
|
|
254
254
|
skip_slow_tests = pytest.mark.skipif(not _run_slow_tests(), reason="Skipping slow tests")
|
|
255
255
|
|
|
256
256
|
|
|
257
|
-
def skip_missing_packages(*names):
|
|
257
|
+
def skip_missing_packages(*names: str) -> callable:
|
|
258
|
+
"""Skip a test if any of the specified packages are missing.
|
|
259
|
+
|
|
260
|
+
Parameters
|
|
261
|
+
----------
|
|
262
|
+
names : str
|
|
263
|
+
The names of the packages to check.
|
|
264
|
+
|
|
265
|
+
Returns
|
|
266
|
+
-------
|
|
267
|
+
Callable
|
|
268
|
+
A decorator that skips the test if any of the specified packages are missing.
|
|
269
|
+
"""
|
|
270
|
+
|
|
258
271
|
missing = [f"'{p}'" for p in _missing_packages(*names)]
|
|
259
272
|
|
|
260
273
|
if len(missing) == 0:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: anemoi-utils
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.21
|
|
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
|
|
@@ -228,6 +228,7 @@ Requires-Dist: aniso8601
|
|
|
228
228
|
Requires-Dist: importlib-metadata; python_version < "3.10"
|
|
229
229
|
Requires-Dist: multiurl
|
|
230
230
|
Requires-Dist: numpy
|
|
231
|
+
Requires-Dist: pydantic>=2.9
|
|
231
232
|
Requires-Dist: python-dateutil
|
|
232
233
|
Requires-Dist: pyyaml
|
|
233
234
|
Requires-Dist: tomli; python_version < "3.11"
|
|
@@ -75,6 +75,8 @@ src/anemoi/utils/mars/requests.py
|
|
|
75
75
|
src/anemoi/utils/remote/__init__.py
|
|
76
76
|
src/anemoi/utils/remote/s3.py
|
|
77
77
|
src/anemoi/utils/remote/ssh.py
|
|
78
|
+
src/anemoi/utils/schemas/__init__.py
|
|
79
|
+
src/anemoi/utils/schemas/errors.py
|
|
78
80
|
src/anemoi_utils.egg-info/PKG-INFO
|
|
79
81
|
src/anemoi_utils.egg-info/SOURCES.txt
|
|
80
82
|
src/anemoi_utils.egg-info/dependency_links.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{anemoi_utils-0.4.20 → anemoi_utils-0.4.21}/.github/workflows/pr-label-conventional-commits.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|