Skip to content

Commit 5ff6853

Browse files
committed
WIP test frameworks
1 parent 9803321 commit 5ff6853

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/distributions/test_discrete.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
Rplus,
2828
assert_support_point_is_expected,
2929
check_logp,
30+
check_selfconsistency_discrete_logcdf,
3031
discrete_random_tester,
3132
)
3233
from pytensor import config
@@ -330,6 +331,12 @@ def test_logp_basic(self):
330331
with pytest.raises(TypeError):
331332
logp_fn(np.array([1.5])) # Value must be integer
332333

334+
def test_logcdf(self):
335+
# test logcdf matches log sums across parameter values
336+
check_selfconsistency_discrete_logcdf(
337+
GrassiaIIGeometric, I, {"r": Rplus, "alpha": Rplus, "time_covariate_vector": I}
338+
)
339+
333340
@pytest.mark.parametrize(
334341
"r, alpha, time_covariate_vector, size, expected_shape",
335342
[
@@ -359,3 +366,6 @@ def test_support_point(self, r, alpha, time_covariate_vector, size, expected_sha
359366
# Check values are finite and reasonable
360367
assert np.all(np.isfinite(init_point))
361368
assert np.all(init_point < 1e6) # Should not be extremely large
369+
370+
# TODO: expected values must be provided
371+
# assert_support_point_is_expected(model, init_point)

0 commit comments

Comments
 (0)