Depends on: #849 must be merged first.
Update notebooks to use new xr.Dataset API
Following the consolidation of experiment design-matrix attributes into xr.Dataset objects (#199), the old attribute names (pre_X, pre_y, post_X, post_y, datapre_control, datapre_treated, datapost_control, datapost_treated, X, y) are deprecated. They still work via backward-compatible @property accessors that emit DeprecationWarning, but notebooks should be migrated to the new API.
New API
| Experiment type |
Old attributes |
New access pattern |
| InterruptedTimeSeries |
result.pre_X, result.pre_y, result.post_X, result.post_y |
result.pre_design["X"], result.pre_design["y"], result.post_design["X"], result.post_design["y"] |
| SyntheticControl |
result.datapre_control, result.datapre_treated, result.datapost_control, result.datapost_treated |
result.pre_design["control"], result.pre_design["treated"], result.post_design["control"], result.post_design["treated"] |
| Formula-based (DiD, RD, RK, PrePostNEGD, PiecewiseITS, PanelRegression) |
result.X, result.y |
result.design["X"], result.design["y"] |
Affected notebooks
These notebooks access deprecated attributes directly and should be updated:
Notes
- The deprecated properties will be removed in a future release.
- Notebooks should be re-run after updating to verify outputs are unchanged.
- Some notebooks may access attributes that were not deprecated (e.g.,
result.causal_impact, result.post_impact); these should be reviewed but may not need changes.
Update notebooks to use new
xr.DatasetAPIFollowing the consolidation of experiment design-matrix attributes into
xr.Datasetobjects (#199), the old attribute names (pre_X,pre_y,post_X,post_y,datapre_control,datapre_treated,datapost_control,datapost_treated,X,y) are deprecated. They still work via backward-compatible@propertyaccessors that emitDeprecationWarning, but notebooks should be migrated to the new API.New API
result.pre_X,result.pre_y,result.post_X,result.post_yresult.pre_design["X"],result.pre_design["y"],result.post_design["X"],result.post_design["y"]result.datapre_control,result.datapre_treated,result.datapost_control,result.datapost_treatedresult.pre_design["control"],result.pre_design["treated"],result.post_design["control"],result.post_design["treated"]result.X,result.yresult.design["X"],result.design["y"]Affected notebooks
These notebooks access deprecated attributes directly and should be updated:
docs/source/notebooks/did_pymc.ipynb—result.causal_impact(not deprecated, but review for other attrs)docs/source/notebooks/did_pymc_banks.ipynb—result.causal_impactdocs/source/notebooks/rd_donut_pymc.ipynb—result.discontinuity_at_threshold,result.fit_datadocs/source/notebooks/its_pymc.ipynb—result.post_impact,result.datapostdocs/source/notebooks/sc_pymc.ipynb—result.post_impact_cumulativedocs/source/notebooks/geolift1.ipynb—result.post_impact_cumulativeNotes
result.causal_impact,result.post_impact); these should be reviewed but may not need changes.