Skip to content

feat(filter): add irregular_to_grid#298

Draft
aaron-hopkinson wants to merge 9 commits into
mainfrom
feat/filter-irregular_to_grid
Draft

feat(filter): add irregular_to_grid#298
aaron-hopkinson wants to merge 9 commits into
mainfrom
feat/filter-irregular_to_grid

Conversation

@aaron-hopkinson

Copy link
Copy Markdown
Contributor

Description

Adds a filter irregular_to_grid (migrated from AI-DOP project @ 0058299) to support building gridded anemoi-datasets from tabular sources.

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/

By opening this pull request, I affirm that all authors agree to the Contributor License Agreement.

Comment thread src/anemoi/transform/filters/tabular/irregular_to_grid.py
Comment thread src/anemoi/transform/filters/tabular/irregular_to_grid.py Outdated

@anaprietonem anaprietonem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments! thanks a lot for implementing this Aaron!

@aaron-hopkinson aaron-hopkinson marked this pull request as draft May 27, 2026 15:51
@aaron-hopkinson

Copy link
Copy Markdown
Contributor Author

(Converting to draft while I address some issues that have been spotted - thanks @neill-b)

Notes
-----
- Grid points with no observations in the window are filled with ``NaN``
- ``spatial_index`` must be a valid integer index into the named grid.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pwlean, @pinnstorm - was this provided by the assign_to_grid code?

If so, should we:
a) not require it and calculate on demand;
b) require it but make it a configurable column name;
c) other?

(I think a); or maybe b) but if None then a))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it could be argued to be a slightly worse user experience to not calculate this automatically, I think requiring the column to already exist is in line with what we do with the rest of the filters, so in the spirit of the principle of least surprise, I think we should require this to already exist. So I'll go ahead and add a config option for the name of the column (as I could be renamed differently) - with the name that is outputted from assign_to_grid/superob as the default value.

Comment thread src/anemoi/transform/filters/tabular/irregular_to_grid.py Outdated
Comment thread src/anemoi/transform/filters/tabular/irregular_to_grid.py Outdated
@github-actions github-actions Bot added the tests label May 29, 2026
@aaron-hopkinson

This comment was marked as resolved.

@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Jun 3, 2026
aaron-hopkinson and others added 2 commits June 4, 2026 10:00
## Description

As discussed on email - use an additional column to extract the unique
date-time elements for this dataset. It is assumed that this will have
been set up when the sources was read.

## What problem does this change solve?

Tested, with and without incremental initialisation, and appears to
choose the correct set of dates for the data.

***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/***

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ATS Approval not needed dependencies Pull requests that update a dependency file tests

Projects

Status: To be triaged

Development

Successfully merging this pull request may close these issues.

3 participants