Skip to content

Commit 2a047a2

Browse files
committed
crps ensemble with dask
1 parent f9a0849 commit 2a047a2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

scoringrules/backend/gufuncs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _crps_ensemble_qd_gufunc(
106106
):
107107
"""CRPS estimator based on the quantile decomposition form."""
108108
obs = observation[0]
109-
M = forecasts.shape[0]
109+
M = forecasts.shape[-1]
110110

111111
if np.isnan(obs):
112112
out[0] = np.nan
@@ -194,7 +194,7 @@ def _crps_ensemble_pwm_gufunc(
194194
):
195195
"""CRPS estimator based on the probability weighted moment (PWM) form."""
196196
obs = observation[0]
197-
M = forecasts.shape[0]
197+
M = forecasts.shape[-1]
198198

199199
if np.isnan(obs):
200200
out[0] = np.nan

scoringrules/backend/numba.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ def crps_ensemble(
4848
"akr_circperm",
4949
"fair",
5050
]:
51+
if hasattr(forecasts, "__dask_graph__"):
52+
raise NotImplementedError(
53+
"Estimators that need sorting of the ensemble do not yet work with dask. "
54+
"Sort the ensemble beforehand or try another estimator (nrg, akr, akr_circperm or fair)"
55+
)
5156
forecasts = np.sort(forecasts, axis=-1)
5257

5358
if estimator == "int":

0 commit comments

Comments
 (0)