We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import starsim as ss p = 0.123 def prob_func(module=None, sim=None, size=None): return p d1 = ss.HIV(init_prev=p) # fine d2 = ss.HIV(init_prev=ss.bernoulli(p)) # fine d3 = ss.HIV(init_prev=prob_func) # NOT FINE d4 = ss.HIV(init_prev=ss.bernoulli(prob_func)) # fine di = [d1, d2, d3, d4] sims = [ss.Sim(diseases=d) for d in di] sims = ss.parallel(sims).sims for s in sims: print(s.diseases.hiv.pars.init_prev)
gives
ss.bernoulli(pars_hiv_init_prev, pars={'p': 0.123}) # fine ss.bernoulli(pars_hiv_init_prev, pars={'p': 0.123}) # fine ss.bernoulli(pars_hiv_init_prev, pars={'p': 0.05}) # WRONG, no error ss.bernoulli(pars_hiv_init_prev, pars={'p': <function prob_func at 0x72d70041afc0>}) # fine
Should either just work, or raise an exception
The text was updated successfully, but these errors were encountered:
Now raises an exception, but should work
Sorry, something went wrong.
Closed by #778
cliffckerr
No branches or pull requests
gives
Should either just work, or raise an exception
The text was updated successfully, but these errors were encountered: