diff --git a/mlair/run_modules/post_processing.py b/mlair/run_modules/post_processing.py index 3ce53c3c90921aa6bed742c5702104a5349812b8..72362c8770dce5febb52943d4dc871b3c11b3389 100644 --- a/mlair/run_modules/post_processing.py +++ b/mlair/run_modules/post_processing.py @@ -785,7 +785,7 @@ class PostProcessing(RunEnvironment): model_list = None # test errors of competitors - for model_type in remove_items(model_list or [], errors.keys()): + for model_type in remove_items(model_list or [], list(errors.keys())): if self.observation_indicator not in combined.coords[self.model_type_dim]: continue if model_type not in errors.keys(): @@ -815,10 +815,11 @@ class PostProcessing(RunEnvironment): avg_skill_score = 0 n_total = None for vals in counts.values(): - n_total = vals if n_total is None else n_total + vals - for station, station_errors in scores.items(): + n_total = vals if n_total is None else n_total.add(vals, fill_value=0) + for station, station_scores in scores.items(): n = counts.get(station) - avg_skill_score = station_errors * n / n_total + avg_skill_score + avg_skill_score = station_scores.mul(n.div(n_total, fill_value=0), fill_value=0).add(avg_skill_score, + fill_value=0) return avg_skill_score