Skip to content

Commit 13a2310

Browse files
committed
Seed flaky TestHSGP.test_prior
1 parent 90fd8a3 commit 13a2310

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/gp/test_hsgp_approx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def test_parametrization_drop_first(self, model, cov_func, X1, drop_first):
166166
assert n_coeffs == n_basis, "one was dropped when it shouldn't have been"
167167

168168
@pytest.mark.parametrize("parameterization", ["centered", "noncentered"])
169-
def test_prior(self, model, cov_func, X1, parameterization):
169+
def test_prior(self, model, cov_func, X1, parameterization, rng):
170170
"""Compare HSGP prior to unapproximated GP prior, pm.gp.Latent. Draw samples from the
171171
prior and compare them using MMD two sample test. Tests both centered and non-centered
172172
parameterizations.
@@ -178,7 +178,7 @@ def test_prior(self, model, cov_func, X1, parameterization):
178178
gp = pm.gp.Latent(cov_func=cov_func)
179179
f2 = gp.prior("f2", X=X1)
180180

181-
idata = pm.sample_prior_predictive(samples=1000)
181+
idata = pm.sample_prior_predictive(samples=1000, random_seed=rng)
182182

183183
samples1 = az.extract(idata.prior["f1"])["f1"].values.T
184184
samples2 = az.extract(idata.prior["f2"])["f2"].values.T

0 commit comments

Comments
 (0)