Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First release #9

Merged
merged 114 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
2e0d7dc
Start fresh
gmertes Jul 31, 2024
01a4275
Copy diagnostics/continents.json
gmertes Jul 31, 2024
af83b7a
copy config/data/zarr.yaml
JesperDramsch Jul 31, 2024
7bda8dc
copy config/dataloader/default.yaml to native_grid.yaml
JesperDramsch Jul 31, 2024
f948308
chore: copy daata/datamodule.py
theissenhelen Jul 31, 2024
7fcaf43
chore: copy data/dataset.py
theissenhelen Jul 31, 2024
201b5c4
chore: copy data/scaling.py
theissenhelen Jul 31, 2024
924f31a
Copy diagnostics/maps.py
gmertes Jul 31, 2024
9178606
Copy diagnostics/logging.py
gmertes Jul 31, 2024
f8ed0c2
Copy diagnostics/plots.py
gmertes Jul 31, 2024
53627a0
Copy diagnostics/callbacks.py into its own module
gmertes Jul 31, 2024
1d97735
Create losses dir
gmertes Jul 31, 2024
207f3fe
Copy losses/mse.py
gmertes Jul 31, 2024
3ecf92c
Copy losses/utils.py
gmertes Jul 31, 2024
ca9b1ee
chore: copy distributed/strategy.py
theissenhelen Jul 31, 2024
75334ad
copy config/diagnostics/eval_rollout.yaml
JesperDramsch Jul 31, 2024
836a7d6
copy config/graph/default.yaml
JesperDramsch Jul 31, 2024
60bc42d
copy config/graph/multi_scale.yaml
JesperDramsch Jul 31, 2024
758312d
copy config/diagnostics/eval_rollout.yaml
JesperDramsch Jul 31, 2024
322605a
copy config/hardware/example.yaml
JesperDramsch Jul 31, 2024
86b695d
copy config/hardware/files/example.yaml
JesperDramsch Jul 31, 2024
a445dce
copy config/hardware/paths/example.yaml
JesperDramsch Jul 31, 2024
b071ab3
copy config/model/gnn.yaml
JesperDramsch Jul 31, 2024
129f566
copy config/model/graphtransformer.yaml
JesperDramsch Jul 31, 2024
b5af97b
copy config/model/transformer.yaml
JesperDramsch Jul 31, 2024
48cd31f
copy config/training/default.yaml
JesperDramsch Jul 31, 2024
f5b9c8b
copy config/config.yaml
JesperDramsch Jul 31, 2024
9ae3358
copy config/debug.yaml
JesperDramsch Jul 31, 2024
b202d99
chore: copy train/forecaster.py
theissenhelen Jul 31, 2024
487d7d6
chore: copy train/train.py
theissenhelen Jul 31, 2024
8b4bd0b
Copy utils/seeding.py
gmertes Jul 31, 2024
c199bc6
Copy utils/config.py
gmertes Jul 31, 2024
5d9769d
Rename AIFS_BASE_SEED -> ANEMOI_BASE_SEED
gmertes Jul 31, 2024
ec6a374
Copy utils/jsonify.py
gmertes Jul 31, 2024
da5fd45
copy hydra_plugins
JesperDramsch Jul 31, 2024
999a224
Fix missing mlflow.authentication config entry
gmertes Jul 31, 2024
404a5e6
feat: store fromatted metadata in lightning checkpoint
theissenhelen Aug 1, 2024
bb890ea
Delete hello command
gmertes Aug 1, 2024
b5532b1
Copy utils/checkpoint.py
gmertes Aug 1, 2024
3f8439c
Save checkpoint metadata with anemoi.utils
gmertes Aug 1, 2024
ce66914
Add checkpoint command
gmertes Aug 1, 2024
c43ab56
feat: add changelog
theissenhelen Aug 1, 2024
69b76a6
Better checkpoint metavar
gmertes Aug 1, 2024
10dc231
copy commands/train.py
theissenhelen Aug 1, 2024
76266db
Copy pytest
gmertes Aug 1, 2024
7328a98
Fix metadata
gmertes Aug 1, 2024
692006d
refactor: basic logging / anemoi utils
JesperDramsch Aug 1, 2024
4f5e01b
refactor: hydra log level
JesperDramsch Aug 1, 2024
f167df2
Merge branch 'first-release-hydra-logging' into first-release
JesperDramsch Aug 1, 2024
af5bf7a
Move TokenAuth import out of global scope
gmertes Aug 1, 2024
bd0edd9
Copy tests/diagnostics/test_checkpoint.py
gmertes Aug 2, 2024
40d2098
Fix test_checkpoint.py
gmertes Aug 2, 2024
f300d15
Use tmp_path_factory fixture
gmertes Aug 2, 2024
118550f
Copy tests/hydra/test_search_path_plugins.py
gmertes Aug 2, 2024
4d444e1
Fix test_checkpoint.py on macos runner
gmertes Aug 2, 2024
4cf23f6
feature: training subcommand
JesperDramsch Aug 2, 2024
b493b04
fix: anemoi search path hierarchy
JesperDramsch Aug 2, 2024
466ef9e
feat: add pre-commit and ruff rulesets
JesperDramsch Aug 2, 2024
91f88d9
chore: update ruff
JesperDramsch Aug 2, 2024
1e98132
fix: searchpath plugin
JesperDramsch Aug 2, 2024
abf9272
ci: changelog pr update check
theissenhelen Aug 2, 2024
dc3c5d4
chore: fix pre-commit hooks
JesperDramsch Aug 2, 2024
1948808
fix: add all to dev
JesperDramsch Aug 2, 2024
55c92f0
fix: graph config -> multi_scale
JesperDramsch Aug 2, 2024
223deea
feat: subcommand config generator
JesperDramsch Aug 2, 2024
7916ffa
fix: non-global import
JesperDramsch Aug 2, 2024
fa2c11f
fix: method complexity
JesperDramsch Aug 2, 2024
9790fa2
fix: allow boolean functions
JesperDramsch Aug 2, 2024
f85b4f0
Copy tests/train/test_loss_scaling.py
gmertes Aug 5, 2024
bcf715b
fix: mlflow auth logger
gmertes Aug 5, 2024
18906f2
fix: mlflow auth enabled
gmertes Aug 5, 2024
70a68b6
chore: mlflow auth formatting
gmertes Aug 5, 2024
ed99c7b
fix: mlflow auth tests
gmertes Aug 5, 2024
e85c326
refactor: smaller ruff ruleset and code adjustments to match
JesperDramsch Aug 6, 2024
3965080
fix: rename logging to avoid namespace collision
JesperDramsch Aug 6, 2024
f072c03
chore: add outputs to .gitignore
gmertes Aug 6, 2024
7bf8eac
chore: rename anything AIFS to Anemoi
gmertes Aug 6, 2024
624f2a5
fix: missing config values
gmertes Aug 6, 2024
1a17903
fix: commands import
gmertes Aug 6, 2024
cbf64dd
chore: add pytest typehints
JesperDramsch Aug 6, 2024
8ef2af4
chore: add conventional commits to pre-commit hooks
JesperDramsch Aug 6, 2024
8e2fff5
chore: add dev dependencies
JesperDramsch Aug 6, 2024
2c6fdab
fix: ruff exclude docs
gmertes Aug 6, 2024
541ad3f
docs: ecml who?
JesperDramsch Aug 6, 2024
9307047
chore: copy and lint utils/mlflow_sync.py
gmertes Aug 6, 2024
d8f29d3
fix: config command help
gmertes Aug 7, 2024
e7236b4
fix: checkpoint command help
gmertes Aug 7, 2024
c239ff0
feat: mlflow sync command
gmertes Aug 7, 2024
b355b06
fix: changelog conflict
gmertes Aug 7, 2024
2720169
fix: the real changelog conflict
gmertes Aug 7, 2024
9ad35f1
feat: mlflow login use url from config
gmertes Aug 7, 2024
4317138
chore: update dependencies
gmertes Aug 7, 2024
c59a8ab
ci: add label public pr check
theissenhelen Aug 7, 2024
9001bfd
ci: add readthedocs PR update check
theissenhelen Aug 7, 2024
cb675eb
ci: add downstream ci
theissenhelen Aug 7, 2024
9e40b2f
ci: inherit pypi publish flow
theissenhelen Aug 7, 2024
354e87a
ci: add ci config file
theissenhelen Aug 7, 2024
8eb79ab
ci: fix typo
theissenhelen Aug 7, 2024
2668665
fix: serialise config with missing values
gmertes Aug 7, 2024
d4b704a
ci: run downstream ci only for changes in src and tests
theissenhelen Aug 8, 2024
69b0469
chore(configs): fix tp value to 0.025
theissenhelen Aug 8, 2024
9156f97
ci: switch to main in downstream ci
theissenhelen Aug 8, 2024
921c11c
ci: update changelog on release
theissenhelen Aug 8, 2024
b9b15e2
fix: save training checkpoint metadata on rank zero
gmertes Aug 8, 2024
1fe6465
ci: only run downstream-ci on changes in src and test
theissenhelen Aug 9, 2024
36e64de
ci: add release heading to changelog action
theissenhelen Aug 9, 2024
177033e
ci: add binary dependencies
theissenhelen Aug 9, 2024
af8f455
ci: run downstream ci for changes in src and tests
theissenhelen Aug 9, 2024
2893b66
docs: update changelog with changes since kick-off
JesperDramsch Aug 9, 2024
4a2e67d
chore: update changelog
gmertes Aug 9, 2024
754d15b
docs: more changes
JesperDramsch Aug 9, 2024
f06e0f6
chore: rename default graph config
JesperDramsch Aug 9, 2024
706a455
fix: correct config in debug
JesperDramsch Aug 9, 2024
d7aaf07
ci: bump version
JesperDramsch Aug 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/ci-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies: |
ecmwf/ecbuild
MathisRosenhauer/libaec@master
ecmwf/eccodes
ecmwf/eckit
ecmwf/odc
dependency_branch: develop
parallelism_factor: 8
self_build: false # Only for python packages
36 changes: 36 additions & 0 deletions .github/workflows/changelog-release-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# .github/workflows/update-changelog.yaml
name: "Update Changelog"

on:
release:
types: [released]

jobs:
update:
runs-on: ubuntu-latest

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# updated CHANGELOG back to the repository.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.tag_name }}
heading-text: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ github.event.release.target_commitish }}
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: ci

on:
# Trigger the workflow on push to master or develop, except tag creation
push:
branches:
- 'main'
- 'develop'
tags-ignore:
- '**'
paths:
- "src/**"
- "tests/**"

# Trigger the workflow on pull request
pull_request: ~

# Trigger the workflow manuallyp instals
workflow_dispatch: ~

# Trigger after public PR approved for CI
pull_request_target:
types: [labeled]

jobs:
# Run CI including downstream packages on self-hosted runners
downstream-ci:
name: downstream-ci
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main
with:
anemoi-training: ecmwf/anemoi-training@${{ github.event.pull_request.head.sha || github.sha }}
codecov_upload: true
secrets: inherit

# Build downstream packages on HPC
downstream-ci-hpc:
name: downstream-ci-hpc
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
uses: ecmwf-actions/downstream-ci/.github/workflows/downstream-ci.yml@main
with:
anemoi-training: ecmwf/anemoi-training@${{ github.event.pull_request.head.sha || github.sha }}
secrets: inherit
10 changes: 10 additions & 0 deletions .github/workflows/label-public-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Manage labels of pull requests that originate from forks
name: label-public-pr

on:
pull_request_target:
types: [opened, synchronize]

jobs:
label:
uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2
27 changes: 3 additions & 24 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -48,27 +48,6 @@ jobs:
run: pytest

deploy:

if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
needs: [checks, quality]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine upload dist/*
uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2
secrets: inherit
22 changes: 22 additions & 0 deletions .github/workflows/readtthedocs-pr-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Read the Docs PR Preview
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
# Execute this action only on PRs that touch
# documentation files.
paths:
- "docs/**"

permissions:
pull-requests: write

jobs:
documentation-links:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "anemoi-training"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,4 @@ _build/
~*
*.sync
_version.py
outputs/
35 changes: 27 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ repos:
language: python
entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
additional_dependencies: [jupyter]
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand All @@ -20,8 +26,14 @@ repos:
- id: no-commit-to-branch # Prevent committing to main / master
- id: check-added-large-files # Check for large files added to git
- id: check-merge-conflict # Check for files that contain merge conflict
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0 # Use the ref you want to point at
hooks:
- id: python-use-type-annotations # Check for missing type annotations
- id: python-check-blanket-noqa # Check for # noqa: all
- id: python-no-log-warn # Check for log.warn
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
args: [--line-length=120]
Expand All @@ -34,7 +46,7 @@ repos:
- --force-single-line-imports
- --profile black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.6
rev: v0.5.6
hooks:
- id: ruff
# Next line if for documenation cod snippets
Expand All @@ -59,12 +71,19 @@ repos:
hooks:
- id: docconvert
args: ["numpy"]
- repo: https://github.com/b8raoult/optional-dependencies-all
rev: "0.0.6"
hooks:
- id: optional-dependencies-all
args: ["--inplace", "--exclude-keys=dev,docs,tests", "--group=dev=all,docs,tests"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.1.3"
rev: "2.2.1"
hooks:
- id: pyproject-fmt
- repo: https://github.com/jshwi/docsig # Check docstrings against function sig
rev: v0.60.0
hooks:
- id: docsig
args:
- --ignore-no-params # Allow docstrings without parameters
- --check-dunders # Check dunder methods
- --check-overridden # Check overridden methods
- --check-protected # Check protected methods
- --check-class # Check class docstrings
- --disable=E113 # Disable empty docstrings
- --summary # Print a summary
68 changes: 58 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,67 @@
# Changelog

All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Please add your functional changes to the appropriate section in the PR.
Keep it human-readable, your future self will thank you!
Please add your functional changes to the appropriate section in the PR.
Keep it human-readable, your future self will thank you!

## [Unreleased]
## [Unreleased]

### Added
- MLflow token authentication
### Added

#### Subcommands
- Subcommand for training `anemoi-training train`
- Subcommand for config generation of configs
- Subcommand for mlflow: login and sync
- Subcommand for checkpoint handling

#### Functionality
- Searchpaths for Hydra configs, to enable configs in CWD, `ANEMOI_CONFIG_PATH` env, and `.config/anemoi/training` in addition to package defaults
- MlFlow token authentication
- Configurable pressure level scaling

#### Continuous Integration / Deployment
- Downstream CI to test all dependencies with changes
- Changelog Status check
- Readthedocs PR builder
- Changelog Release Updater Workflow

#### Miscellaneous
- Extended ruff Ruleset
- Added Docsig pre-commit hook
- `__future__` annotations for typehints
- Added Typehints where missing
- Added Changelog

### Changed
### Changed

#### Move to Anemoi Ecosystem
- Fixed PyPI packaging
- Use of Anemoi models
- Use of Anemoi graphs
- Adjusted tests to work with new Anemoi ecosystem
- Adjusted configs to reasonable common defaults

#### Functionality
- Changed hardware-specific keys from configs to `???` to trigger "missing"
- `__len__` of NativeGridDataset
- Configurable dropout in attention layer

#### Docs
- Fixed docstrings

#### Miscellaneous
- Moved callbacks into folder to fascilitate future refactor
- Adjusted PyPI release infrastructure to common ECMWF workflow
- Bumped versions in Pre-commit hooks

### Removed
- Dependency on mlflow-export-import
- Specific user configs

<!-- Add Git Diffs for Links above -->

### Removed
[unreleased]: https://github.com/ecmwf/anemoi-training/compare/x.x.x...HEAD
7 changes: 2 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@
author = "ECMWF"

year = datetime.datetime.now().year
if year == 2024:
years = "2024"
else:
years = "2024-%s" % (year,)
years = "2024" if year == 2024 else f"2024-{year}"

copyright = "%s, ECMWF" % (years,)
copyright = f"{years}, ECMWF"


try:
Expand Down
Loading
Loading