Skip to content

#648 update cmor version to v3-13-0#696

Merged
mo-jareddrayton merged 8 commits intomainfrom
648-update-version-cmor-to-v3130
Nov 20, 2025
Merged

#648 update cmor version to v3-13-0#696
mo-jareddrayton merged 8 commits intomainfrom
648-update-version-cmor-to-v3130

Conversation

@mo-jareddrayton
Copy link
Collaborator

@mo-jareddrayton mo-jareddrayton commented Nov 19, 2025

This closes #648

CMOR Update / Environment Changes

  • This was mostly straightforward other than having to unpin nccmp to get the environment to resolve. This resulted in the nccmp version changing from 1.9.1 -> 1.10.0 which I wouldn't expect to cause any problems being a minor version change. All other version changes in unpinned packages look reasonable.

Code Changes

Most of the awkwardness with this change come from the change in variant label and how the usage of cmor_dataset_config provides the function that does the validation.

_configs = [cmor_setup_config(), cmor_dataset_config(), request_config()]

Without redesigning the current implementation we need to provide this function with the mip_era information. As a class variable I can't see any obvious way to do this so I don't see any drawbacks with making _configs an instance variables which is assigned on initialisation and can be provided the correct context information.

def _add_configs(self):
self._configs = [cmor_setup_config(), cmor_dataset_config(self.mip_era), request_config()]

There is a simpler solution that I tried first which removes the need for adding the mip_era argument to the Class and having to pass the plugin_id through many functions you can just use self.config["cmor_dataset]["mip_era"] within the UserConfig class. the problem is this causes some (somewhat minor) tests to fail. In hindsight I'm almost tempted to revert back to my initial solution and try and save what tests I can.

Example breaking test. You need the "cmor_dataset to get the "mip_era"!

def test_missing_cmor_setup_section(self, mopen):
user_config = '[cmor_dataset]\n[request]\n'
mopen.return_value = StringIO(dedent(user_config))
msg = 'User configuration file does not contain the required section "cmor_setup"'
self.assertRaisesRegex(ValidateConfigError, msg, UserConfig, self.read_path, self.history)
mopen.assert_called_once_with(self.read_path)

@mo-jareddrayton
Copy link
Collaborator Author

mo-jareddrayton commented Nov 20, 2025

One other thing I noticed during development, if I remove model_type I get these cmor errors.

I wasn't sure if this is a bug in one of cmor / CV.json / mip_convert.

!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Error: The following source type(s) "AOGCM " are required and
! some source type(s) could not be found in your input file. 
! Your file contains a source type of "".
! Check your Controlled Vocabulary file "$CDDS_ETC/mip_tables/CMIP7/DR-1.2.2.2-v1.0.1/CMIP7_CV.json".
! 
!
!!!!!!!!!!!!!!!!!!!!!!!!!


C Traceback:
! In function: _CV_checkSourceType
! called from: _CV_checkExperiment
! 

!!!!!!!!!!!!!!!!!!!!!!!!!
!
! Error: You source_type attribute contains invalid source types
! Your source type is set to "".  The required source types
! are "AOGCM " and possible additional source types are "AER CHEM BGC " 
! Check your Controlled Vocabulary file "$CDDS_ETC/mip_tables/CMIP7/DR-1.2.2.2-v1.0.1/CMIP7_CV.json".

Is this expected @matthew-mizielinski ?

@matthew-mizielinski
Copy link
Collaborator

Is this expected @matthew-mizielinski ?

I think this is a bug in CMOR, but is resolvable by removing the additional_allowed_model_components and required_model_components entries from the CV. My fault for not noticing this when putting this file in place.

Copy link
Collaborator

@matthew-mizielinski matthew-mizielinski left a comment

Choose a reason for hiding this comment

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

LGTM and all tests pass

@mo-jareddrayton mo-jareddrayton merged commit 1137b21 into main Nov 20, 2025
1 check passed
@mo-jareddrayton mo-jareddrayton deleted the 648-update-version-cmor-to-v3130 branch November 20, 2025 13:16
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.

Update version CMOR to v3.13.0

2 participants