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

Support models with unconnected nodes removed from input (LAM) #95

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

dietervdb-meteo
Copy link
Contributor

@dietervdb-meteo dietervdb-meteo commented Jan 3, 2025

This PR adds support for inference from checkpoints created with models where unconnected nodes have been dropped from the input grid, see anemoi-training #171. For the moment the functionality is restricted to inference taking an anemoi-dataset as input.

The indices of those gridpoints in the dataset that remain as input for the model are stored in the checkpoint as the supporting array grid_indices. The current implementation is such that if this supporting array is present in the checkpoint then the input is automatically reduced to those points with indices listed in grid_indices.

A small update of the boundary forcing is also needed, the mask used is now (the negation of) the output_mask that can be found in relevant checkpoints.

This addresses #87

Update: also added small fix to allow for automatic loading of datasets with more complicated configurations where sub_dictionary['dataset'] is not necessarily a string, e.g. of the type

dataset:
    - dataset:
        cutout:
          - dataset: ${hardware.paths.data}/${hardware.files.lam_dataset} 
          - dataset: ${hardware.paths.data}/${hardware.files.forcing_dataset}
        adjust: all
    - dataset:
        cutout:
          - dataset: ${hardware.paths.data}/${hardware.files.lam_z_dataset}
          - dataset: ${hardware.paths.data}/${hardware.files.forcing_dataset}
        adjust: all

@dietervdb-meteo dietervdb-meteo marked this pull request as draft January 3, 2025 16:36
@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.03%. Comparing base (1187d78) to head (f8ed73e).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #95   +/-   ##
========================================
  Coverage    98.03%   98.03%           
========================================
  Files            3        3           
  Lines           51       51           
========================================
  Hits            50       50           
  Misses           1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants