anemoi-utils 0.4.26__tar.gz → 0.4.27__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.27/.release-please-manifest.json +3 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/CHANGELOG.md +7 -0
- {anemoi_utils-0.4.26/src/anemoi_utils.egg-info → anemoi_utils-0.4.27}/PKG-INFO +1 -1
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/_version.py +2 -2
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/remote/s3.py +82 -19
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27/src/anemoi_utils.egg-info}/PKG-INFO +1 -1
- anemoi_utils-0.4.26/.release-please-manifest.json +0 -3
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.gitattributes +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/CODEOWNERS +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/ci-hpc-config.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/dependabot.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/labeler.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/pull_request_template.md +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/workflows/downstream-ci-hpc.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/workflows/pr-conventional-commit.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/workflows/pr-label-conventional-commits.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/workflows/pr-label-file-based.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/workflows/pr-label-public.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/workflows/python-publish.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/workflows/python-pull-request.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/workflows/readthedocs-pr-update.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.github/workflows/release-please.yml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.gitignore +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.pre-commit-config.yaml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.readthedocs.yaml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/.release-please-config.json +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/CONTRIBUTORS.md +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/LICENSE +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/README.md +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/Makefile +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/_static/logo.png +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/_static/style.css +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/_templates/.gitkeep +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/_templates/apidoc/package.rst.jinja +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/conf.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/index.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/installing.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/modules/checkpoints.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/modules/config.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/modules/dates.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/modules/grib.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/modules/humanize.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/modules/provenance.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/modules/s3.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/modules/testing.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/modules/text.rst +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/docs/scripts/api_build.sh +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/pyproject.toml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/setup.cfg +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/__init__.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/__main__.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/caching.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/checkpoints.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/cli.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/commands/__init__.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/commands/config.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/commands/metadata.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/commands/requests.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/commands/transfer.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/compatibility.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/config.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/dates.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/devtools.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/grib.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/grids.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/hindcasts.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/humanize.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/logs.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/mars/__init__.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/mars/mars.yaml +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/mars/requests.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/provenance.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/registry.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/remote/__init__.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/remote/ssh.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/rules.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/s3.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/sanitise.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/sanitize.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/schemas/__init__.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/schemas/errors.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/testing.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/text.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi/utils/timer.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi_utils.egg-info/SOURCES.txt +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi_utils.egg-info/dependency_links.txt +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi_utils.egg-info/entry_points.txt +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi_utils.egg-info/requires.txt +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/src/anemoi_utils.egg-info/top_level.txt +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test-transfer-data/directory/b/c/x +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test-transfer-data/directory/b/y +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/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.26 → anemoi_utils-0.4.27}/tests/test-transfer-data/directory/z +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test-transfer-data/file +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test_caching.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test_compatibility.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test_dates.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test_frequency.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test_provenance.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test_remote.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test_sanetise.py +0 -0
- {anemoi_utils-0.4.26 → anemoi_utils-0.4.27}/tests/test_utils.py +0 -0
|
@@ -8,6 +8,13 @@ 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.27](https://github.com/ecmwf/anemoi-utils/compare/0.4.26...0.4.27) (2025-06-27)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* Split s3 config from s3 client code ([#170](https://github.com/ecmwf/anemoi-utils/issues/170)) ([56dacb1](https://github.com/ecmwf/anemoi-utils/commit/56dacb19efa0979acd72edb72a95f058b69d612a))
|
|
17
|
+
|
|
11
18
|
## [0.4.26](https://github.com/ecmwf/anemoi-utils/compare/0.4.25...0.4.26) (2025-06-25)
|
|
12
19
|
|
|
13
20
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: anemoi-utils
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.27
|
|
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
|
|
@@ -47,8 +47,8 @@ SECRETS = ["aws_access_key_id", "aws_secret_access_key"]
|
|
|
47
47
|
thread_local = threading.local()
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
def
|
|
51
|
-
"""Get an S3 client for the specified bucket and region.
|
|
50
|
+
def _s3_config(bucket: str, *, region: str = None) -> Any:
|
|
51
|
+
"""Get an S3 client config for the specified bucket and region.
|
|
52
52
|
|
|
53
53
|
Parameters
|
|
54
54
|
----------
|
|
@@ -56,31 +56,15 @@ def s3_client(bucket: str, *, region: str = None, service: str = "s3") -> Any:
|
|
|
56
56
|
The name of the S3 bucket.
|
|
57
57
|
region : str, optional
|
|
58
58
|
The AWS region of the S3 bucket.
|
|
59
|
-
service : str, optional
|
|
60
|
-
The AWS service to use, default is "s3".
|
|
61
59
|
|
|
62
60
|
Returns
|
|
63
61
|
-------
|
|
64
62
|
Any
|
|
65
63
|
The S3 client.
|
|
66
64
|
"""
|
|
67
|
-
import boto3
|
|
68
65
|
from botocore import UNSIGNED
|
|
69
|
-
from botocore.client import Config
|
|
70
66
|
|
|
71
|
-
|
|
72
|
-
thread_local.s3_clients = {}
|
|
73
|
-
|
|
74
|
-
key = f"{bucket}-{region}-{service}"
|
|
75
|
-
|
|
76
|
-
if key in thread_local.s3_clients:
|
|
77
|
-
return thread_local.s3_clients[key]
|
|
78
|
-
|
|
79
|
-
boto3_config = dict(
|
|
80
|
-
max_pool_connections=25,
|
|
81
|
-
request_checksum_calculation="when_required",
|
|
82
|
-
response_checksum_validation="when_required",
|
|
83
|
-
)
|
|
67
|
+
boto3_config = {}
|
|
84
68
|
|
|
85
69
|
if region:
|
|
86
70
|
# This is using AWS
|
|
@@ -129,6 +113,85 @@ def s3_client(bucket: str, *, region: str = None, service: str = "s3") -> Any:
|
|
|
129
113
|
boto3_config.update(options["config"])
|
|
130
114
|
del options["config"]
|
|
131
115
|
|
|
116
|
+
def _(options):
|
|
117
|
+
|
|
118
|
+
def __(k, v):
|
|
119
|
+
if k in SECRETS:
|
|
120
|
+
return "***"
|
|
121
|
+
return v
|
|
122
|
+
|
|
123
|
+
if isinstance(options, dict):
|
|
124
|
+
return {k: __(k, v) for k, v in options.items()}
|
|
125
|
+
|
|
126
|
+
if isinstance(options, list):
|
|
127
|
+
return [_(o) for o in options]
|
|
128
|
+
|
|
129
|
+
return options
|
|
130
|
+
|
|
131
|
+
LOG.debug(f"Using S3 options: {_(options)}")
|
|
132
|
+
|
|
133
|
+
return boto3_config, options
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def s3_options(bucket: str, *, region: str = None, service: str = "s3") -> dict:
|
|
137
|
+
"""Get the S3 configuration for the specified bucket and region.
|
|
138
|
+
|
|
139
|
+
Parameters
|
|
140
|
+
----------
|
|
141
|
+
bucket : str
|
|
142
|
+
The name of the S3 bucket.
|
|
143
|
+
region : str, optional
|
|
144
|
+
The AWS region of the S3 bucket.
|
|
145
|
+
service : str, optional
|
|
146
|
+
The AWS service to use, default is "s3".
|
|
147
|
+
|
|
148
|
+
Returns
|
|
149
|
+
-------
|
|
150
|
+
dict
|
|
151
|
+
The S3 configuration.
|
|
152
|
+
"""
|
|
153
|
+
_, options = _s3_config(bucket, region=region)
|
|
154
|
+
return options
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def s3_client(bucket: str, *, region: str = None, service: str = "s3") -> Any:
|
|
158
|
+
"""Get an S3 client for the specified bucket and region.
|
|
159
|
+
|
|
160
|
+
Parameters
|
|
161
|
+
----------
|
|
162
|
+
bucket : str
|
|
163
|
+
The name of the S3 bucket.
|
|
164
|
+
region : str, optional
|
|
165
|
+
The AWS region of the S3 bucket.
|
|
166
|
+
service : str, optional
|
|
167
|
+
The AWS service to use, default is "s3".
|
|
168
|
+
|
|
169
|
+
Returns
|
|
170
|
+
-------
|
|
171
|
+
Any
|
|
172
|
+
The S3 client.
|
|
173
|
+
"""
|
|
174
|
+
import boto3
|
|
175
|
+
from botocore.client import Config
|
|
176
|
+
|
|
177
|
+
if not hasattr(thread_local, "s3_clients"):
|
|
178
|
+
thread_local.s3_clients = {}
|
|
179
|
+
|
|
180
|
+
key = f"{bucket}-{region}-{service}"
|
|
181
|
+
|
|
182
|
+
if key in thread_local.s3_clients:
|
|
183
|
+
return thread_local.s3_clients[key]
|
|
184
|
+
|
|
185
|
+
boto3_config, options = _s3_config(bucket, region=region)
|
|
186
|
+
|
|
187
|
+
boto3_config.update(
|
|
188
|
+
dict(
|
|
189
|
+
max_pool_connections=25,
|
|
190
|
+
request_checksum_calculation="when_required",
|
|
191
|
+
response_checksum_validation="when_required",
|
|
192
|
+
)
|
|
193
|
+
)
|
|
194
|
+
|
|
132
195
|
options["config"] = Config(**boto3_config)
|
|
133
196
|
|
|
134
197
|
def _(options):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: anemoi-utils
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.27
|
|
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
|
|
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.26 → anemoi_utils-0.4.27}/.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|