NOAA-GFDL / fre-cli

Python-based command line interface for FRE (FMS Runtime Environment) to compile and run FMS-based models and post-process their output.
GNU Lesser General Public License v3.0
3 stars 7 forks source link

Yaml_load overwrites previous experiment yamls when multiple experiment yamls are listed in the pp section of the main yaml #162

Open uwagura opened 4 weeks ago

uwagura commented 4 weeks ago

Describe the bug If multiple experiment yamls are listed in the pp section of the main yaml, then only the last listed yaml will be included in the combined yaml. Any other yamls will be overwritten

To Reproduce Include multiple experiment yamls within a single experiment in the main yaml, like so:

experiments:
    - name: "CEFI_NWA12_COBALT_V1"
      pp:
          - "yaml_include/MOM6_postprocess.yaml" 
          - "yaml_include/Cobalt_postprocess.yaml"

Expected behavior Ideally, it would be nice to have the components listed in each experiment yaml included in the combined yaml produced afterwards

Additional context This problem seems to be caused by each of the experiment yamls containing the same keys. In the example listed above, MOM6_postprocess.yaml and Cobalt_postprocess.yaml each contain the following format

postprocess:
    components:
          - <components here> 

When these two yamls are combined with the main yaml, the combined yaml ends up with two postprocessing keys. When the yaml_load function reads these keys, it will overwrite the first postprocess section with the second one, causing the final file to have only the postprocessing components from the second experiment.

This issue could eventually be fixed by a solution to #161