Skip to content

Conversation

@bouweandela
Copy link
Member

@bouweandela bouweandela commented Jan 16, 2026

Description

Added features

  • A new way of configuring the CMOR tables, with separate extensions for CMIP6 and CMIP5 tables to avoid confusion because of differing coordinate definitions.
  • The possibility to use data that has not been CMORized, as long as it is compliant enough with the CMOR standards for the preprocessor functions and/or diagnostics to be able to function.
  • Updated the function esmvalcore.preprocessor.align_metadata so it works with branded variables

Closes #2918
Closes #2746
Closes #2364

Links to documentation:

Deprecated features


Before you get started

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.


To help with the number pull requests:

@bouweandela bouweandela force-pushed the new-config-cmor branch 2 times, most recently from 2b7ae33 to f7e0982 Compare January 19, 2026 12:41
@bouweandela bouweandela added the enhancement New feature or request label Jan 19, 2026
@bouweandela bouweandela added this to the v2.14.0 milestone Jan 19, 2026
@bouweandela bouweandela force-pushed the new-config-cmor branch 4 times, most recently from 2403e51 to c2bd443 Compare January 19, 2026 15:44
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.70%. Comparing base (c53de2f) to head (eb36404).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2946      +/-   ##
==========================================
+ Coverage   95.62%   95.70%   +0.08%     
==========================================
  Files         266      266              
  Lines       15601    15688      +87     
==========================================
+ Hits        14918    15014      +96     
+ Misses        683      674       -9     

☔ View full report in Codecov by Sentry.
📢 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.

@schlunma
Copy link
Contributor

Hello, this pull request has been marked with the v2.14.0 milestone. The release of version 2.14.0 is currently scheduled for February 2026. To get this into the new release, it would be great to get this merged by the end of January.

If you won't be able to finish this in time, don't worry - just unassign the milestone v2.14.0. If you need any support, ping myself (@schlunma; the release manager for v2.14.0) or the @ESMValGroup/technical-lead-development-team. Please note that I won't be available until the beginning of February, though.

@valeriupredoi
Copy link
Contributor

@bouweandela shout if you need a helping hand here, with the missing tests - I can help. Apart from that, it looks great - and a lot of bookkeeping work too, which is not pleasant 🍻

@bouweandela
Copy link
Member Author

Thanks for offering V! The tests shouldn't be too much effort, it's mostly the docs that still need to be updated and I want to think about if I can avoid making #2954 worse. I was actually having a go at fixing that, but realized that it's probably best to leave that for another PR. If you could help out with reviewing and testing that would be great. Hopefully I'll have this ready for review by the end of the week.

@valeriupredoi
Copy link
Contributor

sure thing, can do! 🍺

USER_EXTRA_FACETS = Path.home() / ".esmvaltool" / "extra_facets"


# Set iris.FUTURE flags
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved things out of this module so it can be completely deleted in v2.16.0

@@ -0,0 +1,1649 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Generated from the custom CMIP5 style tables using the script

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes CMOR table configuration by introducing a new configuration system and deprecating the legacy config-developer.yml file. The changes enable separate CMOR table extensions for different CMIP versions and add support for non-CMORized data.

Changes:

  • Introduces a new CMOR table configuration system under the projects configuration with separate CMIP5 and CMIP6 custom table extensions
  • Deprecates config-developer.yml and the config_developer_file configuration setting
  • Updates align_metadata preprocessor function to support branded variables via new target_branding_suffix parameter

Reviewed changes

Copilot reviewed 32 out of 173 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/unit/preprocessor/test_configuration.py Adds monkeypatch to set config_developer_file for backward compatibility test
tests/unit/io/local/test_get_data_sources.py Updates to use monkeypatch instead of validate_config_developer
tests/unit/config/test_data_sources.py Adds config_developer_file monkeypatch for legacy tests
tests/unit/config/test_config_validator.py Updates validator tests for new CMOR table configuration defaults
tests/unit/config/test_config.py Removes default config_developer_file expectation from tests
tests/unit/cmor/test_table.py Converts unittest to pytest style and fixes var_name test
tests/integration/recipe/test_recipe.py Updates dataset names and expected error messages
tests/integration/io/test_local.py Adds config_developer_file monkeypatch for legacy tests
tests/integration/conftest.py Refactors datafinder fixture to use new LocalDataSource API
tests/integration/cmor/test_table.py Converts to pytest and adds extensive new tests for CMOR table classes
tests/integration/cmor/test_read_cmor_tables.py Adds comprehensive tests for new get_tables function
tests/integration/cmor/_fixes/native6/test_era5.py Removes explicit coordinate long_name assertions
esmvalcore/preprocessor/_other.py Adds target_branding_suffix parameter to align_metadata
esmvalcore/io/local.py Updates debug info formatting when files are found
esmvalcore/io/init.py Fixes docstring format (Arguments → Parameters)
esmvalcore/dataset.py Makes CMOR checks conditional on table availability
esmvalcore/config/configurations/defaults/config-user.yml Removes deprecated config_developer_file option
esmvalcore/config/configurations/defaults/cmor_tables.yml Adds new default CMOR table configurations
esmvalcore/config/_config_validators.py Implements new validation and deprecation for CMOR tables
esmvalcore/config/_config.py Deprecates config-developer module functions
esmvalcore/config/init.py Moves iris.FUTURE flag setting to main config module
esmvalcore/cmor/_utils.py Adds type ignore comment for potential bug
esmvalcore/_recipe/check.py Updates align_metadata check to support branding_suffix
esmvalcore/cmor/tables/cmip7/tables/* Adds new CMIP7 table files
esmvalcore/cmor/tables/cmip6-custom/convert-cmip5-to-cmip6.py Adds conversion script
esmvalcore/cmor/tables/cmip5-custom/*.dat Adds many custom CMIP5-style table files
doc/reference/cmor_tables.rst Updates table path references
doc/recipe/preprocessor.rst Documents new target_branding_suffix parameter
doc/quickstart/find_data.rst Removes hint about custom_cmor_tables
doc/quickstart/configure.rst Extensive updates for new configuration system
doc/develop/fixing_data.rst Updates native dataset configuration instructions
doc/changelog.rst Updates reference to custom CMOR tables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 33 out of 174 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


"""
new_coord = generic_level_coord.generic_lev_coords[new_coord_name]
new_coord = generic_level_coord.generic_lev_coords[new_coord_name] # type: ignore[index] # Is this a bug?
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

There's a type: ignore comment here with a note "Is this a bug?". This should be investigated rather than just ignoring the type error. The comment suggests uncertainty about whether this code is correct.

Suggested change
new_coord = generic_level_coord.generic_lev_coords[new_coord_name] # type: ignore[index] # Is this a bug?
if new_coord_name is None:
msg = (
"new_coord_name must not be None when retrieving a new generic "
f"level coordinate for {generic_level_coord_name!r}"
)
raise ValueError(msg)
new_coord = generic_level_coord.generic_lev_coords[new_coord_name]

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@schlunma Do you know what the expected behaviour is here? I added type hints, and then this issue showed up.

bouweandela and others added 2 commits January 30, 2026 10:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
],
attributes={"comment": COMMENT},
)
cube.coord("latitude").long_name = "latitude"
Copy link
Member Author

Choose a reason for hiding this comment

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

This was an artifact of using CMIP5 style custom tables. Now all variables in the native6 project are CMIP6 compliant.

@bouweandela bouweandela requested a review from Copilot January 30, 2026 09:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 33 out of 175 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (2)

tests/unit/cmor/test_table.py:1

  • The comment questions whether var_name could be removed, but the test still validates its behavior. Either remove the comment if var_name is intentional, or create a follow-up issue to investigate removing it if it's truly unused.
    esmvalcore/config/configurations/defaults/cmor_tables.yml:1
  • The comment 'Projects hosted on ESGF' is placed before CMIP7, but CMIP7 is followed by several other projects that are also ESGF-hosted. Consider moving this comment to encompass all relevant ESGF projects or making the scope clearer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bouweandela bouweandela marked this pull request as ready for review January 30, 2026 09:57
@valeriupredoi
Copy link
Contributor

I'll take it from here, thanks, bud 🍻 I witnessed your toil live, last night, when I was trying to watch a documentary but my phone kept bleeping beeping with your commits 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmor Related to the CMOR standard deprecated feature enhancement New feature or request

Projects

None yet

4 participants