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

Commit bd37edc

Browse files
committed
TST: add test for dtypes
1 parent 29cc64b commit bd37edc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pystan/tests/test_extract.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,13 @@ def test_extract_thin(self):
8686
ss = fit.extract(inc_warmup=True, permuted=False)
8787
self.assertEqual(ss.shape, (1000, 4, 9))
8888
self.assertTrue((~np.isnan(ss)).all())
89+
90+
def test_extract_dtype(self):
91+
dtypes = {"alpha": np.int, "beta": np.int}
92+
ss = self.fit.extract(dtypes = dtypes)
93+
alpha = ss['alpha']
94+
beta = ss['beta']
95+
lp__ = ss['lp__']
96+
self.assertEqual(alpha.dtype, np.dtype(np.int))
97+
self.assertEqual(beta.dtype, np.dtype(np.int))
98+
self.assertEqual(lp__.dtype, np.dtype(np.float))

0 commit comments

Comments
 (0)