Summary
Under arviz 1.x, az.plot_trace and az.plot_trace_dist are two different plots, and the name that carries over from arviz 0.x is the wrong one. lectures/ar1_turningpts.md was correctly migrated to plot_trace_dist in #584, but PR #1020 changes it back to plot_trace, which silently drops the marginal density panels from the figure. lectures/ar1_bayes.md has the same problem, left over from the #930 build fix, and was never migrated.
Neither case fails the build — the figure just quietly loses half its content.
What changed in arviz 1.x
Straight from the 1.2.0 docstrings:
| function |
arviz 1.x docstring |
equivalent in arviz 0.x |
az.plot_trace |
"Plot iteration versus sampled values." |
no direct equivalent — trace lines only |
az.plot_trace_dist |
"Plot 1D marginal distributions and iteration versus sampled values." |
this is the old az.plot_trace |
So a lecture that used az.plot_trace under 0.x and still calls az.plot_trace under 1.x renders a strictly smaller figure than it used to, with no warning and no error. plot_trace_dist is the call that preserves the original output.
Affected lectures
| lecture |
current call |
status |
lectures/ar1_turningpts.md (in draw_from_posterior) |
az.plot_trace_dist(plot_data, var_names=['ρ', 'σ']) on main → az.plot_trace(...) in #1020 |
regression introduced by #1020; main is currently correct |
lectures/ar1_bayes.md (two call sites, az.plot_trace(trace) and az.plot_trace(trace_y0)) |
az.plot_trace |
never migrated; densities missing on main today |
How this happened
The three commits tell the story:
Suggested fix
Standardise on az.plot_trace_dist in both lectures: revert the ar1_turningpts.md line in #1020 back to plot_trace_dist, and update the two ar1_bayes.md call sites to match. Both lectures install arviz unpinned at runtime, so neither should pin a version — fix forward to the 1.x API, consistent with how the other in-lecture pip packages are handled.
Worth a short comment at the call site noting that plot_trace_dist is the 1.x name for what used to be plot_trace, so the next person reading it doesn't "fix" it again.
Related
Same arviz 0.x → 1.x class of breakage as the az.from_dict and az.summary failures in sargent_surico.md, diagnosed in #1020. Earlier instances: #929, #935.
Summary
Under arviz 1.x,
az.plot_traceandaz.plot_trace_distare two different plots, and the name that carries over from arviz 0.x is the wrong one.lectures/ar1_turningpts.mdwas correctly migrated toplot_trace_distin #584, but PR #1020 changes it back toplot_trace, which silently drops the marginal density panels from the figure.lectures/ar1_bayes.mdhas the same problem, left over from the #930 build fix, and was never migrated.Neither case fails the build — the figure just quietly loses half its content.
What changed in arviz 1.x
Straight from the 1.2.0 docstrings:
az.plot_traceaz.plot_trace_distaz.plot_traceSo a lecture that used
az.plot_traceunder 0.x and still callsaz.plot_traceunder 1.x renders a strictly smaller figure than it used to, with no warning and no error.plot_trace_distis the call that preserves the original output.Affected lectures
lectures/ar1_turningpts.md(indraw_from_posterior)az.plot_trace_dist(plot_data, var_names=['ρ', 'σ'])onmain→az.plot_trace(...)in #1020mainis currently correctlectures/ar1_bayes.md(two call sites,az.plot_trace(trace)andaz.plot_trace(trace_y0))az.plot_tracemaintodayHow this happened
The three commits tell the story:
figsizekwarg fromaz.plot_traceinar1_turningpts.mdto unbreak the build under arviz 1.x. A minimal fix that left the call as trace-only.ar1_turningpts.mdtoaz.plot_trace_dist(plot_data, var_names=['ρ', 'σ']), restoring the density panels.ar1_bayes.mdwas not touched.ar1_turningpts.mdback toaz.plot_trace, undoing [ar1_turningpts] Removed PyMC and changed the style #584. Most likely a 0.x-from-memory correction, sinceplot_traceis the name everyone knows.Suggested fix
Standardise on
az.plot_trace_distin both lectures: revert thear1_turningpts.mdline in #1020 back toplot_trace_dist, and update the twoar1_bayes.mdcall sites to match. Both lectures install arviz unpinned at runtime, so neither should pin a version — fix forward to the 1.x API, consistent with how the other in-lecture pip packages are handled.Worth a short comment at the call site noting that
plot_trace_distis the 1.x name for what used to beplot_trace, so the next person reading it doesn't "fix" it again.Related
Same arviz 0.x → 1.x class of breakage as the
az.from_dictandaz.summaryfailures insargent_surico.md, diagnosed in #1020. Earlier instances: #929, #935.