Skip to content

Add CORDEX domain target grids for regridding#3096

Open
ghossh wants to merge 20 commits into
mainfrom
target-grid-cordex-domain
Open

Add CORDEX domain target grids for regridding#3096
ghossh wants to merge 20 commits into
mainfrom
target-grid-cordex-domain

Conversation

@ghossh

@ghossh ghossh commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Description

Adds support for using standard CORDEX domain names, such as EUR-11, as target_grid values in the regrid preprocessor.

Previously, target_grid: EUR-11 was treated as an MxN grid specification and failed with:

ValueError: Invalid MxN cell specification for grid, got 'EUR-11'.

Closes #3088

Link to documentation:

https://esmvaltool--3096.org.readthedocs.build/projects/ESMValCore/en/3096/recipe/preprocessor.html#regridding-on-a-cordex-domain-grid

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.

@ghossh ghossh requested a review from bouweandela June 1, 2026 14:58
@CLAassistant

CLAassistant commented Jun 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.24%. Comparing base (61c14ed) to head (ab4873f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3096      +/-   ##
==========================================
+ Coverage   96.22%   96.24%   +0.01%     
==========================================
  Files         273      273              
  Lines       16150    16175      +25     
==========================================
+ Hits        15541    15568      +27     
+ Misses        609      607       -2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bouweandela bouweandela left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like a great start! Could you take a look at the checklist? A few things to do would be

  • sign the CLA
  • add a unit test
  • add documentation

Usually you can find advice on how to go about that in the pull request template, but in case you missed it you can find it here: https://github.com/ESMValGroup/ESMValCore/blob/main/.github/pull_request_template.md

Comment thread esmvalcore/preprocessor/_regrid.py Outdated
@ghossh ghossh self-assigned this Jun 8, 2026
ghossh added 2 commits June 8, 2026 15:31
This update introduces a new section in the preprocessor documentation detailing how to regrid to standard CORDEX domains using the `target_grid` parameter. An example configuration for the `EUR-11` domain is provided, clarifying the use of domain names recognized by the `cordex` package.
@ghossh ghossh requested a review from bouweandela June 8, 2026 13:56
@ghossh

ghossh commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Hi @bouweandela , Please provide another review. Not sure why the workflow commit is failing!

@ghossh

ghossh commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @bouweandela , I found that in case of :

  - project: CORDEX
    domain: EUR-11
    dataset: RACMO22E
    driver: CNRM-CERFACS-CNRM-CM5
    ensemble: r1i1p1
    institute: KNMI
    rcm_version: v2

in this line, it's failing due to no having bounds

if not np.allclose(coord1.bounds, coord2.bounds):

A possible solution could be like adding this:

        if not coord1.has_bounds() or not coord2.has_bounds():
            return False

what do you think?

@bouweandela

Copy link
Copy Markdown
Member

Not sure why the workflow commit is failing!

Should be fixed by #3104

@bouweandela

Copy link
Copy Markdown
Member

Regarding the no-bounds issue: this seems unrelated to the changes in this pull request, so it would be great if you could open a new issue for this. We can then make a plan for how to solve it there and tackle it in a new pull request.

Comment thread esmvalcore/preprocessor/_regrid.py
Comment thread esmvalcore/preprocessor/_regrid.py
Comment thread doc/recipe/preprocessor.rst
Comment thread doc/recipe/preprocessor.rst Outdated
Comment thread tests/unit/preprocessor/_regrid/test_cordex_target_grid.py Outdated
Comment thread tests/unit/preprocessor/_regrid/test_cordex_target_grid.py Outdated

@bouweandela bouweandela left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice progress @ghossh! I've pasted the checklist back in the pull request description to make it easier for myself to remember what to look for. A few more things to do would be to add a label to the pull request (e.g. preprocessor) and add yourself to the list of authors. Could you please also update the branch so coverage is uploaded again and I can see which lines of code have coverage.

@bouweandela

Copy link
Copy Markdown
Member

Regarding the no-bounds issue: this seems unrelated to the changes in this pull request, so it would be great if you could open a new issue for this. We can then make a plan for how to solve it there and tackle it in a new pull request.

I forgot, but it looks like I did something on this two months ago in 8d24d14

bouweandela and others added 10 commits June 29, 2026 10:22
Co-authored-by: Bouwe Andela <b.andela@esciencecenter.nl>
…reamline checks for CORDEX domains and improve readability.
…improve attribute management for CORDEX grids. Update regrid documentation to clarify support for CORDEX domain names.
…es, allowing users to specify domains like ``EUR-11``. This improves clarity on the options available for target grid specifications.
- Introduced a new test to validate that non-string inputs are rejected by the CORDEX domain detection.
- Updated existing tests to ensure proper handling of CORDEX domains in target grid construction and validation.
- Removed redundant tests that were previously validating CORDEX domain acceptance in the update target grid function.
…target_grid`

- Introduced a new test to ensure that regional dictionary target grids are validated correctly during the update process.
- This enhances the coverage of the regrid functionality, particularly for CORDEX datasets.
@ghossh ghossh added the preprocessor Related to the preprocessor label Jul 2, 2026
ghossh added 2 commits July 2, 2026 14:09
…necessary fields. Adjust ORCID format for existing authors and add publication date for version v2.15.0rc3.
@ghossh ghossh requested a review from bouweandela July 2, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preprocessor Related to the preprocessor

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Make it possible to regrid to the standard CORDEX domains

3 participants