Skip to content

Commit 67da585

Browse files
committed
Avoid warning in Mixture test
1 parent 9c313cb commit 67da585

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc/tests/distributions/test_mixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,12 +1009,12 @@ def setup_class(cls):
10091009
@pytest.mark.parametrize("batch_shape", [(3, 4), (20,)], ids=str)
10101010
def test_with_multinomial(self, batch_shape):
10111011
p = np.random.uniform(size=(*batch_shape, self.mixture_comps, 3))
1012+
p /= p.sum(axis=-1, keepdims=True)
10121013
n = 100 * np.ones((*batch_shape, 1))
10131014
w = np.ones(self.mixture_comps) / self.mixture_comps
10141015
mixture_axis = len(batch_shape)
10151016
with Model() as model:
1016-
with pytest.warns(UserWarning, match="parameters sum up to"):
1017-
comp_dists = Multinomial.dist(p=p, n=n, shape=(*batch_shape, self.mixture_comps, 3))
1017+
comp_dists = Multinomial.dist(p=p, n=n, shape=(*batch_shape, self.mixture_comps, 3))
10181018
mixture = Mixture(
10191019
"mixture",
10201020
w=w,

0 commit comments

Comments
 (0)