anemoi-utils 0.2.1__tar.gz → 0.3.1__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 (53) hide show
  1. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/.github/workflows/python-publish.yml +1 -3
  2. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/.pre-commit-config.yaml +27 -27
  3. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/PKG-INFO +37 -29
  4. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/conf.py +2 -0
  5. anemoi_utils-0.3.1/pyproject.toml +115 -0
  6. anemoi_utils-0.3.1/src/anemoi/utils/__main__.py +28 -0
  7. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/_version.py +2 -2
  8. anemoi_utils-0.3.1/src/anemoi/utils/commands/__init__.py +24 -0
  9. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/timer.py +2 -0
  10. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi_utils.egg-info/PKG-INFO +37 -29
  11. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi_utils.egg-info/SOURCES.txt +0 -1
  12. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi_utils.egg-info/requires.txt +22 -14
  13. anemoi_utils-0.2.1/pyproject.toml +0 -98
  14. anemoi_utils-0.2.1/src/anemoi/utils/__main__.py +0 -77
  15. anemoi_utils-0.2.1/src/anemoi/utils/commands/__init__.py +0 -78
  16. anemoi_utils-0.2.1/tests/requirements.txt +0 -1
  17. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/.gitignore +0 -0
  18. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/.readthedocs.yaml +0 -0
  19. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/LICENSE +0 -0
  20. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/README.md +0 -0
  21. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/Makefile +0 -0
  22. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/_static/logo.png +0 -0
  23. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/_static/style.css +0 -0
  24. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/_templates/.gitkeep +0 -0
  25. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/index.rst +0 -0
  26. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/installing.rst +0 -0
  27. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/modules/checkpoints.rst +0 -0
  28. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/modules/config.rst +0 -0
  29. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/modules/dates.rst +0 -0
  30. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/modules/grib.rst +0 -0
  31. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/modules/humanize.rst +0 -0
  32. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/modules/provenance.rst +0 -0
  33. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/modules/text.rst +0 -0
  34. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/docs/requirements.txt +0 -0
  35. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/setup.cfg +0 -0
  36. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/__init__.py +0 -0
  37. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/caching.py +0 -0
  38. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/checkpoints.py +0 -0
  39. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/cli.py +0 -0
  40. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/commands/checkpoint.py +0 -0
  41. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/config.py +0 -0
  42. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/dates.py +0 -0
  43. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/grib.py +0 -0
  44. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/humanize.py +0 -0
  45. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/mars/__init__.py +0 -0
  46. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/mars/mars.yaml +0 -0
  47. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/provenance.py +0 -0
  48. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi/utils/text.py +0 -0
  49. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi_utils.egg-info/dependency_links.txt +0 -0
  50. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi_utils.egg-info/entry_points.txt +0 -0
  51. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/src/anemoi_utils.egg-info/top_level.txt +0 -0
  52. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/tests/test_dates.py +0 -0
  53. {anemoi_utils-0.2.1 → anemoi_utils-0.3.1}/tests/test_utils.py +0 -0
@@ -41,9 +41,7 @@ jobs:
41
41
 
42
42
  - name: Install
43
43
  run: |
44
- pip install pytest
45
- pip install -e .[all]
46
- pip install -r tests/requirements.txt
44
+ pip install -e .[all,tests]
47
45
  pip freeze
48
46
 
49
47
  - name: Tests
@@ -1,19 +1,16 @@
1
1
  repos:
2
-
3
2
  # Empty notebookds
4
3
  - repo: local
5
4
  hooks:
6
- - id: clear-notebooks-output
7
- name: clear-notebooks-output
8
- files: tools/.*\.ipynb$
9
- stages: [commit]
10
- language: python
11
- entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
12
- additional_dependencies: [jupyter]
13
-
14
-
5
+ - id: clear-notebooks-output
6
+ name: clear-notebooks-output
7
+ files: tools/.*\.ipynb$
8
+ stages: [commit]
9
+ language: python
10
+ entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
11
+ additional_dependencies: [jupyter]
15
12
  - repo: https://github.com/pre-commit/pre-commit-hooks
16
- rev: v4.4.0
13
+ rev: v4.6.0
17
14
  hooks:
18
15
  - id: check-yaml # Check YAML files for syntax errors only
19
16
  args: [--unsafe, --allow-multiple-documents]
@@ -23,13 +20,11 @@ repos:
23
20
  - id: no-commit-to-branch # Prevent committing to main / master
24
21
  - id: check-added-large-files # Check for large files added to git
25
22
  - id: check-merge-conflict # Check for files that contain merge conflict
26
-
27
23
  - repo: https://github.com/psf/black-pre-commit-mirror
28
- rev: 24.1.1
24
+ rev: 24.4.2
29
25
  hooks:
30
- - id: black
31
- args: [--line-length=120]
32
-
26
+ - id: black
27
+ args: [--line-length=120]
33
28
  - repo: https://github.com/pycqa/isort
34
29
  rev: 5.13.2
35
30
  hooks:
@@ -38,33 +33,38 @@ repos:
38
33
  - -l 120
39
34
  - --force-single-line-imports
40
35
  - --profile black
41
-
42
-
43
36
  - repo: https://github.com/astral-sh/ruff-pre-commit
44
- rev: v0.3.0
37
+ rev: v0.4.6
45
38
  hooks:
46
39
  - id: ruff
47
- exclude: '(dev/.*|.*_)\.py$'
40
+ # Next line if for documenation cod snippets
41
+ exclude: '^(dev/.*|[A-Za-z].*_)\.py$'
48
42
  args:
49
43
  - --line-length=120
50
44
  - --fix
51
45
  - --exit-non-zero-on-fix
52
46
  - --preview
53
-
54
47
  - repo: https://github.com/sphinx-contrib/sphinx-lint
55
48
  rev: v0.9.1
56
49
  hooks:
57
- - id: sphinx-lint
58
-
50
+ - id: sphinx-lint
59
51
  # For now, we use it. But it does not support a lot of sphinx features
60
52
  - repo: https://github.com/dzhu/rstfmt
61
53
  rev: v0.0.14
62
54
  hooks:
63
- - id: rstfmt
64
- exclude: 'cli/.*' # Because we use argparse
65
-
55
+ - id: rstfmt
56
+ exclude: 'cli/.*' # Because we use argparse
66
57
  - repo: https://github.com/b8raoult/pre-commit-docconvert
67
- rev: "0.1.4"
58
+ rev: "0.1.5"
68
59
  hooks:
69
60
  - id: docconvert
70
61
  args: ["numpy"]
62
+ - repo: https://github.com/b8raoult/optional-dependencies-all
63
+ rev: "0.0.6"
64
+ hooks:
65
+ - id: optional-dependencies-all
66
+ args: ["--inplace", "--exclude-keys=dev,docs,tests", "--group=dev=all,docs,tests"]
67
+ - repo: https://github.com/tox-dev/pyproject-fmt
68
+ rev: "2.1.3"
69
+ hooks:
70
+ - id: pyproject-fmt
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: anemoi-utils
3
- Version: 0.2.1
3
+ Version: 0.3.1
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
@@ -205,51 +205,59 @@ License: Apache License
205
205
  See the License for the specific language governing permissions and
206
206
  limitations under the License.
207
207
 
208
- Project-URL: Homepage, https://github.com/ecmwf/anemoi-utils/
209
208
  Project-URL: Documentation, https://anemoi-utils.readthedocs.io/
210
- Project-URL: Repository, https://github.com/ecmwf/anemoi-utils/
209
+ Project-URL: Homepage, https://github.com/ecmwf/anemoi-utils/
211
210
  Project-URL: Issues, https://github.com/ecmwf/anemoi-utils/issues
212
- Keywords: tools,ai
211
+ Project-URL: Repository, https://github.com/ecmwf/anemoi-utils/
212
+ Keywords: ai,tools
213
213
  Classifier: Development Status :: 4 - Beta
214
214
  Classifier: Intended Audience :: Developers
215
215
  Classifier: License :: OSI Approved :: Apache Software License
216
- Classifier: Programming Language :: Python :: 3
216
+ Classifier: Operating System :: OS Independent
217
+ Classifier: Programming Language :: Python :: 3 :: Only
217
218
  Classifier: Programming Language :: Python :: 3.9
218
219
  Classifier: Programming Language :: Python :: 3.10
219
220
  Classifier: Programming Language :: Python :: 3.11
221
+ Classifier: Programming Language :: Python :: 3.12
220
222
  Classifier: Programming Language :: Python :: Implementation :: CPython
221
223
  Classifier: Programming Language :: Python :: Implementation :: PyPy
222
- Classifier: Operating System :: OS Independent
223
224
  Requires-Python: >=3.9
224
225
  License-File: LICENSE
225
- Requires-Dist: tomli
226
226
  Requires-Dist: pyyaml
227
+ Requires-Dist: tomli
227
228
  Requires-Dist: tqdm
228
- Provides-Extra: provenance
229
- Requires-Dist: GitPython; extra == "provenance"
230
- Requires-Dist: nvsmi; extra == "provenance"
231
- Provides-Extra: text
232
- Requires-Dist: termcolor; extra == "text"
233
- Provides-Extra: grib
234
- Requires-Dist: requests; extra == "grib"
235
- Provides-Extra: docs
236
- Requires-Dist: tomli; extra == "docs"
237
- Requires-Dist: termcolor; extra == "docs"
238
- Requires-Dist: requests; extra == "docs"
239
- Requires-Dist: sphinx; extra == "docs"
240
- Requires-Dist: sphinx_rtd_theme; extra == "docs"
241
- Requires-Dist: nbsphinx; extra == "docs"
242
- Requires-Dist: pandoc; extra == "docs"
243
- Requires-Dist: sphinx_argparse; extra == "docs"
244
229
  Provides-Extra: all
245
- Requires-Dist: tomli; extra == "all"
246
- Requires-Dist: GitPython; extra == "all"
230
+ Requires-Dist: gitpython; extra == "all"
247
231
  Requires-Dist: nvsmi; extra == "all"
248
- Requires-Dist: termcolor; extra == "all"
249
232
  Requires-Dist: requests; extra == "all"
233
+ Requires-Dist: termcolor; extra == "all"
250
234
  Provides-Extra: dev
251
- Requires-Dist: tomli; extra == "dev"
252
- Requires-Dist: GitPython; extra == "dev"
235
+ Requires-Dist: gitpython; extra == "dev"
236
+ Requires-Dist: nbsphinx; extra == "dev"
253
237
  Requires-Dist: nvsmi; extra == "dev"
254
- Requires-Dist: termcolor; extra == "dev"
238
+ Requires-Dist: pandoc; extra == "dev"
239
+ Requires-Dist: pytest; extra == "dev"
255
240
  Requires-Dist: requests; extra == "dev"
241
+ Requires-Dist: sphinx; extra == "dev"
242
+ Requires-Dist: sphinx-argparse; extra == "dev"
243
+ Requires-Dist: sphinx-rtd-theme; extra == "dev"
244
+ Requires-Dist: termcolor; extra == "dev"
245
+ Requires-Dist: tomli; extra == "dev"
246
+ Provides-Extra: docs
247
+ Requires-Dist: nbsphinx; extra == "docs"
248
+ Requires-Dist: pandoc; extra == "docs"
249
+ Requires-Dist: requests; extra == "docs"
250
+ Requires-Dist: sphinx; extra == "docs"
251
+ Requires-Dist: sphinx-argparse; extra == "docs"
252
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
253
+ Requires-Dist: termcolor; extra == "docs"
254
+ Requires-Dist: tomli; extra == "docs"
255
+ Provides-Extra: grib
256
+ Requires-Dist: requests; extra == "grib"
257
+ Provides-Extra: provenance
258
+ Requires-Dist: gitpython; extra == "provenance"
259
+ Requires-Dist: nvsmi; extra == "provenance"
260
+ Provides-Extra: tests
261
+ Requires-Dist: pytest; extra == "tests"
262
+ Provides-Extra: text
263
+ Requires-Dist: termcolor; extra == "text"
@@ -114,3 +114,5 @@ html_css_files = ["style.css"]
114
114
 
115
115
 
116
116
  todo_include_todos = not read_the_docs_build
117
+
118
+ autodoc_member_order = "bysource" # Keep file order
@@ -0,0 +1,115 @@
1
+ #!/usr/bin/env python
2
+ # (C) Copyright 2024 ECMWF.
3
+ #
4
+ # This software is licensed under the terms of the Apache Licence Version 2.0
5
+ # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6
+ # In applying this licence, ECMWF does not waive the privileges and immunities
7
+ # granted to it by virtue of its status as an intergovernmental organisation
8
+ # nor does it submit to any jurisdiction.
9
+
10
+ # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
11
+
12
+ [build-system]
13
+ requires = [
14
+ "setuptools>=60",
15
+ "setuptools-scm>=8",
16
+ ]
17
+
18
+ [project]
19
+ name = "anemoi-utils"
20
+
21
+ description = "A package to hold various functions to support training of ML models on ECMWF data."
22
+ keywords = [
23
+ "ai",
24
+ "tools",
25
+ ]
26
+
27
+ license = { file = "LICENSE" }
28
+ authors = [
29
+ { name = "European Centre for Medium-Range Weather Forecasts (ECMWF)", email = "software.support@ecmwf.int" },
30
+ ]
31
+
32
+ requires-python = ">=3.9"
33
+
34
+ classifiers = [
35
+ "Development Status :: 4 - Beta",
36
+ "Intended Audience :: Developers",
37
+ "License :: OSI Approved :: Apache Software License",
38
+ "Operating System :: OS Independent",
39
+ "Programming Language :: Python :: 3 :: Only",
40
+ "Programming Language :: Python :: 3.9",
41
+ "Programming Language :: Python :: 3.10",
42
+ "Programming Language :: Python :: 3.11",
43
+ "Programming Language :: Python :: 3.12",
44
+ "Programming Language :: Python :: Implementation :: CPython",
45
+ "Programming Language :: Python :: Implementation :: PyPy",
46
+ ]
47
+
48
+ dynamic = [
49
+ "version",
50
+ ]
51
+ dependencies = [
52
+ "pyyaml",
53
+ "tomli", # Only needed before 3.11
54
+ "tqdm",
55
+ ]
56
+
57
+ optional-dependencies.all = [
58
+ "gitpython",
59
+ "nvsmi",
60
+ "requests",
61
+ "termcolor",
62
+ ]
63
+ optional-dependencies.dev = [
64
+ "gitpython",
65
+ "nbsphinx",
66
+ "nvsmi",
67
+ "pandoc",
68
+ "pytest",
69
+ "requests",
70
+ "sphinx",
71
+ "sphinx-argparse",
72
+ "sphinx-rtd-theme",
73
+ "termcolor",
74
+ "tomli",
75
+ ]
76
+ # Loaded by read-the-docs
77
+ # `pip install .[docs]`
78
+ optional-dependencies.docs = [
79
+ "nbsphinx",
80
+ "pandoc",
81
+ "requests",
82
+ "sphinx",
83
+ "sphinx-argparse",
84
+ "sphinx-rtd-theme",
85
+ "termcolor",
86
+ "tomli",
87
+ ]
88
+ optional-dependencies.grib = [
89
+ "requests",
90
+ ]
91
+
92
+ optional-dependencies.provenance = [
93
+ "gitpython",
94
+ "nvsmi",
95
+ ]
96
+ optional-dependencies.tests = [
97
+ "pytest",
98
+ ]
99
+
100
+ optional-dependencies.text = [
101
+ "termcolor",
102
+ ]
103
+ urls.Documentation = "https://anemoi-utils.readthedocs.io/"
104
+ urls.Homepage = "https://github.com/ecmwf/anemoi-utils/"
105
+ urls.Issues = "https://github.com/ecmwf/anemoi-utils/issues"
106
+ urls.Repository = "https://github.com/ecmwf/anemoi-utils/"
107
+ scripts.anemoi-utils = "anemoi.utils.__main__:main"
108
+
109
+ [tool.setuptools.package-data]
110
+ "anemoi.utils.mars" = [
111
+ "*.yaml",
112
+ ]
113
+
114
+ [tool.setuptools_scm]
115
+ version_file = "src/anemoi/utils/_version.py"
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env python
2
+ # (C) Copyright 2024 ECMWF.
3
+ #
4
+ # This software is licensed under the terms of the Apache Licence Version 2.0
5
+ # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6
+ # In applying this licence, ECMWF does not waive the privileges and immunities
7
+ # granted to it by virtue of its status as an intergovernmental organisation
8
+ # nor does it submit to any jurisdiction.
9
+ #
10
+
11
+ from anemoi.utils.cli import cli_main
12
+ from anemoi.utils.cli import make_parser
13
+
14
+ from . import __version__
15
+ from .commands import COMMANDS
16
+
17
+
18
+ # For read-the-docs
19
+ def create_parser():
20
+ return make_parser(__doc__, COMMANDS)
21
+
22
+
23
+ def main():
24
+ cli_main(__version__, __doc__, COMMANDS)
25
+
26
+
27
+ if __name__ == "__main__":
28
+ main()
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.2.1'
16
- __version_tuple__ = version_tuple = (0, 2, 1)
15
+ __version__ = version = '0.3.1'
16
+ __version_tuple__ = version_tuple = (0, 3, 1)
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env python
2
+ # (C) Copyright 2024 ECMWF.
3
+ #
4
+ # This software is licensed under the terms of the Apache Licence Version 2.0
5
+ # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6
+ # In applying this licence, ECMWF does not waive the privileges and immunities
7
+ # granted to it by virtue of its status as an intergovernmental organisation
8
+ # nor does it submit to any jurisdiction.
9
+ #
10
+
11
+ import os
12
+
13
+ from anemoi.utils.cli import Command
14
+ from anemoi.utils.cli import Failed
15
+ from anemoi.utils.cli import register_commands
16
+
17
+ __all__ = ["Command"]
18
+
19
+ COMMANDS = register_commands(
20
+ os.path.dirname(__file__),
21
+ __name__,
22
+ lambda x: x.command(),
23
+ lambda name, error: Failed(name, error),
24
+ )
@@ -16,6 +16,8 @@ LOGGER = logging.getLogger(__name__)
16
16
 
17
17
 
18
18
  class Timer:
19
+ """Context manager to measure elapsed time."""
20
+
19
21
  def __init__(self, title, logger=LOGGER):
20
22
  self.title = title
21
23
  self.start = time.time()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: anemoi-utils
3
- Version: 0.2.1
3
+ Version: 0.3.1
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
@@ -205,51 +205,59 @@ License: Apache License
205
205
  See the License for the specific language governing permissions and
206
206
  limitations under the License.
207
207
 
208
- Project-URL: Homepage, https://github.com/ecmwf/anemoi-utils/
209
208
  Project-URL: Documentation, https://anemoi-utils.readthedocs.io/
210
- Project-URL: Repository, https://github.com/ecmwf/anemoi-utils/
209
+ Project-URL: Homepage, https://github.com/ecmwf/anemoi-utils/
211
210
  Project-URL: Issues, https://github.com/ecmwf/anemoi-utils/issues
212
- Keywords: tools,ai
211
+ Project-URL: Repository, https://github.com/ecmwf/anemoi-utils/
212
+ Keywords: ai,tools
213
213
  Classifier: Development Status :: 4 - Beta
214
214
  Classifier: Intended Audience :: Developers
215
215
  Classifier: License :: OSI Approved :: Apache Software License
216
- Classifier: Programming Language :: Python :: 3
216
+ Classifier: Operating System :: OS Independent
217
+ Classifier: Programming Language :: Python :: 3 :: Only
217
218
  Classifier: Programming Language :: Python :: 3.9
218
219
  Classifier: Programming Language :: Python :: 3.10
219
220
  Classifier: Programming Language :: Python :: 3.11
221
+ Classifier: Programming Language :: Python :: 3.12
220
222
  Classifier: Programming Language :: Python :: Implementation :: CPython
221
223
  Classifier: Programming Language :: Python :: Implementation :: PyPy
222
- Classifier: Operating System :: OS Independent
223
224
  Requires-Python: >=3.9
224
225
  License-File: LICENSE
225
- Requires-Dist: tomli
226
226
  Requires-Dist: pyyaml
227
+ Requires-Dist: tomli
227
228
  Requires-Dist: tqdm
228
- Provides-Extra: provenance
229
- Requires-Dist: GitPython; extra == "provenance"
230
- Requires-Dist: nvsmi; extra == "provenance"
231
- Provides-Extra: text
232
- Requires-Dist: termcolor; extra == "text"
233
- Provides-Extra: grib
234
- Requires-Dist: requests; extra == "grib"
235
- Provides-Extra: docs
236
- Requires-Dist: tomli; extra == "docs"
237
- Requires-Dist: termcolor; extra == "docs"
238
- Requires-Dist: requests; extra == "docs"
239
- Requires-Dist: sphinx; extra == "docs"
240
- Requires-Dist: sphinx_rtd_theme; extra == "docs"
241
- Requires-Dist: nbsphinx; extra == "docs"
242
- Requires-Dist: pandoc; extra == "docs"
243
- Requires-Dist: sphinx_argparse; extra == "docs"
244
229
  Provides-Extra: all
245
- Requires-Dist: tomli; extra == "all"
246
- Requires-Dist: GitPython; extra == "all"
230
+ Requires-Dist: gitpython; extra == "all"
247
231
  Requires-Dist: nvsmi; extra == "all"
248
- Requires-Dist: termcolor; extra == "all"
249
232
  Requires-Dist: requests; extra == "all"
233
+ Requires-Dist: termcolor; extra == "all"
250
234
  Provides-Extra: dev
251
- Requires-Dist: tomli; extra == "dev"
252
- Requires-Dist: GitPython; extra == "dev"
235
+ Requires-Dist: gitpython; extra == "dev"
236
+ Requires-Dist: nbsphinx; extra == "dev"
253
237
  Requires-Dist: nvsmi; extra == "dev"
254
- Requires-Dist: termcolor; extra == "dev"
238
+ Requires-Dist: pandoc; extra == "dev"
239
+ Requires-Dist: pytest; extra == "dev"
255
240
  Requires-Dist: requests; extra == "dev"
241
+ Requires-Dist: sphinx; extra == "dev"
242
+ Requires-Dist: sphinx-argparse; extra == "dev"
243
+ Requires-Dist: sphinx-rtd-theme; extra == "dev"
244
+ Requires-Dist: termcolor; extra == "dev"
245
+ Requires-Dist: tomli; extra == "dev"
246
+ Provides-Extra: docs
247
+ Requires-Dist: nbsphinx; extra == "docs"
248
+ Requires-Dist: pandoc; extra == "docs"
249
+ Requires-Dist: requests; extra == "docs"
250
+ Requires-Dist: sphinx; extra == "docs"
251
+ Requires-Dist: sphinx-argparse; extra == "docs"
252
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
253
+ Requires-Dist: termcolor; extra == "docs"
254
+ Requires-Dist: tomli; extra == "docs"
255
+ Provides-Extra: grib
256
+ Requires-Dist: requests; extra == "grib"
257
+ Provides-Extra: provenance
258
+ Requires-Dist: gitpython; extra == "provenance"
259
+ Requires-Dist: nvsmi; extra == "provenance"
260
+ Provides-Extra: tests
261
+ Requires-Dist: pytest; extra == "tests"
262
+ Provides-Extra: text
263
+ Requires-Dist: termcolor; extra == "text"
@@ -43,6 +43,5 @@ src/anemoi_utils.egg-info/dependency_links.txt
43
43
  src/anemoi_utils.egg-info/entry_points.txt
44
44
  src/anemoi_utils.egg-info/requires.txt
45
45
  src/anemoi_utils.egg-info/top_level.txt
46
- tests/requirements.txt
47
46
  tests/test_dates.py
48
47
  tests/test_utils.py
@@ -1,37 +1,45 @@
1
- tomli
2
1
  pyyaml
2
+ tomli
3
3
  tqdm
4
4
 
5
5
  [all]
6
- tomli
7
- GitPython
6
+ gitpython
8
7
  nvsmi
9
- termcolor
10
8
  requests
9
+ termcolor
11
10
 
12
11
  [dev]
13
- tomli
14
- GitPython
12
+ gitpython
13
+ nbsphinx
15
14
  nvsmi
16
- termcolor
15
+ pandoc
16
+ pytest
17
17
  requests
18
+ sphinx
19
+ sphinx-argparse
20
+ sphinx-rtd-theme
21
+ termcolor
22
+ tomli
18
23
 
19
24
  [docs]
20
- tomli
21
- termcolor
22
- requests
23
- sphinx
24
- sphinx_rtd_theme
25
25
  nbsphinx
26
26
  pandoc
27
- sphinx_argparse
27
+ requests
28
+ sphinx
29
+ sphinx-argparse
30
+ sphinx-rtd-theme
31
+ termcolor
32
+ tomli
28
33
 
29
34
  [grib]
30
35
  requests
31
36
 
32
37
  [provenance]
33
- GitPython
38
+ gitpython
34
39
  nvsmi
35
40
 
41
+ [tests]
42
+ pytest
43
+
36
44
  [text]
37
45
  termcolor
@@ -1,98 +0,0 @@
1
- #!/usr/bin/env python
2
- # (C) Copyright 2024 ECMWF.
3
- #
4
- # This software is licensed under the terms of the Apache Licence Version 2.0
5
- # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6
- # In applying this licence, ECMWF does not waive the privileges and immunities
7
- # granted to it by virtue of its status as an intergovernmental organisation
8
- # nor does it submit to any jurisdiction.
9
-
10
- # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
11
-
12
- [build-system]
13
- requires = ["setuptools>=60", "setuptools-scm>=8.0"]
14
-
15
- [project]
16
- description = "A package to hold various functions to support training of ML models on ECMWF data."
17
- name = "anemoi-utils"
18
-
19
- dynamic = ["version"]
20
- license = { file = "LICENSE" }
21
- requires-python = ">=3.9"
22
-
23
- authors = [
24
- { name = "European Centre for Medium-Range Weather Forecasts (ECMWF)", email = "software.support@ecmwf.int" },
25
- ]
26
-
27
- keywords = ["tools", "ai"]
28
-
29
- classifiers = [
30
- "Development Status :: 4 - Beta",
31
- "Intended Audience :: Developers",
32
- "License :: OSI Approved :: Apache Software License",
33
- "Programming Language :: Python :: 3",
34
- "Programming Language :: Python :: 3.9",
35
- "Programming Language :: Python :: 3.10",
36
- "Programming Language :: Python :: 3.11",
37
- "Programming Language :: Python :: Implementation :: CPython",
38
- "Programming Language :: Python :: Implementation :: PyPy",
39
- "Operating System :: OS Independent",
40
- ]
41
-
42
- dependencies = [
43
- "tomli", # Only needed before 3.11
44
- "pyyaml",
45
- "tqdm",
46
- ]
47
-
48
- [project.optional-dependencies]
49
- provenance = ["GitPython", "nvsmi"]
50
-
51
- text = ["termcolor"]
52
-
53
- grib = ["requests"]
54
-
55
- # Loaded by read-the-docs
56
- # `pip install .[docs]`
57
- docs = [
58
- "tomli", # Only needed before 3.11
59
- "termcolor",
60
- "requests",
61
- "sphinx",
62
- "sphinx_rtd_theme",
63
- "nbsphinx",
64
- "pandoc",
65
- "sphinx_argparse",
66
- ]
67
-
68
- all = [
69
- "tomli", # Only needed before 3.11
70
- "GitPython",
71
- "nvsmi",
72
- "termcolor",
73
- "requests",
74
- ]
75
-
76
- dev = [
77
- "tomli", # Only needed before 3.11
78
- "GitPython",
79
- "nvsmi",
80
- "termcolor",
81
- "requests",
82
- ]
83
-
84
- [project.urls]
85
- Homepage = "https://github.com/ecmwf/anemoi-utils/"
86
- Documentation = "https://anemoi-utils.readthedocs.io/"
87
- Repository = "https://github.com/ecmwf/anemoi-utils/"
88
- Issues = "https://github.com/ecmwf/anemoi-utils/issues"
89
- # Changelog = "https://github.com/ecmwf/anemoi-utils/CHANGELOG.md"
90
-
91
- [project.scripts]
92
- anemoi-utils = "anemoi.utils.__main__:main"
93
-
94
- [tool.setuptools_scm]
95
- version_file = "src/anemoi/utils/_version.py"
96
-
97
- [tool.setuptools.package-data]
98
- "anemoi.utils.mars" = ["*.yaml"]
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env python
2
- # (C) Copyright 2024 ECMWF.
3
- #
4
- # This software is licensed under the terms of the Apache Licence Version 2.0
5
- # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6
- # In applying this licence, ECMWF does not waive the privileges and immunities
7
- # granted to it by virtue of its status as an intergovernmental organisation
8
- # nor does it submit to any jurisdiction.
9
- #
10
-
11
-
12
- import argparse
13
- import logging
14
- import sys
15
- import traceback
16
-
17
- from . import __version__
18
- from .commands import COMMANDS
19
-
20
- LOG = logging.getLogger(__name__)
21
-
22
-
23
- def create_parser():
24
- parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
25
-
26
- parser.add_argument(
27
- "--version",
28
- "-V",
29
- action="store_true",
30
- help="show the version and exit",
31
- )
32
- parser.add_argument(
33
- "--debug",
34
- "-d",
35
- action="store_true",
36
- help="Debug mode",
37
- )
38
-
39
- subparsers = parser.add_subparsers(help="commands:", dest="command")
40
- for name, command in COMMANDS.items():
41
- command_parser = subparsers.add_parser(name, help=command.__doc__)
42
- command.add_arguments(command_parser)
43
-
44
- return parser
45
-
46
-
47
- def main():
48
- parser = create_parser()
49
- args = parser.parse_args()
50
-
51
- if args.version:
52
- print(__version__)
53
- return
54
-
55
- if args.command is None:
56
- parser.print_help()
57
- return
58
-
59
- cmd = COMMANDS[args.command]
60
-
61
- logging.basicConfig(
62
- format="%(asctime)s %(levelname)s %(message)s",
63
- datefmt="%Y-%m-%d %H:%M:%S",
64
- level=logging.DEBUG if args.debug else logging.INFO,
65
- )
66
-
67
- try:
68
- cmd.run(args)
69
- except ValueError as e:
70
- traceback.print_exc()
71
- LOG.error("\n💣 %s", str(e).lstrip())
72
- LOG.error("💣 Exiting")
73
- sys.exit(1)
74
-
75
-
76
- if __name__ == "__main__":
77
- main()
@@ -1,78 +0,0 @@
1
- #!/usr/bin/env python
2
- # (C) Copyright 2024 ECMWF.
3
- #
4
- # This software is licensed under the terms of the Apache Licence Version 2.0
5
- # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6
- # In applying this licence, ECMWF does not waive the privileges and immunities
7
- # granted to it by virtue of its status as an intergovernmental organisation
8
- # nor does it submit to any jurisdiction.
9
- #
10
-
11
- import argparse
12
- import importlib
13
- import logging
14
- import os
15
- import sys
16
-
17
- LOG = logging.getLogger(__name__)
18
-
19
-
20
- def register(here, package, select, fail=None):
21
- result = {}
22
- not_available = {}
23
-
24
- for p in os.listdir(here):
25
- full = os.path.join(here, p)
26
- if p.startswith("_"):
27
- continue
28
- if not (p.endswith(".py") or (os.path.isdir(full) and os.path.exists(os.path.join(full, "__init__.py")))):
29
- continue
30
-
31
- name, _ = os.path.splitext(p)
32
-
33
- try:
34
- imported = importlib.import_module(
35
- f".{name}",
36
- package=package,
37
- )
38
- except ImportError as e:
39
- not_available[name] = e
40
- continue
41
-
42
- obj = select(imported)
43
- if obj is not None:
44
- result[name] = obj
45
-
46
- for name, e in not_available.items():
47
- if fail is None:
48
- pass
49
- if callable(fail):
50
- result[name] = fail(name, e)
51
-
52
- return result
53
-
54
-
55
- class Command:
56
- def run(self, args):
57
- raise NotImplementedError(f"Command not implemented: {args.command}")
58
-
59
-
60
- class Failed(Command):
61
- def __init__(self, name, error):
62
- self.name = name
63
- self.error = error
64
-
65
- def add_arguments(self, command_parser):
66
- command_parser.add_argument("x", nargs=argparse.REMAINDER)
67
-
68
- def run(self, args):
69
- print(f"Command '{self.name}' not available: {self.error}")
70
- sys.exit(1)
71
-
72
-
73
- COMMANDS = register(
74
- os.path.dirname(__file__),
75
- __name__,
76
- lambda x: x.command(),
77
- lambda name, error: Failed(name, error),
78
- )
@@ -1 +0,0 @@
1
- # Empty for now
File without changes
File without changes
File without changes
File without changes
File without changes