stan-dev / posteriordb

Database with posteriors of interest for Bayesian inference
161 stars 26 forks source link

Update python stan methods #238

Closed ahartikainen closed 2 years ago

ahartikainen commented 2 years ago

Add backend options for stan framework. ("pystan", "pystan2", "cmdtanpy")

Add CmdStanPy as the default Stan backend.

Change code to work with PyStan (3+).

Adds posteriordb.STAN_BACKEND "global" variable that is used automatically by posterior class.

To change this value users can call posteriordb.change_stan_backend function which accepts {"cmdstanpy", "pystan", "pystan2"}

ahartikainen commented 2 years ago

Should we add tests for different backends + pymc3 model?

MansMeg commented 2 years ago

The R tests are failing now of other reasons so skip them for now.

Yes. I think it would be good to have a backend to test PyMC3 models (and different backends). I'm not sure how many such models we have right now?

But I guess 8schools is sufficient for this?

ahartikainen commented 2 years ago

Yes, 8school is fine.

MansMeg commented 2 years ago

Do you want to add that or should I merge it as is and then put it up as an issue?

ahartikainen commented 2 years ago

Let's add some tests for this PR.

MansMeg commented 2 years ago

Did you want to add some tests here or should I merge it? Im going to start to move the python code to the python repo so it would be great to be able to get it in before we move it.

ahartikainen commented 2 years ago

Oh yes, I have not had time to make these tests. So let's merge and create new repos. I can think about tests after that.

MansMeg commented 2 years ago

No problem! Then Ill take it from here.