pymc.backends.zarr.ZarrTrace.to_inferencedata#

ZarrTrace.to_inferencedata(save_warmup=False)[source]#

Convert ZarrTrace to InferenceData.

This converts all the groups in the ZarrTrace.root hierarchy into an InferenceData object. The only exception is that _sampling_state is excluded.

Parameters:
save_warmupbool

If True, all of the warmup groups are stored in the inference data object.

Notes

xarray and in turn arviz require the zarr groups to have consolidated metadata. To achieve this, a new consolidated store is constructed by calling zarr.consolidate_metadata() on the root’s store. This means that the returned InferenceData object will operate on a different storage unit than the calling ZarrTrace, so future changes to the ZarrTrace won’t be automatically reflected in the returned InferenceData object.