Advice for future-proofing?

Hi All. I am getting ready to send Think Bayes into production, and I am dealing with a couple of recent changes in the PyMC3 API. Can you help me write my examples in a way that will be as future-proof as possible?

Currently, if I build my environment in Conda, I get

pymc3                     3.10.0             pyhd8ed1ab_0    conda-forge
arviz                     0.11.0             pyhd8ed1ab_0    conda-forge

I know these are not the most current, but I want readers to be able to replicate my env as easily as possible (and these versions also work on Colab).

One of the issues is the change in the interface to plot_posterior. Am I right that it will be safe to import ArviZ explicitly and call az.plot_posterior?

The other issue is the change in the return type from pm.sample. Currently I am using the return_inferencedata=False argument. But it looks like that might not exist in 3.11. Is that true or is this something I can count on for the future?

I know you all are trying to keep these interfaces stable, but I am having a hard time writing examples that will work for more than a few weeks :frowning:

1 Like

You can count on this, we have no plans of modifying this and if we somehow ended modifying az.plot_posterior is would have a deprecation warning for a very long time, which is what we are doing with az.plot_joint.

I do want to note that what you can’t count on being stable are the default values for many of the arguments in ArviZ functions, if you rely on az.compare using waic instead of loo you should either pass this explicitly to the function or use rcParams to set a default globally (most of the defaults that could change have an rcParam but not all of them do yet).

I think this will only be removed in 4.0, which is not far, check out the timeline to be up to date about this, things are a bit hectic right now. v3 should be frozen and still get bugfixes for a while but no new features will be added.

1 Like

Sounds good on both fronts. Thank you!