REF: Migrate to ArviZ 1.0 (InferenceData -> DataTree)#642
REF: Migrate to ArviZ 1.0 (InferenceData -> DataTree)#642AAlexxis222 wants to merge 11 commits intopymc-devs:mainfrom
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
aloctavodia
left a comment
There was a problem hiding this comment.
In many places you are apllying formating issues. Are you sure these are needed?
|
Hi! Yes, I applied the formatting tools ( I wanted to ensure the CI was green. However, if you prefer to keep the diff minimal, I can try to revert the style changes and only keep the logic migration (though |
|
That's fine, just checking. |
There was a problem hiding this comment.
Pull request overview
This pull request migrates pymc-extras to support ArviZ 1.0 by replacing InferenceData with xarray.DataTree. The migration updates imports, changes attribute access patterns from dot notation to dictionary-style access, and updates API methods.
Changes:
- Replaced
arviz.InferenceDataimports withxarray.DataTreeand updatedarvizimports toarviz_basewhere needed - Changed attribute access from
.posteriorto["posterior"]throughout the codebase - Replaced
.extend()method calls with.update()and.add_groups()with direct dictionary assignment - Updated
dict_to_datasetparameter names fromlibrarytoinference_libraryanddefault_dimstosample_dims - Applied code formatting improvements (multi-line formatting, import cleanup)
Reviewed changes
Copilot reviewed 85 out of 87 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pymc_extras/model/marginal/marginal_model.py | Updated imports and DataTree usage, but has parameter naming issue |
| pymc_extras/utils/prior.py | Updated type annotations and DataTree access patterns |
| pymc_extras/inference/laplace_approx/*.py | Updated InferenceData to DataTree, dict_to_dataset parameters |
| pymc_extras/inference/pathfinder/*.py | Updated DataTree usage and API calls |
| pymc_extras/inference/dadvi/dadvi.py | Updated DataTree construction |
| pymc_extras/statespace/core/statespace.py | Updated type annotations and DataTree access |
| pymc_extras/model_builder.py | Updated .extend() to .update() and .add_groups() to dict assignment |
| tests/* | Updated test fixtures to create DataTree objects and use dict-style access |
| Various formatting changes | Multi-line formatting improvements throughout |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The CI needs to be green, but this PR shouldn't touch 87 files. You should be running the pre-commit hooks we have defined locally that should be sufficient. |
Migrates pymc-extras to support ArviZ 1.0, replacing InferenceData with xarray.DataTree.
Changes:
Verification: