diff --git a/mlair/run_modules/post_processing.py b/mlair/run_modules/post_processing.py index 80d40a66245ca0310dbb20a7cee8655c2fc3b9ec..4defc4d6439b720d61ce4617ced178531a921f50 100644 --- a/mlair/run_modules/post_processing.py +++ b/mlair/run_modules/post_processing.py @@ -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: