anemoi-utils 0.4.5__tar.gz → 0.4.40__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.
Files changed (137) hide show
  1. anemoi_utils-0.4.40/.github/CODEOWNERS +7 -0
  2. anemoi_utils-0.4.40/.github/dependabot.yml +10 -0
  3. anemoi_utils-0.4.40/.github/labeler.yml +43 -0
  4. anemoi_utils-0.4.40/.github/pull_request_template.md +15 -0
  5. anemoi_utils-0.4.40/.github/workflows/downstream-ci-hpc.yml +60 -0
  6. anemoi_utils-0.4.40/.github/workflows/pr-conventional-commit.yml +22 -0
  7. anemoi_utils-0.4.40/.github/workflows/pr-label-ats.yml +66 -0
  8. anemoi_utils-0.4.40/.github/workflows/pr-label-conventional-commits.yml +48 -0
  9. anemoi_utils-0.4.40/.github/workflows/pr-label-file-based.yml +17 -0
  10. anemoi_utils-0.4.5/.github/workflows/label-public-pr.yml → anemoi_utils-0.4.40/.github/workflows/pr-label-public.yml +2 -2
  11. anemoi_utils-0.4.40/.github/workflows/python-publish.yml +13 -0
  12. anemoi_utils-0.4.40/.github/workflows/python-pull-request.yml +25 -0
  13. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/.github/workflows/readthedocs-pr-update.yml +3 -1
  14. anemoi_utils-0.4.40/.github/workflows/release-please.yml +28 -0
  15. anemoi_utils-0.4.40/.gitignore +148 -0
  16. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/.pre-commit-config.yaml +27 -28
  17. anemoi_utils-0.4.40/.readthedocs.yaml +19 -0
  18. anemoi_utils-0.4.40/.release-please-config.json +25 -0
  19. anemoi_utils-0.4.40/.release-please-manifest.json +3 -0
  20. anemoi_utils-0.4.40/CHANGELOG.md +414 -0
  21. anemoi_utils-0.4.40/CONTRIBUTORS.md +13 -0
  22. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/LICENSE +1 -1
  23. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/PKG-INFO +21 -8
  24. anemoi_utils-0.4.40/README.md +56 -0
  25. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/Makefile +1 -0
  26. anemoi_utils-0.4.40/docs/_static/logo.png +0 -0
  27. anemoi_utils-0.4.40/docs/_templates/apidoc/package.rst.jinja +55 -0
  28. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/conf.py +13 -2
  29. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/index.rst +8 -7
  30. anemoi_utils-0.4.40/docs/modules/config.rst +17 -0
  31. anemoi_utils-0.4.40/docs/modules/testing.rst +8 -0
  32. anemoi_utils-0.4.40/docs/scripts/api_build.sh +13 -0
  33. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/pyproject.toml +31 -7
  34. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/__init__.py +8 -0
  35. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/__main__.py +12 -2
  36. anemoi_utils-0.4.40/src/anemoi/utils/_environment.py +40 -0
  37. anemoi_utils-0.4.40/src/anemoi/utils/_version.py +34 -0
  38. anemoi_utils-0.4.40/src/anemoi/utils/caching.py +248 -0
  39. anemoi_utils-0.4.40/src/anemoi/utils/checkpoints.py +351 -0
  40. anemoi_utils-0.4.40/src/anemoi/utils/cli.py +281 -0
  41. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/commands/__init__.py +4 -0
  42. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/commands/config.py +19 -2
  43. anemoi_utils-0.4.40/src/anemoi/utils/commands/metadata.py +392 -0
  44. anemoi_utils-0.4.40/src/anemoi/utils/commands/requests.py +64 -0
  45. anemoi_utils-0.4.40/src/anemoi/utils/commands/transfer.py +78 -0
  46. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/compatibility.py +5 -8
  47. anemoi_utils-0.4.40/src/anemoi/utils/config.py +716 -0
  48. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/dates.py +228 -81
  49. anemoi_utils-0.4.40/src/anemoi/utils/devtools.py +142 -0
  50. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/grib.py +28 -9
  51. anemoi_utils-0.4.40/src/anemoi/utils/grids.py +214 -0
  52. anemoi_utils-0.4.40/src/anemoi/utils/hindcasts.py +57 -0
  53. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/humanize.py +395 -70
  54. anemoi_utils-0.4.40/src/anemoi/utils/logs.py +96 -0
  55. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/mars/__init__.py +43 -12
  56. anemoi_utils-0.4.40/src/anemoi/utils/mars/requests.py +35 -0
  57. anemoi_utils-0.4.40/src/anemoi/utils/mlflow/__init__.py +8 -0
  58. anemoi_utils-0.4.40/src/anemoi/utils/mlflow/auth.py +391 -0
  59. anemoi_utils-0.4.40/src/anemoi/utils/mlflow/client.py +76 -0
  60. anemoi_utils-0.4.40/src/anemoi/utils/mlflow/utils.py +44 -0
  61. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/provenance.py +190 -35
  62. anemoi_utils-0.4.40/src/anemoi/utils/registry.py +420 -0
  63. anemoi_utils-0.4.40/src/anemoi/utils/remote/__init__.py +682 -0
  64. anemoi_utils-0.4.40/src/anemoi/utils/remote/s3.py +756 -0
  65. anemoi_utils-0.4.40/src/anemoi/utils/remote/ssh.py +269 -0
  66. anemoi_utils-0.4.40/src/anemoi/utils/rules.py +241 -0
  67. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/s3.py +76 -4
  68. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/sanitise.py +47 -12
  69. anemoi_utils-0.4.40/src/anemoi/utils/schemas/__init__.py +20 -0
  70. anemoi_utils-0.4.40/src/anemoi/utils/schemas/errors.py +54 -0
  71. anemoi_utils-0.4.40/src/anemoi/utils/testing.py +387 -0
  72. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/text.py +215 -54
  73. anemoi_utils-0.4.40/src/anemoi/utils/timer.py +150 -0
  74. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi_utils.egg-info/PKG-INFO +21 -8
  75. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi_utils.egg-info/SOURCES.txt +38 -5
  76. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi_utils.egg-info/requires.txt +18 -2
  77. anemoi_utils-0.4.40/tests/test_caching.py +192 -0
  78. anemoi_utils-0.4.40/tests/test_checkpoints.py +220 -0
  79. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test_compatibility.py +3 -0
  80. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test_dates.py +21 -35
  81. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test_frequency.py +7 -4
  82. anemoi_utils-0.4.40/tests/test_mlflow_auth.py +288 -0
  83. anemoi_utils-0.4.40/tests/test_mlflow_client.py +47 -0
  84. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test_provenance.py +2 -2
  85. anemoi_utils-0.4.40/tests/test_registry.py +64 -0
  86. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test_remote.py +141 -31
  87. anemoi_utils-0.4.40/tests/test_s3.py +65 -0
  88. anemoi_utils-0.4.5/tests/test_sanetise.py → anemoi_utils-0.4.40/tests/test_sanitise.py +15 -2
  89. anemoi_utils-0.4.40/tests/test_utils.py +121 -0
  90. anemoi_utils-0.4.5/.github/CODEOWNERS +0 -6
  91. anemoi_utils-0.4.5/.github/workflows/changelog-pr-update.yml +0 -18
  92. anemoi_utils-0.4.5/.github/workflows/changelog-release-update.yml +0 -36
  93. anemoi_utils-0.4.5/.github/workflows/ci.yml +0 -43
  94. anemoi_utils-0.4.5/.github/workflows/python-publish.yml +0 -27
  95. anemoi_utils-0.4.5/.github/workflows/python-pull-request.yml +0 -23
  96. anemoi_utils-0.4.5/.gitignore +0 -189
  97. anemoi_utils-0.4.5/.readthedocs.yaml +0 -16
  98. anemoi_utils-0.4.5/CHANGELOG.md +0 -87
  99. anemoi_utils-0.4.5/CONTRIBUTORS.md +0 -13
  100. anemoi_utils-0.4.5/README.md +0 -42
  101. anemoi_utils-0.4.5/docs/_static/logo.png +0 -0
  102. anemoi_utils-0.4.5/docs/modules/config.rst +0 -8
  103. anemoi_utils-0.4.5/src/anemoi/utils/_version.py +0 -16
  104. anemoi_utils-0.4.5/src/anemoi/utils/caching.py +0 -74
  105. anemoi_utils-0.4.5/src/anemoi/utils/checkpoints.py +0 -248
  106. anemoi_utils-0.4.5/src/anemoi/utils/cli.py +0 -160
  107. anemoi_utils-0.4.5/src/anemoi/utils/config.py +0 -378
  108. anemoi_utils-0.4.5/src/anemoi/utils/hindcasts.py +0 -42
  109. anemoi_utils-0.4.5/src/anemoi/utils/registry.py +0 -129
  110. anemoi_utils-0.4.5/src/anemoi/utils/remote/__init__.py +0 -328
  111. anemoi_utils-0.4.5/src/anemoi/utils/remote/s3.py +0 -386
  112. anemoi_utils-0.4.5/src/anemoi/utils/remote/ssh.py +0 -133
  113. anemoi_utils-0.4.5/src/anemoi/utils/timer.py +0 -74
  114. anemoi_utils-0.4.5/tests/test_utils.py +0 -60
  115. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/.gitattributes +0 -0
  116. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/.github/ci-hpc-config.yml +0 -0
  117. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/_static/style.css +0 -0
  118. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/_templates/.gitkeep +0 -0
  119. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/installing.rst +0 -0
  120. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/modules/checkpoints.rst +0 -0
  121. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/modules/dates.rst +0 -0
  122. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/modules/grib.rst +0 -0
  123. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/modules/humanize.rst +0 -0
  124. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/modules/provenance.rst +0 -0
  125. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/modules/s3.rst +0 -0
  126. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/docs/modules/text.rst +0 -0
  127. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/setup.cfg +0 -0
  128. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/mars/mars.yaml +0 -0
  129. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi/utils/sanitize.py +0 -0
  130. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi_utils.egg-info/dependency_links.txt +0 -0
  131. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi_utils.egg-info/entry_points.txt +0 -0
  132. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/src/anemoi_utils.egg-info/top_level.txt +0 -0
  133. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test-transfer-data/directory/b/c/x +0 -0
  134. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test-transfer-data/directory/b/y +0 -0
  135. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test-transfer-data/directory/exotic filename ;^/"'[=.,#]()/303/252/303/274/303/247/303/262/342/234/205.txt" +0 -0
  136. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test-transfer-data/directory/z +0 -0
  137. {anemoi_utils-0.4.5 → anemoi_utils-0.4.40}/tests/test-transfer-data/file +0 -0
@@ -0,0 +1,7 @@
1
+ # Workflows
2
+ /.github/ @ecmwf/AnemoiSecurity
3
+
4
+ # Project configs
5
+ /pyproject.toml @ecmwf/AnemoiSecurity
6
+ /.pre-commit-config.yaml @ecmwf/AnemoiSecurity
7
+ /.release-please-config.json @ecmwf/AnemoiSecurity
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ # - package-ecosystem: "github-actions"
8
+ # directory: "/"
9
+ # schedule:
10
+ # interval: "monthly"
@@ -0,0 +1,43 @@
1
+ # This is the configuration file for the labeler action.
2
+ # It assigns labels to pull requests based on the files changed in the PR.
3
+ # See more here: https://github.com/actions/labeler
4
+ dependencies:
5
+ - changed-files:
6
+ - any-glob-to-any-file:
7
+ - "**/requirements.txt"
8
+ - "**/setup.py"
9
+ - "**/pyproject.toml"
10
+ - "**/Pipfile"
11
+ - "**/Pipfile.lock"
12
+ - "**/requirements/*.txt"
13
+ - "**/requirements/*.in"
14
+
15
+ documentation:
16
+ - changed-files:
17
+ - any-glob-to-any-file:
18
+ - "**/docs/**/*"
19
+ - "*.md"
20
+ - "*.rst"
21
+
22
+ config:
23
+ - changed-files:
24
+ - any-glob-to-any-file:
25
+ - "**/src/**/config/**/*"
26
+ - "**/src/anemoi/inference/config.py"
27
+
28
+ CI/CD:
29
+ - changed-files:
30
+ - any-glob-to-any-file:
31
+ - "**/.pre-commit-config.yaml"
32
+ - ".github/**/*"
33
+ - "tox.ini"
34
+ - ".coveragerc"
35
+
36
+ tests:
37
+ - changed-files:
38
+ - any-glob-to-any-file:
39
+ - "**/tests/**/*"
40
+ - "**/test/**/*"
41
+ - "**/test_*.py"
42
+ - "**/test.py"
43
+ - "**/conftest.py"
@@ -0,0 +1,15 @@
1
+ ## Description
2
+ <!-- What issue or task does this change relate to? -->
3
+
4
+ ## What problem does this change solve?
5
+ <!-- Describe if it's a bugfix, new feature, doc update, or breaking change -->
6
+
7
+ ## What issue or task does this change relate to?
8
+ <!-- link to Issue Number -->
9
+
10
+ ## Additional notes ##
11
+ <!-- Include any additional information, caveats, or considerations that the reviewer should be aware of. -->
12
+
13
+ ***As a contributor to the Anemoi framework, please ensure that your changes include unit tests, updates to any affected dependencies and documentation, and have been tested in a parallel setting (i.e., with multiple GPUs). As a reviewer, you are also responsible for verifying these aspects and requesting changes if they are not adequately addressed. For guidelines about those please refer to https://anemoi.readthedocs.io/en/latest/***
14
+
15
+ By opening this pull request, I affirm that all authors agree to the [Contributor License Agreement.](https://github.com/ecmwf/codex/blob/main/Legal/contributor_license_agreement.md)
@@ -0,0 +1,60 @@
1
+ # This workflow triggers tests on dependent packages.
2
+ # The dependency tree itself is defined in ecmwf/downstream-ci/
3
+ name: Test downstream dependent packages
4
+
5
+ on:
6
+ # Trigger the workflow on push to main or develop, except tag creation
7
+ push:
8
+ branches:
9
+ - 'main'
10
+ - 'develop'
11
+ tags-ignore:
12
+ - '**'
13
+ paths-ignore:
14
+ - "docs/**"
15
+ - "CHANGELOG.md"
16
+ - "README.md"
17
+
18
+ # Trigger the workflow on pull request
19
+ pull_request:
20
+ paths-ignore:
21
+ - "docs/**"
22
+ - "CHANGELOG.md"
23
+ - "README.md"
24
+
25
+ # Trigger the workflow manually
26
+ workflow_dispatch: ~
27
+
28
+ # Trigger after public PR approved for CI
29
+ pull_request_target:
30
+ types: [labeled]
31
+ paths-ignore:
32
+ - "docs/**"
33
+ - "CHANGELOG.md"
34
+ - "README.md"
35
+
36
+ jobs:
37
+ # Run CI including downstream packages on self-hosted runners
38
+ downstream-ci:
39
+ name: downstream-ci
40
+ if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
41
+ uses: ecmwf/downstream-ci/.github/workflows/downstream-ci.yml@main
42
+ with:
43
+ anemoi-utils: ecmwf/anemoi-utils@${{ github.event.pull_request.head.sha || github.sha }}
44
+ codecov_upload: true
45
+ # Only run on fedora
46
+ skip_matrix_jobs: |
47
+ gnu@debian-11
48
+ gnu@rocky-8.6
49
+ clang@rocky-8.6
50
+ gnu@ubuntu-22.04
51
+ secrets: inherit
52
+
53
+ # # Build downstream packages on HPC
54
+ # downstream-ci-hpc:
55
+ # name: downstream-ci-hpc
56
+ # if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
57
+ # uses: ecmwf/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
58
+ # with:
59
+ # anemoi-utils: ecmwf/anemoi-utils@${{ github.event.pull_request.head.sha || github.sha }}
60
+ # secrets: inherit
@@ -0,0 +1,22 @@
1
+ # This workflow ensures that the PR title follows the Conventional Commit format.
2
+ name: "[PR] Ensure Conventional Commit Title"
3
+
4
+ on:
5
+ pull_request_target:
6
+ types:
7
+ - opened
8
+ - edited
9
+ - synchronize
10
+ - reopened
11
+
12
+ permissions:
13
+ pull-requests: read
14
+
15
+ jobs:
16
+ main:
17
+ name: Validate PR title
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: amannn/action-semantic-pull-request@v5
21
+ env:
22
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,66 @@
1
+ # This workflow checks that the appropriate ATS labels are applied to a pull request:
2
+ # - "ATS Approval Not Needed": pass
3
+ # - "ATS Approved": pass
4
+ # - "ATS Approval Needed": fail
5
+ # - Missing ATS label: fail
6
+
7
+ name: "[PR] ATS labels"
8
+
9
+ on:
10
+ pull_request:
11
+ types:
12
+ - opened
13
+ - edited
14
+ - reopened
15
+ - labeled
16
+ - unlabeled
17
+ - synchronize
18
+
19
+ permissions:
20
+ pull-requests: read
21
+
22
+ jobs:
23
+ check:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Get PR details
27
+ uses: actions/github-script@v7
28
+ id: check-pr
29
+ with:
30
+ script: |
31
+ const pr = await github.rest.pulls.get({
32
+ owner: context.repo.owner,
33
+ repo: context.repo.repo,
34
+ pull_number: context.payload.pull_request.number,
35
+ });
36
+ const labels = pr.data.labels.map(label => label.name);
37
+ core.setOutput('labels', JSON.stringify(labels));
38
+ core.setOutput('author', context.payload.pull_request.user.login);
39
+
40
+ - name: Evaluate ATS labels
41
+ run: |
42
+ AUTHOR='${{ steps.check-pr.outputs.author }}'
43
+ if [ "$AUTHOR" == "DeployDuck" ] || [ "$AUTHOR" == "pre-commit-ci[bot]" ]; then
44
+ echo "Bot PR, skipping."
45
+ exit 0
46
+ fi
47
+ LABELS=$(echo '${{ steps.check-pr.outputs.labels }}' | jq -r '.[]')
48
+ echo "Labels found:"
49
+ echo -e "$LABELS\n"
50
+ echo "Result:"
51
+ if echo "$LABELS" | grep -qi "ATS approval not needed"; then
52
+ echo "ATS approval not needed. Passing."
53
+ EXIT_CODE=0
54
+ elif echo "$LABELS" | grep -qi "ATS approved"; then
55
+ echo "ATS Approved. Passing."
56
+ EXIT_CODE=0
57
+ elif echo "$LABELS" | grep -qi "ATS approval needed"; then
58
+ echo "ATS Approval Needed. Failing."
59
+ EXIT_CODE=1
60
+ else
61
+ echo "No ATS approval labels found. Please assign the appropriate ATS label. Failing."
62
+ EXIT_CODE=1
63
+ fi
64
+ echo -e "\nFor more information on ATS labels, see:"
65
+ echo "https://anemoi.readthedocs.io/en/latest/contributing/guidelines.html#labelling-guidelines"
66
+ exit $EXIT_CODE
@@ -0,0 +1,48 @@
1
+ # This workflow assigns labels to a pull request based on the Conventional Commits format.
2
+ # This is necessary for release-please to work properly.
3
+ name: "[PR] Label Conventional Commits"
4
+
5
+ on:
6
+ pull_request:
7
+ branches: [main]
8
+ types:
9
+ [opened, reopened, labeled, unlabeled]
10
+
11
+ permissions:
12
+ pull-requests: write
13
+
14
+ jobs:
15
+ assign-labels:
16
+ runs-on: ubuntu-latest
17
+ name: Assign labels in pull request
18
+ if: github.event.pull_request.merged == false
19
+ steps:
20
+ - uses: actions/checkout@v3
21
+ - name: Assign labels from Conventional Commits
22
+ id: action-assign-labels
23
+ uses: mauroalderete/action-assign-labels@v1
24
+ with:
25
+ pull-request-number: ${{ github.event.pull_request.number }}
26
+ github-token: ${{ secrets.GITHUB_TOKEN }}
27
+ conventional-commits: |
28
+ conventional-commits:
29
+ - type: 'fix'
30
+ nouns: ['FIX', 'Fix', 'fix', 'FIXED', 'Fixed', 'fixed']
31
+ labels: ['bug']
32
+ - type: 'feature'
33
+ nouns: ['FEATURE', 'Feature', 'feature', 'FEAT', 'Feat', 'feat']
34
+ labels: ['enhancement']
35
+ - type: 'breaking_change'
36
+ nouns: ['BREAKING CHANGE', 'BREAKING', 'MAJOR']
37
+ labels: ['breaking change']
38
+ - type: 'documentation'
39
+ nouns: ['doc','docs','docu','document','documentation']
40
+ labels: ['documentation']
41
+ - type: 'build'
42
+ nouns: ['build','rebuild','ci']
43
+ labels: ['CI/CD']
44
+ - type: 'config'
45
+ nouns: ['config', 'conf', 'configuration']
46
+ labels: ['config']
47
+ maintain-labels-not-matched: true
48
+ apply-changes: true
@@ -0,0 +1,17 @@
1
+ # This workflow assigns labels to a pull request based on the files changed in the PR.
2
+ # The labels are defined in the `.github/labels.yml` file.
3
+ name: "[PR] Label File-based"
4
+ on:
5
+ pull_request_target:
6
+ types: [opened, synchronize]
7
+
8
+ permissions:
9
+ contents: read
10
+ pull-requests: write
11
+
12
+ jobs:
13
+ labeler:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Assign labels from file changes
17
+ uses: actions/labeler@v5
@@ -1,5 +1,5 @@
1
1
  # Manage labels of pull requests that originate from forks
2
- name: label-public-pr
2
+ name: "[PR] Label Forks"
3
3
 
4
4
  on:
5
5
  pull_request_target:
@@ -7,4 +7,4 @@ on:
7
7
 
8
8
  jobs:
9
9
  label:
10
- uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2
10
+ uses: ecmwf/reusable-workflows/.github/workflows/label-pr.yml@v2
@@ -0,0 +1,13 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
+
4
+ name: Upload Python Package to PyPI
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+
10
+ jobs:
11
+ deploy:
12
+ uses: ecmwf/reusable-workflows/.github/workflows/cd-pypi.yml@v2
13
+ secrets: inherit
@@ -0,0 +1,25 @@
1
+ # This workflow runs pre-commit checks and pytest tests against multiple platforms and Python versions.
2
+ name: Code Quality and Testing
3
+
4
+ on:
5
+ pull_request:
6
+ types: [opened, synchronize, reopened]
7
+ push:
8
+ branches:
9
+ - main
10
+ schedule:
11
+ - cron: "9 2 * * 0" # at 9:02 on sunday
12
+
13
+ jobs:
14
+ quality:
15
+ uses: ecmwf/reusable-workflows/.github/workflows/qa-precommit-run.yml@v2
16
+ with:
17
+ skip-hooks: "no-commit-to-branch"
18
+
19
+ checks:
20
+ strategy:
21
+ matrix:
22
+ python-version: ["3.10", "3.11", "3.12"]
23
+ uses: ecmwf/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
@@ -1,4 +1,6 @@
1
- name: Read the Docs PR Preview
1
+ # This workflow adds a link to the experimental documentation build to the PR.
2
+ # This does NOT trigger a build of the documentation, this is handled through webhooks.
3
+ name: "[PR] Read the Docs Preview"
2
4
  on:
3
5
  pull_request_target:
4
6
  types:
@@ -0,0 +1,28 @@
1
+ # This workflow uses an action to run Release Please to create a release PR.
2
+ # It is governed by the config and manifest in the root of the repo.
3
+ # For more information see: https://github.com/googleapis/release-please
4
+ name: Run Release Please
5
+ on:
6
+ push:
7
+ branches:
8
+ - main
9
+ - hotfix/*
10
+
11
+ permissions:
12
+ contents: write
13
+ pull-requests: write
14
+
15
+ jobs:
16
+ release-please:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: googleapis/release-please-action@v4
20
+ with:
21
+ # this assumes that you have created a personal access token
22
+ # (PAT) and configured it as a GitHub action secret named
23
+ # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
24
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
25
+ # optional. customize path to .release-please-config.json
26
+ config-file: .release-please-config.json
27
+ # Currently releases are done from main
28
+ target-branch: ${{ github.ref_name }}
@@ -0,0 +1,148 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ __pypackages__/
8
+
9
+ # Distribution / packaging
10
+ build/
11
+ develop-eggs/
12
+ dist/
13
+ downloads/
14
+ eggs/
15
+ .eggs/
16
+ lib/
17
+ lib64/
18
+ parts/
19
+ sdist/
20
+ var/
21
+ wheels/
22
+ share/python-wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ MANIFEST
27
+
28
+ # Testing and coverage
29
+ htmlcov/
30
+ .tox/
31
+ .nox/
32
+ .coverage
33
+ .coverage.*
34
+ .cache
35
+ nosetests.xml
36
+ coverage.xml
37
+ *.cover
38
+ *.py,cover
39
+ .hypothesis/
40
+ .pytest_cache/
41
+ cover/
42
+
43
+ # Documentation
44
+ docs/_build/
45
+ docs/_api/
46
+ /site
47
+ *.mo
48
+ *.pot
49
+
50
+ # Environments
51
+ .env
52
+ .envrc
53
+ .venv
54
+ env/
55
+ venv/
56
+ ENV/
57
+ env.bak/
58
+ venv.bak/
59
+
60
+ # IDEs
61
+ .idea/
62
+ .spyderproject
63
+ .spyproject
64
+ .ropeproject
65
+ .vscode/
66
+ *.code-workspace
67
+ *.sublime-project
68
+ *.sublime-workspace
69
+
70
+ # Jupyter Notebook
71
+ .ipynb_checkpoints
72
+
73
+ # Type checking
74
+ .mypy_cache/
75
+ .dmypy.json
76
+ dmypy.json
77
+ .pyre/
78
+ .pytype/
79
+
80
+ # Data files
81
+ *.grib
82
+ *.grib1
83
+ *.grib2
84
+ *.onnx
85
+ *.ckpt
86
+ *.npy
87
+ *.npz
88
+ *.zarr/
89
+ *.nc
90
+ *.h5
91
+ *.hdf5
92
+ *.pkl
93
+ *.parquet
94
+ *.csv
95
+ *.xlsx
96
+ *.xls
97
+ *.json
98
+ *.txt
99
+ *.zip
100
+ *.db
101
+ *.tgz
102
+
103
+ # ML artifacts
104
+ wandb/
105
+ mlruns/
106
+ lightning_logs/
107
+ *.ckpt
108
+ *.pt
109
+ *.pth
110
+ runs/
111
+ checkpoints/
112
+
113
+ # Temporary and system files
114
+ *.swp
115
+ *.download
116
+ *.out
117
+ *.sync
118
+ *.dot
119
+ *.tmp
120
+ *.log
121
+ *.log.*
122
+ .DS_Store
123
+ ~*
124
+ tmp/
125
+ temp/
126
+ logs/
127
+ _dev/
128
+ _api/
129
+ ./outputs
130
+ *tmp_data/
131
+
132
+ # Project specific
133
+ ?
134
+ ?.*
135
+ foo
136
+ bar
137
+ ~$images.pptx
138
+ test.py
139
+ test.ipynb
140
+ _version.py
141
+ *.to_upload
142
+ tempCodeRunnerFile.python
143
+ Untitled-*.py
144
+ trace.txt
145
+ ?/
146
+ *.prof
147
+ prof/
148
+ *.gz
@@ -10,7 +10,7 @@ repos:
10
10
  entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
11
11
  additional_dependencies: [jupyter]
12
12
  - repo: https://github.com/pre-commit/pre-commit-hooks
13
- rev: v5.0.0
13
+ rev: v6.0.0
14
14
  hooks:
15
15
  - id: check-yaml # Check YAML files for syntax errors only
16
16
  args: [--unsafe, --allow-multiple-documents]
@@ -20,37 +20,37 @@ repos:
20
20
  - id: no-commit-to-branch # Prevent committing to main / master
21
21
  - id: check-added-large-files # Check for large files added to git
22
22
  - id: check-merge-conflict # Check for files that contain merge conflict
23
- - repo: https://github.com/pre-commit/pygrep-hooks
24
- rev: v1.10.0 # Use the ref you want to point at
25
- hooks:
26
- - id: python-use-type-annotations # Check for missing type annotations
27
- - id: python-check-blanket-noqa # Check for # noqa: all
28
- - id: python-no-log-warn # Check for log.warn
23
+ - repo: https://github.com/pre-commit/pygrep-hooks
24
+ rev: v1.10.0 # Use the ref you want to point at
25
+ hooks:
26
+ - id: python-use-type-annotations # Check for missing type annotations
27
+ - id: python-check-blanket-noqa # Check for # noqa: all
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.11.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: 7.0.0
36
36
  hooks:
37
37
  - id: isort
38
38
  args:
39
39
  - -l 120
40
40
  - --force-single-line-imports
41
41
  - --profile black
42
+ - --project anemoi
42
43
  - repo: https://github.com/astral-sh/ruff-pre-commit
43
- rev: v0.7.2
44
+ rev: v0.14.7
44
45
  hooks:
45
46
  - id: ruff
46
47
  args:
47
48
  - --line-length=120
48
49
  - --fix
49
50
  - --exit-non-zero-on-fix
50
- - --preview
51
51
  - --exclude=docs/**/*_.py
52
52
  - repo: https://github.com/sphinx-contrib/sphinx-lint
53
- rev: v1.0.0
53
+ rev: v1.0.2
54
54
  hooks:
55
55
  - id: sphinx-lint
56
56
  # For now, we use it. But it does not support a lot of sphinx features
@@ -58,29 +58,28 @@ repos:
58
58
  rev: v0.0.14
59
59
  hooks:
60
60
  - id: rstfmt
61
- exclude: 'cli/.*' # Because we use argparse
61
+ exclude: '(cli|schemas)/.*' # Because we use argparse and pydantic sphinx directives
62
62
  - repo: https://github.com/b8raoult/pre-commit-docconvert
63
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.11.1"
69
69
  hooks:
70
70
  - id: pyproject-fmt
71
- - repo: https://github.com/jshwi/docsig # Check docstrings against function sig
72
- rev: v0.64.0
73
- hooks:
74
- - id: docsig
75
- args:
76
- - --ignore-no-params # Allow docstrings without parameters
77
- - --check-dunders # Check dunder methods
78
- - --check-overridden # Check overridden methods
79
- - --check-protected # Check protected methods
80
- - --check-class # Check class docstrings
81
- - --disable=E113 # Disable empty docstrings
82
- - --summary # Print a summary
83
- ci:
84
- autoupdate_schedule: monthly
71
+ args: ["--max-supported-python", "3.12"]
72
+ - repo: https://github.com/jshwi/docsig # Check docstrings against function sig
73
+ rev: v0.71.0
74
+ hooks:
75
+ - id: docsig
76
+ args:
77
+ - --ignore-no-params # Allow docstrings without parameters
78
+ - --check-dunders # Check dunder methods
79
+ - --check-overridden # Check overridden methods
80
+ - --check-protected # Check protected methods
81
+ - --check-class # Check class docstrings
82
+ - --disable=SIG101,SIG102 # Disable empty docstrings
85
83
  ci:
86
84
  autoupdate_schedule: monthly
85
+ autoupdate_commit_msg: "chore(deps): pre-commit.ci autoupdate"
@@ -0,0 +1,19 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-22.04
5
+ tools:
6
+ python: "3.11"
7
+ jobs:
8
+ pre_build:
9
+ - bash docs/scripts/api_build.sh
10
+
11
+ sphinx:
12
+ configuration: docs/conf.py
13
+
14
+ python:
15
+ install:
16
+ - method: pip
17
+ path: .
18
+ extra_requirements:
19
+ - docs