Skip to content

Commit 3f42aa4

Browse files
committed
Applying change to other YAML file too
1 parent b6eaf32 commit 3f42aa4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CMEW/app/copy_datasets/bin/add_datasets_to_share.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def dict_namelists_in_workflow_dir():
225225
return filepaths
226226

227227

228-
def use_facet_as_key(filepath, key_facet="suite_id"):
228+
def use_facet_as_key(filepath, key_facet):
229229
"""
230230
Edit a YAML file in place, from a list to a dictionary.
231231
@@ -275,5 +275,6 @@ def use_facet_as_key(filepath, key_facet="suite_id"):
275275
# Write the datasets to a YAML file in the target directory
276276
write_datasets_to_yaml(datasets, basename, target_dir)
277277

278-
# Reformat the model_runs YAML file to use suite_ids as keys
279-
use_facet_as_key(f"{target_dir}/model_runs.yml")
278+
# Reformat the YAML files to use unique identifiers as keys
279+
use_facet_as_key(f"{target_dir}/model_runs.yml", "suite_id")
280+
use_facet_as_key(f"{target_dir}/cmip6_datasets.yml", "model_id")

CMEW/app/copy_datasets/bin/test_add_datasets_to_share.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def test_use_facet_as_key(path_to_mock_yaml_list, path_to_kgo_yaml_dict):
227227
shutil.copyfile(path_to_mock_yaml_list, tmp.name)
228228

229229
# The filepath is given by .name
230-
use_facet_as_key(str(tmp.name))
230+
use_facet_as_key(str(tmp.name), "suite_id")
231231

232232
# Read the result
233233
tmp.seek(0)

0 commit comments

Comments
 (0)