Skip to content

Commit 33c8004

Browse files
ArmavicaricardoV94
authored andcommitted
Fix some FutureWarnings in the tests
1 parent 2feff5e commit 33c8004

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pymc/tests/test_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def test_missing_data(self):
348348

349349
assert m["x2_missing"].type == gf._extra_vars_shared["x2_missing"].type
350350

351-
pnt = m.test_point.copy()
351+
pnt = m.initial_point(seed=None).copy()
352352
del pnt["x2_missing"]
353353

354354
res = [gf(DictToArrayBijection.map(Point(pnt, model=m))) for i in range(5)]
@@ -526,7 +526,7 @@ def test_make_obs_var():
526526
assert masked_output != fake_distribution
527527
assert not isinstance(masked_output, RandomVariable)
528528
# Ensure it has missing values
529-
assert {"testing_inputs_missing"} == {v.name for v in fake_model.vars}
529+
assert {"testing_inputs_missing"} == {v.name for v in fake_model.value_vars}
530530
assert {"testing_inputs", "testing_inputs_observed"} == {
531531
v.name for v in fake_model.observed_RVs
532532
}

pymc/tests/test_sampling.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def test_parallel_start(self):
204204
tune=5,
205205
cores=2,
206206
discard_tuned_samples=False,
207-
start=[{"x": [10, 10]}, {"x": [-10, -10]}],
207+
initvals=[{"x": [10, 10]}, {"x": [-10, -10]}],
208208
random_seed=self.random_seed,
209209
)
210210
assert idata.warmup_posterior["x"].sel(chain=0, draw=0).values[0] > 0
@@ -226,7 +226,7 @@ def test_reset_tuning(self):
226226
tune = 50
227227
chains = 2
228228
start, step = pm.sampling.init_nuts(chains=chains, random_seed=[1, 2])
229-
pm.sample(draws=2, tune=tune, chains=chains, step=step, start=start, cores=1)
229+
pm.sample(draws=2, tune=tune, chains=chains, step=step, initvals=start, cores=1)
230230
assert step.potential._n_samples == tune
231231
assert step.step_adapt._count == tune + 1
232232

@@ -403,12 +403,12 @@ def test_sample_find_MAP_does_not_modify_start():
403403

404404
# make sure sample does not modify the start dict
405405
start = {"untransformed": 0.2}
406-
pm.sample(draws=10, step=pm.Metropolis(), tune=5, start=start, chains=3)
406+
pm.sample(draws=10, step=pm.Metropolis(), tune=5, initvals=start, chains=3)
407407
assert start == {"untransformed": 0.2}
408408

409409
# make sure sample does not modify the start when passes as list of dict
410410
start = [{"untransformed": 2}, {"untransformed": 0.2}]
411-
pm.sample(draws=10, step=pm.Metropolis(), tune=5, start=start, chains=2)
411+
pm.sample(draws=10, step=pm.Metropolis(), tune=5, initvals=start, chains=2)
412412
assert start == [{"untransformed": 2}, {"untransformed": 0.2}]
413413

414414

0 commit comments

Comments
 (0)