Skip to content
Snippets Groups Projects
Commit c5e0e40e authored by v.gramlich1's avatar v.gramlich1
Browse files

Gives ValueError if window_lead_time of competitors and model dont match

parent 527ddd38
Branches
No related tags found
1 merge request!302Draft: Resolve "Class-based Oversampling technique"
Pipeline #74948 passed
......@@ -138,7 +138,16 @@ class PostProcessing(RunEnvironment):
except (FileNotFoundError, KeyError):
logging.debug(f"No competitor found for combination '{station_name}' and '{competitor_name}'.")
continue
return xr.concat(competing_predictions, "type") if len(competing_predictions) > 0 else None
if len(competing_predictions)==0:
return None
else:
comp_array = xr.concat(competing_predictions, "type")
if len(comp_array.coords[self.ahead_dim]) == self.window_lead_time:
return comp_array
else:
raise ValueError(f"Ahead dimensions of competitors do not match model."
f" Competitor ahead: {len(comp_array.coords[self.ahead_dim])}"
f" but window_lead_time is {self.window_lead_time}.")
def bootstrap_postprocessing(self, create_new_bootstraps: bool, _iter: int = 0, bootstrap_type="singleinput",
bootstrap_method="shuffle") -> None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment