-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
69b7975
commit 9c7ed77
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pymc3 as pm | ||
import numpy as np | ||
|
||
|
||
def test_coords(): | ||
chains = 2 | ||
n_features = 3 | ||
n_samples = 10 | ||
|
||
coords = {"features": np.arange(n_features)} | ||
|
||
with pm.Model(coords=coords): | ||
a = pm.Uniform("a", -100, 100, dims="features") | ||
b = pm.Uniform("b", -100, 100, dims="features") | ||
tr = pm.sample(n_samples, chains=chains, return_inferencedata=True) | ||
|
||
assert "features" in tr.posterior.a.coords.dims | ||
assert "features" in tr.posterior.b.coords.dims |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
arviz>=0.8.3 | ||
arviz>=0.9.0 | ||
theano>=1.0.4 | ||
numpy>=1.13.0 | ||
scipy>=0.18.1 | ||
|