Skip to content

Commit 9c7ed77

Browse files
Add simple test case for coords behavior (#3977)
* Add simple test case for coords behavior * Install arviz directly from github as temporary fix * Revert attempt to point to latest arviz github * Bump arviz requirement Co-authored-by: Michael Osthege <[email protected]>
1 parent 69b7975 commit 9c7ed77

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

pymc3/tests/test_coords.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pymc3 as pm
2+
import numpy as np
3+
4+
5+
def test_coords():
6+
chains = 2
7+
n_features = 3
8+
n_samples = 10
9+
10+
coords = {"features": np.arange(n_features)}
11+
12+
with pm.Model(coords=coords):
13+
a = pm.Uniform("a", -100, 100, dims="features")
14+
b = pm.Uniform("b", -100, 100, dims="features")
15+
tr = pm.sample(n_samples, chains=chains, return_inferencedata=True)
16+
17+
assert "features" in tr.posterior.a.coords.dims
18+
assert "features" in tr.posterior.b.coords.dims

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
arviz>=0.8.3
1+
arviz>=0.9.0
22
theano>=1.0.4
33
numpy>=1.13.0
44
scipy>=0.18.1

0 commit comments

Comments
 (0)