HSSM v0.4.0 Notebook Update Report
Breaking Changes Addressed
Based on the v0.4.0 changelog, the following breaking changes required updates:
model.summary() and model.plot_trace() methods removed → replaced with az.summary() and az.plot_trace_dist()
model.sample() now returns xarray.DataTree instead of arviz.InferenceData
- ArViZ 1.0+ API changes:
az.plot_posterior → az.plot_dist, az.plot_trace → az.plot_trace_dist
- ArViZ 1.0+ no longer supports kwargs like
ref_val, color, hdi_prob, ax, compact, kind, marginals
Successfully Updated and Executed Notebooks
| Notebook |
Changes Made |
Status |
likelihoods.ipynb |
Added import arviz as az, changed model.summary() → az.summary(sample), model.plot_trace() → az.plot_trace_dist(sample) |
✅ Success |
plotting.ipynb |
Updated docs, changed model.summary() → az.summary(cav_data_traces), model.plot_trace() → az.plot_trace_dist(cav_data_traces) + plt.tight_layout() |
✅ Success |
lapse_prob_and_dist.ipynb |
Added import arviz as az, changed model.summary(lapse_trace) → az.summary(lapse_trace), model.plot_trace(lapse_trace) → az.plot_trace_dist(lapse_trace) |
✅ Success |
tutorial_stim_coding.ipynb |
Changed 4 instances of model.summary() → az.summary(model.traces) |
✅ Success |
initial_values.ipynb |
No changes needed |
✅ Success |
compile_logp.ipynb |
No changes needed |
✅ Success |
pymc.ipynb |
No changes needed |
✅ Success |
rlssm_quickstart.ipynb |
No changes needed |
✅ Success |
save_load_tutorial.ipynb |
Use traces.to_netcdf() and vi_traces.to_netcdf() directly; load with az.from_netcdf() |
✅ Success |
do_operator.ipynb |
Changed predictive_idata_to_dataframe → predictive_dt_to_dataframe |
✅ Success |
choice_only_models.ipynb |
az.plot_posterior → az.plot_dist, removed ref_val/ref_val_color; az.plot_trace → az.plot_trace_dist |
✅ Success |
tutorial_bayesian_t_test.ipynb |
az.plot_posterior → az.plot_dist, removed ax, color, hdi_prob params |
✅ Success |
hmm_ddm_regime_switching.ipynb |
az.plot_trace → az.plot_trace_dist, removed compact; az.plot_pair removed kind, marginals, figsize, point_estimate, reference_values, reference_values_kwargs |
✅ Success |
Notebooks with Issues
Issues Fixed but Could Not Execute (Timeout/Kernel Issues)
| Notebook |
Issue |
hssm_tutorial_workshop_1.ipynb |
Fixed deprecated calls; kernel hssm519 not found |
hssm_tutorial_workshop_2.ipynb |
Fixed deprecated calls; execution timed out |
Deeper API Changes Required (Not Simple Method Replacements)
| Notebook |
Error |
Root Cause |
tutorial_trial_wise_parameters.ipynb |
'HSSM' object has no attribute 'add_likelihood_parameters_to_idata' |
Method removed in v0.4.0 |
rlssm_tutorial.ipynb |
cannot import name 'decorate_atomic_simulator' from 'hssm.utils' |
Utility function removed |
rlssm_rlwm_model.ipynb |
cannot import name 'decorate_atomic_simulator' from 'hssm.utils' |
Utility function removed |
add_custom_rlssm_model.ipynb |
cannot import name 'decorate_atomic_simulator' from 'hssm.utils' |
Utility function removed |
main_tutorial.ipynb |
'DataTree' object has no attribute 'stack' |
DataTree doesn't have InferenceData's stack() method |
variational_inference_hierarchical.ipynb |
No model on context stack |
PyMC/Bambi API change |
scientific_workflow_hssm.ipynb |
max_subplots exceeds limit (88 vs 40) |
Too many variables for pair plot - requires var_names limiting |
External Dependency Issues (Not HSSM Code Issues)
| Notebook |
Error |
Root Cause |
tutorial_bayeux.ipynb |
No module named 'bayeux' |
Optional dependency not installed |
bayesflow_lre_integration.ipynb |
TensorFlow/Keras model loading error |
Model format incompatibility |
blackbox_contribution_onnx_example.ipynb |
cannot pickle 'onnxruntime...InferenceSession' |
ONNX runtime issue |
jax_callable_contribution_onnx_example.ipynb |
max_subplots exceeds limit |
Matplotlib config issue |
poisson_race.ipynb |
Style arviz-whitegrid not found |
Matplotlib style removed |
Execution Timeouts
| Notebook |
Note |
pymc_to_hssm.ipynb |
Timed out |
tutorial_p_outlier_regression.ipynb |
Timed out |
variational_inference.ipynb |
Timed out |
Summary
- 14 notebooks successfully updated and executed
- 6 notebooks require deeper API fixes or have execution issues
- 5 notebooks have external dependency issues (not code issues)
- 3 notebooks timed out
Notes for Fixing Remaining Notebooks
ArViZ 1.0+ API Changes
az.plot_posterior() → az.plot_dist()
az.plot_trace() → az.plot_trace_dist()
- Parameters like
ref_val, ref_val_color, color, ax, hdi_prob, compact, kind, marginals, figsize, point_estimate, reference_values, reference_values_kwargs are no longer supported in the new ArViZ plots API
DataTree API Compatibility
xarray.DataTree doesn't have all the methods of arviz.InferenceData (e.g., stack(), to_netcdf() on az module)
- For saving: Use
datatree.to_netcdf(path) directly on the DataTree returned by model.sample()
- For loading: Use
az.from_netcdf(path) which returns a DataTree
Removed Utility Functions
hssm.utils.predictive_idata_to_dataframe → hssm.utils.predictive_dt_to_dataframe
decorate_atomic_simulator has been removed from hssm.utils
External Dependencies
Some notebooks require optional dependencies (e.g., bayeux, bayesflow, onnxruntime) that may not be installed in all environments.
matplotlib max_subplots
Some notebooks generate too many subplots and hit the rcParams['plot.max_subplots']=40 limit. Options:
- Limit
var_names to fewer variables
- Increase the limit:
plt.rcParams['plot.max_subplots'] = 100
HSSM v0.4.0 Notebook Update Report
Breaking Changes Addressed
Based on the v0.4.0 changelog, the following breaking changes required updates:
model.summary()andmodel.plot_trace()methods removed → replaced withaz.summary()andaz.plot_trace_dist()model.sample()now returnsxarray.DataTreeinstead ofarviz.InferenceDataaz.plot_posterior→az.plot_dist,az.plot_trace→az.plot_trace_distref_val,color,hdi_prob,ax,compact,kind,marginalsSuccessfully Updated and Executed Notebooks
likelihoods.ipynbimport arviz as az, changedmodel.summary()→az.summary(sample),model.plot_trace()→az.plot_trace_dist(sample)plotting.ipynbmodel.summary()→az.summary(cav_data_traces),model.plot_trace()→az.plot_trace_dist(cav_data_traces)+plt.tight_layout()lapse_prob_and_dist.ipynbimport arviz as az, changedmodel.summary(lapse_trace)→az.summary(lapse_trace),model.plot_trace(lapse_trace)→az.plot_trace_dist(lapse_trace)tutorial_stim_coding.ipynbmodel.summary()→az.summary(model.traces)initial_values.ipynbcompile_logp.ipynbpymc.ipynbrlssm_quickstart.ipynbsave_load_tutorial.ipynbtraces.to_netcdf()andvi_traces.to_netcdf()directly; load withaz.from_netcdf()do_operator.ipynbpredictive_idata_to_dataframe→predictive_dt_to_dataframechoice_only_models.ipynbaz.plot_posterior→az.plot_dist, removedref_val/ref_val_color;az.plot_trace→az.plot_trace_disttutorial_bayesian_t_test.ipynbaz.plot_posterior→az.plot_dist, removedax,color,hdi_probparamshmm_ddm_regime_switching.ipynbaz.plot_trace→az.plot_trace_dist, removedcompact;az.plot_pairremovedkind,marginals,figsize,point_estimate,reference_values,reference_values_kwargsNotebooks with Issues
Issues Fixed but Could Not Execute (Timeout/Kernel Issues)
hssm_tutorial_workshop_1.ipynbhssm519not foundhssm_tutorial_workshop_2.ipynbDeeper API Changes Required (Not Simple Method Replacements)
tutorial_trial_wise_parameters.ipynb'HSSM' object has no attribute 'add_likelihood_parameters_to_idata'rlssm_tutorial.ipynbcannot import name 'decorate_atomic_simulator' from 'hssm.utils'rlssm_rlwm_model.ipynbcannot import name 'decorate_atomic_simulator' from 'hssm.utils'add_custom_rlssm_model.ipynbcannot import name 'decorate_atomic_simulator' from 'hssm.utils'main_tutorial.ipynb'DataTree' object has no attribute 'stack'stack()methodvariational_inference_hierarchical.ipynbNo model on context stackscientific_workflow_hssm.ipynbmax_subplotsexceeds limit (88 vs 40)External Dependency Issues (Not HSSM Code Issues)
tutorial_bayeux.ipynbNo module named 'bayeux'bayesflow_lre_integration.ipynbblackbox_contribution_onnx_example.ipynbcannot pickle 'onnxruntime...InferenceSession'jax_callable_contribution_onnx_example.ipynbmax_subplotsexceeds limitpoisson_race.ipynbStyle arviz-whitegrid not foundExecution Timeouts
pymc_to_hssm.ipynbtutorial_p_outlier_regression.ipynbvariational_inference.ipynbSummary
Notes for Fixing Remaining Notebooks
ArViZ 1.0+ API Changes
az.plot_posterior()→az.plot_dist()az.plot_trace()→az.plot_trace_dist()ref_val,ref_val_color,color,ax,hdi_prob,compact,kind,marginals,figsize,point_estimate,reference_values,reference_values_kwargsare no longer supported in the new ArViZ plots APIDataTree API Compatibility
xarray.DataTreedoesn't have all the methods ofarviz.InferenceData(e.g.,stack(),to_netcdf()on az module)datatree.to_netcdf(path)directly on the DataTree returned bymodel.sample()az.from_netcdf(path)which returns a DataTreeRemoved Utility Functions
hssm.utils.predictive_idata_to_dataframe→hssm.utils.predictive_dt_to_dataframedecorate_atomic_simulatorhas been removed fromhssm.utilsExternal Dependencies
Some notebooks require optional dependencies (e.g.,
bayeux,bayesflow,onnxruntime) that may not be installed in all environments.matplotlib max_subplots
Some notebooks generate too many subplots and hit the
rcParams['plot.max_subplots']=40limit. Options:var_namesto fewer variablesplt.rcParams['plot.max_subplots'] = 100