Skip to content

Commit

Permalink
Update tests for posterior_to_prior (#515)
Browse files Browse the repository at this point in the history
* Update tests for posterior_to_prior

* Update test
  • Loading branch information
rohanbabbar04 authored Aug 13, 2024
1 parent 9c7bde3 commit c5c58b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion preliz/ppls/agnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def posterior_to_prior(model, idata, alternative=None):

if alternative is None:
for var, dist in model_info.items():
print(var)
dist._fit_mle(posterior[var].values)
new_priors[var] = dist
else:
Expand Down
8 changes: 6 additions & 2 deletions preliz/tests/test_posterior_to_prior.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import re

import preliz as pz
import pymc as pm

Expand All @@ -12,6 +14,8 @@

def test_p2p():
pz.posterior_to_prior(model, idata)
pz.posterior_to_prior(model, idata, alternative="auto")
assert 'Gamma\x1b[0m("b", alpha=' in pz.posterior_to_prior(model, idata, alternative="auto")
pz.posterior_to_prior(model, idata, alternative=[pz.LogNormal()])
pz.posterior_to_prior(model, idata, alternative={"b": [pz.Gamma(mu=0)]})
assert 'Gamma\x1b[0m("b", mu=' in pz.posterior_to_prior(
model, idata, alternative={"b": [pz.Gamma(mu=0)]}
)

0 comments on commit c5c58b6

Please sign in to comment.