From 9f468637e8ac376b3cbfddea415ead3d15dfcc47 Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Sat, 17 Jan 2026 14:19:23 +0100 Subject: [PATCH 1/4] Add DSS to Docs --- docs/reference.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/reference.md b/docs/reference.md index d8d6abc..92d92d0 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -26,6 +26,8 @@ Univariate vrgksuv_ensemble crps_quantile + dssuv_ensemble + Multivariate -------------------- @@ -47,6 +49,8 @@ Multivariate owgksmv_ensemble vrgksmv_ensemble + dssmv_ensemble + Parametric distributions forecasts ==================================== .. autosummary:: From 89ff80a67a3cbe6fccb3b48c5ae1f7e5499ae809 Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Tue, 20 Jan 2026 16:52:12 +0100 Subject: [PATCH 2/4] Wrap all ES in the lazy_gufunc_wrapper --- scoringrules/core/energy/_gufuncs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scoringrules/core/energy/_gufuncs.py b/scoringrules/core/energy/_gufuncs.py index bd38fba..1f69392 100644 --- a/scoringrules/core/energy/_gufuncs.py +++ b/scoringrules/core/energy/_gufuncs.py @@ -4,6 +4,7 @@ from scoringrules.core.utils import lazy_gufunc_wrapper_mv +@lazy_gufunc_wrapper_mv @guvectorize( [ "void(float32[:], float32[:,:], float32[:])", @@ -30,6 +31,7 @@ def _energy_score_nrg_gufunc( out[0] = e_1 / M - 0.5 / (M**2) * e_2 +@lazy_gufunc_wrapper_mv @guvectorize( [ "void(float32[:], float32[:,:], float32[:])", From 9c6e9ab9e8ebc2bac3182257037763e9ac4001e8 Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Tue, 20 Jan 2026 16:52:53 +0100 Subject: [PATCH 3/4] explicitly cast array of shape () to the item type --- scoringrules/core/utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scoringrules/core/utils.py b/scoringrules/core/utils.py index 22b9f23..6aa1c13 100644 --- a/scoringrules/core/utils.py +++ b/scoringrules/core/utils.py @@ -45,7 +45,10 @@ def lazy_gufunc_wrapper_uv(func): def wrapper(*args): out = np.empty_like(args[0]) func(*args, out) - return out + if out.shape == (): + return out.item() + else: + return out return wrapper @@ -62,6 +65,9 @@ def lazy_gufunc_wrapper_mv(func): def wrapper(*args): out = np.empty_like(args[0][..., 0]) func(*args, out) - return out + if out.shape == (): + return out.item() + else: + return out return wrapper From 73b0a1c31b5fb0f58165e2ddba5c81bccb27d136 Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Wed, 21 Jan 2026 10:50:21 +0100 Subject: [PATCH 4/4] Revert "Wrap all ES in the lazy_gufunc_wrapper" This reverts commit 89ff80a67a3cbe6fccb3b48c5ae1f7e5499ae809. --- scoringrules/core/energy/_gufuncs.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scoringrules/core/energy/_gufuncs.py b/scoringrules/core/energy/_gufuncs.py index 1f69392..bd38fba 100644 --- a/scoringrules/core/energy/_gufuncs.py +++ b/scoringrules/core/energy/_gufuncs.py @@ -4,7 +4,6 @@ from scoringrules.core.utils import lazy_gufunc_wrapper_mv -@lazy_gufunc_wrapper_mv @guvectorize( [ "void(float32[:], float32[:,:], float32[:])", @@ -31,7 +30,6 @@ def _energy_score_nrg_gufunc( out[0] = e_1 / M - 0.5 / (M**2) * e_2 -@lazy_gufunc_wrapper_mv @guvectorize( [ "void(float32[:], float32[:,:], float32[:])",