Skip to content

Commit df3e56e

Browse files
add regression test to demo pymc-devs#3731
1 parent dc9fd72 commit df3e56e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pymc3/tests/test_tuning.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
22
from numpy import inf
3+
from pymc3.step_methods.metropolis import tune
34
from pymc3.tuning import scaling, find_MAP
45
from . import models
56

@@ -32,3 +33,11 @@ def test_mle_jacobian():
3233
map_estimate = find_MAP(method="BFGS", model=model)
3334

3435
np.testing.assert_allclose(map_estimate["mu_i"], truth, rtol=rtol)
36+
37+
38+
def test_tune_not_inplace():
39+
orig_scaling = np.array([0.001, 0.1])
40+
returned_scaling = tune(orig_scaling, acc_rate=0.6)
41+
assert not returned_scaling is orig_scaling
42+
assert np.all(orig_scaling == np.array([0.001, 0.1]))
43+
pass

0 commit comments

Comments
 (0)