Skip to content

Commit 03c470d

Browse files
committed
fix bugs in weighted gufuncs
1 parent ec96ea2 commit 03c470d

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

scoringrules/core/crps/_gufuncs_w.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def _crps_ensemble_int_w_gufunc(
1212
obs: np.ndarray, fct: np.ndarray, w: np.ndarray, out: np.ndarray
1313
):
1414
"""CRPS estimator based on the integral form."""
15-
obs = obs[0]
1615

1716
if np.isnan(obs):
1817
out[0] = np.nan
@@ -52,7 +51,6 @@ def _crps_ensemble_qd_w_gufunc(
5251
obs: np.ndarray, fct: np.ndarray, w: np.ndarray, out: np.ndarray
5352
):
5453
"""CRPS estimator based on the quantile decomposition form."""
55-
obs = obs[0]
5654

5755
if np.isnan(obs):
5856
out[0] = np.nan
@@ -76,7 +74,6 @@ def _crps_ensemble_nrg_w_gufunc(
7674
obs: np.ndarray, fct: np.ndarray, w: np.ndarray, out: np.ndarray
7775
):
7876
"""CRPS estimator based on the energy form."""
79-
obs = obs[0]
8077
M = fct.shape[-1]
8178

8279
if np.isnan(obs):
@@ -99,7 +96,6 @@ def _crps_ensemble_fair_w_gufunc(
9996
obs: np.ndarray, fct: np.ndarray, w: np.ndarray, out: np.ndarray
10097
):
10198
"""Fair version of the CRPS estimator based on the energy form."""
102-
obs = obs[0]
10399
M = fct.shape[-1]
104100

105101
if np.isnan(obs):
@@ -124,7 +120,6 @@ def _crps_ensemble_pwm_w_gufunc(
124120
obs: np.ndarray, fct: np.ndarray, w: np.ndarray, out: np.ndarray
125121
):
126122
"""CRPS estimator based on the probability weighted moment (PWM) form."""
127-
obs = obs[0]
128123

129124
if np.isnan(obs):
130125
out[0] = np.nan
@@ -150,7 +145,6 @@ def _crps_ensemble_akr_w_gufunc(
150145
):
151146
"""CRPS estimaton based on the approximate kernel representation."""
152147
M = fct.shape[-1]
153-
obs = obs[0]
154148
e_1 = 0
155149
e_2 = 0
156150
for i, forecast in enumerate(fct):
@@ -167,7 +161,6 @@ def _crps_ensemble_akr_circperm_w_gufunc(
167161
):
168162
"""CRPS estimaton based on the AKR with cyclic permutation."""
169163
M = fct.shape[-1]
170-
obs = obs[0]
171164
e_1 = 0.0
172165
e_2 = 0.0
173166
for i, forecast in enumerate(fct):
@@ -187,8 +180,6 @@ def _owcrps_ensemble_nrg_w_gufunc(
187180
out: np.ndarray,
188181
):
189182
"""Outcome-weighted CRPS estimator based on the energy form."""
190-
obs = obs[0]
191-
ow = ow[0]
192183
M = fct.shape[-1]
193184

194185
if np.isnan(obs):
@@ -218,8 +209,6 @@ def _vrcrps_ensemble_nrg_w_gufunc(
218209
out: np.ndarray,
219210
):
220211
"""Vertically re-scaled CRPS estimator based on the energy form."""
221-
obs = obs[0]
222-
ow = ow[0]
223212
M = fct.shape[-1]
224213

225214
if np.isnan(obs):

scoringrules/core/kernels/_gufuncs_w.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def _ks_ensemble_uv_w_nrg_gufunc(
2525
obs: np.ndarray, fct: np.ndarray, w: np.ndarray, out: np.ndarray
2626
):
2727
"""Standard version of the kernel score."""
28-
obs = obs[0]
2928
M = fct.shape[-1]
3029

3130
if np.isnan(obs):
@@ -49,7 +48,6 @@ def _ks_ensemble_uv_w_fair_gufunc(
4948
obs: np.ndarray, fct: np.ndarray, w: np.ndarray, out: np.ndarray
5049
):
5150
"""Fair version of the kernel score."""
52-
obs = obs[0]
5351
M = fct.shape[-1]
5452

5553
if np.isnan(obs):
@@ -78,8 +76,6 @@ def _owks_ensemble_uv_w_gufunc(
7876
out: np.ndarray,
7977
):
8078
"""Outcome-weighted kernel score for univariate ensembles."""
81-
obs = obs[0]
82-
ow = ow[0]
8379

8480
if np.isnan(obs):
8581
out[0] = np.nan
@@ -109,8 +105,6 @@ def _vrks_ensemble_uv_w_gufunc(
109105
out: np.ndarray,
110106
):
111107
"""Vertically re-scaled kernel score for univariate ensembles."""
112-
obs = obs[0]
113-
ow = ow[0]
114108

115109
if np.isnan(obs):
116110
out[0] = np.nan

0 commit comments

Comments
 (0)