-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1636 from ESMCI/mvertens/new_component_matches
New match attribute that can be 'last' or 'first' for values match in component.py Currently there is confusion as to how matches are found for multiple <value> elements in a <values> node. component.py is currently using a matching algorithm that picks the last match in case of multiple matches that are found. This matching algorithm is used anytime a Component object is instantiated (currently occurs in config_component.xml). By default if the match attribute DOES NOT appear, then the last match will be used, to make things backwards compatible. namelist_definition_<component>.xml uses the entry_id.py matching algorithm which picks the first match in case of multiple matches being found. So for setting namelists the first match is picked. This PR adds a new, optional, attribute to the <entry> element in EITHER a config_component.xml, config_compset.xml or namelist_definition_<component>.xml file. <entry id="<name>"> <values match="last"> will pick the last best match <values match="first"> will pick the first best match <value>...</value> <value>...</value> <values> <entry_id> As a result, there is new flexibility and transparency in how matches are determined in component.py by adding a match attribute that can be 'first' or 'last'. Having this be explicit will enable developers to not trip up on assuming 'first' or 'last' match and be wrong. This capability has been added to the _get_value_match routine in BOTH entry_id.py AND component.py. However, the default values differ: the default "match" value entry_id.py is "first" the default "match" value in component.py is "last" Having these default values differ preserves backwards compatibility when the "match" attribute is not there. Moving forwards, it would be good to always have a "match" attribute. The new match = "last"attribute has been added to all of the data components component_component.xml and the config_component_cesm.xml and config_component_acme.xml. Test suite: scripts_regressions_tests and also verified that running the prealpha and prebeta tests on cheyenne, with just namelist comparisons, resulted in identical namelists when compared to cesm2_0_alpha06m Test baseline: cesm2_0_alpha06m for cesm Test namelist changes: None Test status: bit for bit Fixes ESMCI/CIME issue 1617 User interface changes?: New match attribute elements that are children of <entry> nodes. Code review: gold2718
- Loading branch information
Showing
13 changed files
with
226 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.