Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/CSET/loaders/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def load(conf: Config):
variables={
"VARNAME": field,
"BASE_MODEL": base_model["name"],
"OTHER_MODEL": model["name"],
"OTHER_MODELS": model["name"],
"METHOD": method,
"PRESERVED_COORDS": preserved_coords,
"SUBAREA_NAME": conf.SUBAREA_NAME if conf.SELECT_SUBAREA else "",
Expand All @@ -140,22 +140,22 @@ def load(conf: Config):
scores_timeseries_methods = _get_scores_timeseries_methods(conf)
if scores_timeseries_methods:
# Produce timeseries plots of scores metrics averaged over the domain for each case study.
for model, field, scores_method in itertools.product(
models[1:], conf.SURFACE_FIELDS, scores_timeseries_methods
for field, scores_method in itertools.product(
conf.SURFACE_FIELDS, scores_timeseries_methods
):
yield RawRecipe(
recipe=f"timeseries_surface_difference_scores_{scores_method}.yaml",
variables={
"VARNAME": field,
"BASE_MODEL": base_model["name"],
"OTHER_MODEL": model["name"],
"OTHER_MODELS": [model["name"] for model in models[1:]],
"SUBAREA_NAME": conf.SUBAREA_NAME if conf.SELECT_SUBAREA else "",
"SUBAREA_TYPE": conf.SUBAREA_TYPE if conf.SELECT_SUBAREA else None,
"SUBAREA_EXTENT": conf.SUBAREA_EXTENT
if conf.SELECT_SUBAREA
else None,
},
model_ids=[base_model["id"], model["id"]],
model_ids=[base_model["id"]] + [model["id"] for model in models[1:]],
aggregation=False,
)

Expand Down Expand Up @@ -251,7 +251,7 @@ def load(conf: Config):
variables={
"VARNAME": field,
"BASE_MODEL": base_model["name"],
"OTHER_MODEL": model["name"],
"OTHER_MODELS": model["name"],
"PRESERVED_COORDS": ["pressure"],
"AGGREGATION_MODE": "Case-study RMSE",
"SUBAREA_TYPE": conf.SUBAREA_TYPE if conf.SELECT_SUBAREA else None,
Expand Down
10 changes: 10 additions & 0 deletions src/CSET/operators/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ def read_cubes(
paths = iter_maybe(file_paths)
model_names = iter_maybe(model_names)

# flattens model_names if needed into one dimensional list.
if model_names != (None,):
flat = []
for item in model_names:
if isinstance(item, list):
flat.extend(item)
else:
flat.append(item)
model_names = flat

# Check we have appropriate number of model names.
if model_names != (None,) and len(model_names) != len(paths):
raise ValueError(
Expand Down
Loading