Did something happen to plot_posterior?

My conda environment collapsed under its own weight recently, so I am starting fresh. I have

pymc3                     3.11.1             pyhd8ed1ab_0    conda-forge
arviz                        0.11.2             pyhd3eb1b0_0  

When I run plot_posterior like this

with model3:
    pm.plot_posterior(trace3, var_names=['a', 'b']);

I am getting

AttributeError: module 'pymc3' has no attribute 'plot_posterior'

Any idea what the problem is?

1 Like

We deleted the aliases to ArviZ functions in the last pymc3 release, you now have to use az.plot_posterior explicitly.

I personally would recommend sticking with explicit ArviZ calling for plotting and stats, but if there are strong preferences on using arviz via aliases defined in pymc they may be back again: Bring back ArviZ wrappers with DeprecationWarnings · Issue #4528 · pymc-devs/pymc3 · GitHub

1 Like

Thanks for the quick reply! I will switch to calling ArviZ directly.

Can I gently suggest that API changes like this should be preceded by a DeprecatedWarning?

1 Like

Sorry this caused you friction. I thought we did do that but if we missed it it’s definitely a big oversight and not the standard we hold ourselves to. This change was made a bit too abrupt and as you can see in the issue we are considering reverting it.

Thanks, Thomas. It’s possible that I leapfrogged the version that had the warning. One of the challenges I have in maintaining the environment for Think Bayes is that I need a combination of versions that works on Conda and Colab. That intersection is sometimes small or nonexistent. Also, Conda seems confused about what versions of PyMC3 and ArviZ are compatible. For example, yesterday I ran into this

Package arviz conflicts for:
pymc3==3.10.0 -> arviz[version='>=0.9.0']

I believe that 11 is in fact greater than 9, but Conda disagrees. Anyway, I’ll get it figured out.

1 Like

Thanks for the laughter :stuck_out_tongue:

We have brought the wrappers back, but adhering more to arviz naming: Release PyMC3 3.11.2 (14 March 2021) · pymc-devs/pymc3 · GitHub