Skip to content

Write selected channels during inference - #3

Open
sbAsma wants to merge 28 commits into
SavvasMel:develop-hclimrepfrom
sbAsma:sbAsma/dev/1705-write-selected-channels
Open

Write selected channels during inference#3
sbAsma wants to merge 28 commits into
SavvasMel:develop-hclimrepfrom
sbAsma:sbAsma/dev/1705-write-selected-channels

Conversation

@sbAsma

@sbAsma sbAsma commented Sep 2, 2026

Copy link
Copy Markdown

Description (Edited)

Changes in config/default_config.yml:

Added a new filed in output to filter channels.

Changes in src/weathergen/utils/validation_io.py

Filtering of the channels

To run with:

uv run --offline inference --from-run-id $run_id --options test_config.samples_per_mini_epoch=1 validation_config.output.channels.ERA5=["2t"] validation_config.output.num_samples=1

The output zarr file has the tree:

>>> print(root.tree())

/
└── 0
    └── ERA5
        ├── 0
        │   └── source
        │       ├── coords (40320, 2) float32
        │       ├── data (40320, 71) float32
        │       ├── geoinfo (40320, 0) float32
        │       └── times (40320,) datetime64
        ├── 1
        │   ├── prediction
        │   │   ├── coords (40320, 2) float32
        │   │   ├── data (40320, 1, 1) float32
        │   │   ├── geoinfo (40320, 0) float32
        │   │   └── times (40320,) datetime64
        │   └── target
        │       ├── coords (40320, 2) float32
        │       ├── data (40320, 1) float32
        │       ├── geoinfo (40320, 0) float32
        │       └── times (40320,) datetime64
        └── 2
            ├── prediction
            │   ├── coords (40320, 2) float32
            │   ├── data (40320, 1, 1) float32
            │   ├── geoinfo (40320, 0) float32
            │   └── times (40320,) datetime64
            └── target
                ├── coords (40320, 2) float32
                ├── data (40320, 1) float32
                ├── geoinfo (40320, 0) float32
                └── times (40320,) datetime64

>>> print(dict(root["0"]["ERA5"]["1"]["target"].attrs))
{'channels': ['2t'], 'geoinfo_channels': [], 'source_interval': {'start': '2023-10-01T00:00:00.000000000', 'end': '2023-10-01T06:00:00.000000000'}}

Issue Number

Closes ecmwf#1705

Checklist before asking for review

  • I have performed a self-review of my code
  • My changes comply with basic sanity checks:
    • I have fixed formatting issues with ./scripts/actions.sh lint
    • I have run unit tests with ./scripts/actions.sh unit-test
    • I have documented my code and I have updated the docstrings.
    • I have added unit tests, if relevant
  • I have tried my changes with data and code:
    • I have run the integration tests with ./scripts/actions.sh integration-test
    • (bigger changes) I have run a full training and I have written in the comment the run_id(s): launch-slurm.py --time 60
    • (bigger changes and experiments) I have shared a hegdedoc in the github issue with all the configurations and runs for this experiments
  • I have informed and aligned with people impacted by my change:
    • for config changes: the MatterMost channels and/or a design doc
    • for changes of dependencies: the MatterMost software development channel

sbAsma and others added 28 commits March 27, 2026 09:26
parse validation output filter_output_channels from default config format
support allow or deny channel filtering per stream
introduce output_channels for written targets and predictions
read channels from zarr metadata in WeatherGenZarrReader
@sbAsma
sbAsma changed the base branch from develop to develop-hclimrep September 8, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to write selected output channels

3 participants