fre.yamltools.combine_yamls_script module
YAML Combination Utilities for FRE
This module provides utility functions for combining model, experiment, compile, platform, and analysis YAML files into unified configurations for the Flexible Runtime Environment (FRE) workflow. It offers routines to consolidate YAMLs for CMORization, compilation, and post-processing, supporting both command-line tools and internal workflow automation.
There are only four functions currently, with consolidate_yamls acting as the center of this file’s control-flow. The other functions are called within consolidate_yamls, based on the use argument passed to it. use may be one of cmor, pp, and compile at this time, and determines which pieces of information are needed, where they come from, and where they are placed in the output dictionary.
For every possible use argument currently accepted by consolidate_yamls, there exists a corresponding info_parser class that houses the specific requirements of the combination and the implementation as well. For more information, consult the docstrings in those functions and modules, as well as those in this file.
Functions
get_combined_cmoryaml(…)
get_combined_compileyaml(…)
get_combined_ppyaml(…)
consolidate_yamls(…)
- fre.yamltools.combine_yamls_script.consolidate_yamls(yamlfile: str, experiment: str, platform: str, target: str, use: str, output: str | None = None) dict
Depending on use argument passed, either create the final combined yaml for compilation or post-processing
- Parameters:
yamlfile (str) – Path to the model YAML configuration
experiment (str) – Post-processing experiment name
platform (str) – Platform name to be used
use (str) – How the tool is intended to be used (options: compile | pp| cmor)
output (str) – Output file name
- Raises:
ValueError – if ‘use’ value is not a valid entry (compile, pp or cmor)
- Returns:
yaml dictionary containing combined information from multiple yaml configurations
- Return type:
dict
- ..note:: The output file name should include a .yaml extension to indicate
it is a YAML configuration file
- fre.yamltools.combine_yamls_script.get_combined_cmoryaml(yamlfile: str | Path, experiment: str, platform: str, target: str, output: str | Path | None = None) Dict[str, Any]
Combine configuration information from the model, cmor, and other FRE-yaml config files into a single dictionary. the dictionary is intended to be read by fre cmor yaml. The final result relies on several calls to fre.cmor.cmor_info_parser.CMORYaml class routines.
- Parameters:
yamlfile (str or Path) – Path to the model YAML file.
experiment (str) – Name of the experiment to target.
platform (str) – Platform identifier (e.g., compute environment).
target (str) – Target build or run configuration.
output (str or Path, optional) – If given, path to write the combined YAML file.
- Raises:
Exception – For errors in initialization or merging steps.
- Returns:
Cleaned, combined CMOR YAML configuration.
- Return type:
dict
Note
The merging process details are within the CMORYaml class code