Skip to content

Commit fa4edce

Browse files
committed
minor bug fixes
1 parent 8aba4e1 commit fa4edce

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

scoringrules/_crps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,7 @@ def crps_tlogistic(
13351335
location,
13361336
scale,
13371337
lower,
1338+
upper,
13381339
0.0,
13391340
0.0,
13401341
backend=backend,

tests/test_wcrps.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,34 @@
1212
def test_owcrps_ensemble(backend):
1313
# test shapes
1414
obs = np.random.randn(N)
15-
res = sr.owcrps_ensemble(obs, np.random.randn(N, M), w_func=lambda x: x * 0.0 + 1.0)
15+
res = sr.owcrps_ensemble(
16+
obs, np.random.randn(N, M), w_func=lambda x: x * 0.0 + 1.0, backend=backend
17+
)
1618
assert res.shape == (N,)
1719
res = sr.owcrps_ensemble(
18-
obs, np.random.randn(M, N), w_func=lambda x: x * 0.0 + 1.0, m_axis=0
20+
obs,
21+
np.random.randn(M, N),
22+
w_func=lambda x: x * 0.0 + 1.0,
23+
m_axis=0,
24+
backend=backend,
1925
)
2026
assert res.shape == (N,)
2127

2228

2329
@pytest.mark.parametrize("backend", BACKENDS)
2430
def test_vrcrps_ensemble(backend):
25-
# test exceptions
26-
with pytest.raises(ValueError):
27-
est = "not_nrg"
28-
sr.vrcrps_ensemble(1, 1.1, w_func=lambda x: x, estimator=est, backend=backend)
29-
3031
# test shapes
3132
obs = np.random.randn(N)
32-
res = sr.vrcrps_ensemble(obs, np.random.randn(N, M), w_func=lambda x: x * 0.0 + 1.0)
33+
res = sr.vrcrps_ensemble(
34+
obs, np.random.randn(N, M), w_func=lambda x: x * 0.0 + 1.0, backend=backend
35+
)
3336
assert res.shape == (N,)
3437
res = sr.vrcrps_ensemble(
35-
obs, np.random.randn(M, N), w_func=lambda x: x * 0.0 + 1.0, m_axis=0
38+
obs,
39+
np.random.randn(M, N),
40+
w_func=lambda x: x * 0.0 + 1.0,
41+
m_axis=0,
42+
backend=backend,
3643
)
3744
assert res.shape == (N,)
3845

0 commit comments

Comments
 (0)