fremor.cmor_resolver module

fremor resolve: model-YAML resolver

This module resolves the FRE-style model YAML workflow used in some test fixtures and debugging sessions.

Here “resolve” means: locate the model YAML, identify which CMOR YAML and optional grids YAML belong to the requested experiment, concatenate those files into one YAML document so that anchors defined in the model or grids files are visible when the CMOR section is parsed, and return the materialized mapping with every anchor already expanded into plain Python values.

fremor.cmor_resolver.resolve_fremor_yaml(yamlfile: str, experiment: str, output: str | None = None) dict

Resolve one model YAML experiment into the combined mapping used for inspection.

“Resolve” here means: locate the model YAML, identify which CMOR YAML (and optional grids YAML) belong to the requested experiment, concatenate those files into one YAML document, and let the YAML parser expand all anchors and merge keys across the combined text. The caller receives only the sections that are useful downstream — fre_properties, grids, and cmor — with every anchor already materialized into plain Python values.

Parameters:
  • yamlfile – Path to the model YAML file.

  • experiment – Experiment name to select from the model YAML.

  • output – Optional path to write the resolved YAML.

Returns:

Resolved YAML dictionary containing any present fre_properties, grids, and cmor sections.