arviz-base is a Python package that provides core ArviZ features and converters, serving as a fundamental component of the modular ArviZ 1.0 ecosystem. It focuses on data structures, primarily leveraging `xarray.DataTree`, and conversion utilities from various probabilistic programming languages (PPLs). This library, currently at version 1.0.0, is under active development as part of the broader ArviZ refactoring, aiming for increased flexibility and a minimal dependency footprint.
pip install arviz-baseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates loading an example dataset using `load_arviz_data` and then extracting data with `extract`. It also shows how to convert raw Python dictionaries containing NumPy arrays into an ArviZ-compatible `xarray.DataTree` using `from_dict`.
Migrate your data handling to use `xarray.DataTree` structures and `arviz_base`'s new conversion and extraction functions. Consult the ArviZ migration guide.
If you require statistical summaries or visualizations, install `arviz-stats` (`pip install arviz-stats`) and `arviz-plots` (`pip install arviz-plots`), or install `arviz` with relevant I/O and plotting extras (e.g., `pip install "arviz[netcdf4,matplotlib]"`).
Install the specific I/O backend you need separately, e.g., `pip install netcdf4` or `pip install zarr`. When installing `arviz` (the meta-package), these can be specified as extras, e.g., `pip install "arviz[netcdf4]"`.
Install xarray: `pip install xarray` or `pip install "arviz-base"` (which should pull `xarray` as a dependency).
Update your code to use `xarray.DataTree` or `arviz_base`'s conversion functions like `from_dict` or `from_cmdstanpy` to create `DataTree` objects. Refer to the ArviZ migration guide for detailed steps.
Ensure that the input arrays have consistent shapes and the correct number of dimensions corresponding to the `chain`, `draw`, and variable-specific dimensions expected by ArviZ. For instance, posterior samples usually require `(chain, draw, *variable_dimensions)`.