Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 845b616

Browse files
authored
Merge pull request #323 from ariddell/feature/release-2.15
Updates before PyStan 2.15
2 parents b383786 + 8e867e8 commit 845b616

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

pystan/model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ def __init__(self, file=None, charset='utf-8', model_name="anon_model",
245245
lib_dir,
246246
pystan_dir,
247247
os.path.join(pystan_dir, "stan", "src"),
248-
os.path.join(pystan_dir, "stan", "lib", "stan_math"),
249-
os.path.join(pystan_dir, "stan", "lib", "stan_math", "lib", "eigen_3.2.9"),
250-
os.path.join(pystan_dir, "stan", "lib", "stan_math", "lib", "boost_1.62.0"),
251-
os.path.join(pystan_dir, "stan", "lib", "stan_math", "lib", "cvodes_2.9.0", "include"),
248+
os.path.join(pystan_dir, "stan", "lib", "stan_math_2.15.0"),
249+
os.path.join(pystan_dir, "stan", "lib", "stan_math_2.15.0", "lib", "eigen_3.2.9"),
250+
os.path.join(pystan_dir, "stan", "lib", "stan_math_2.15.0", "lib", "boost_1.62.0"),
251+
os.path.join(pystan_dir, "stan", "lib", "stan_math_2.15.0", "lib", "cvodes_2.9.0", "include"),
252252
np.get_include(),
253253
]
254254

pystan/stan

Submodule stan updated 2883 files

pystan/tests/test_ess.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44
import pystan.chains
55
import pystan._chains
66

7-
# NOTE: This test is fragile because there is no guarantee that samples are
8-
# consistent between Stan releases (even with fixed random seeds). Consider
9-
# this a smoke test.
7+
# NOTE: This test is fragile because the default sampling algorithm used by Stan
8+
# may change in significant ways.
9+
1010

1111
class TestESS(unittest.TestCase):
1212

1313
@classmethod
1414
def setUpClass(cls):
1515
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
16-
model = pystan.StanModel(model_code=model_code, model_name="normal2")
17-
cls.fit = model.sampling(iter=4000, chains=2, seed=5)
16+
model = pystan.StanModel(model_code=model_code)
17+
cls.fits = [model.sampling(iter=4000, chains=2, seed=i) for i in range(10)]
1818

1919
def test_ess(self):
20-
sim = self.fit.sim
21-
ess = pystan.chains.ess(sim, sim['fnames_oi'].index('y'))
22-
self.assertGreater(ess, 2000)
20+
sims = [fit.sim for fit in self.fits]
21+
esses = [pystan.chains.ess(sim, sim['fnames_oi'].index('y')) for sim in sims]
22+
# in Stan 2.15 the default acceptance rate was changed, ess dropped
23+
self.assertGreater(sum(esses) / len(esses), 1200)

pystan/tests/test_rstan_stanfit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_init_zero_exception_inf_grad(self):
1616
real x;
1717
}
1818
model {
19-
lp__ <- 1 / log(x);
19+
target += 1 / log(x);
2020
}
2121
"""
2222
sm = StanModel(model_code=code)

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ def find_version(*parts):
9999
from distutils.extension import Extension
100100

101101
stan_include_dirs = ['pystan/stan/src',
102-
'pystan/stan/lib/stan_math/',
103-
'pystan/stan/lib/stan_math/lib/eigen_3.2.9',
104-
'pystan/stan/lib/stan_math/lib/boost_1.62.0',
105-
'pystan/stan/lib/stan_math/lib/cvodes_2.9.0/include']
102+
'pystan/stan/lib/stan_math_2.15.0/',
103+
'pystan/stan/lib/stan_math_2.15.0/lib/eigen_3.2.9',
104+
'pystan/stan/lib/stan_math_2.15.0/lib/boost_1.62.0',
105+
'pystan/stan/lib/stan_math_2.15.0/lib/cvodes_2.9.0/include']
106106
stan_macros = [
107107
('BOOST_RESULT_OF_USE_TR1', None),
108108
('BOOST_NO_DECLTYPE', None),

0 commit comments

Comments
 (0)