Skip to content

Commit 8ad2c03

Browse files
test Ordered and SumTo1 raise ValueError
1 parent bc8166e commit 8ad2c03

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pymc/tests/distributions/test_transform.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ def test_sum_to_1():
144144
check_vector_transform(tr.univariate_sum_to_1, Simplex(2))
145145
check_vector_transform(tr.univariate_sum_to_1, Simplex(4))
146146

147+
with pytest.raises(ValueError, match=r"\(ndim_supp\) must not exceed 1"):
148+
tr.SumTo1(2)
149+
147150
check_jacobian_det(
148151
tr.univariate_sum_to_1, Vector(Unit, 2), at.dvector, np.array([0, 0]), lambda x: x[:-1]
149152
)
@@ -250,6 +253,9 @@ def test_circular():
250253
def test_ordered():
251254
check_vector_transform(tr.univariate_ordered, SortedVector(6))
252255

256+
with pytest.raises(ValueError, match=r"\(ndim_supp\) must not exceed 1"):
257+
tr.Ordered(2)
258+
253259
check_jacobian_det(
254260
tr.univariate_ordered, Vector(R, 2), at.dvector, np.array([0, 0]), elemwise=False
255261
)

0 commit comments

Comments
 (0)