pymc.backends.zarr.ZarrTrace.to_inferencedata#

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

Convert ZarrTrace to DataTree.

This converts all the groups in the ZarrTrace.root hierarchy into an DataTree 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.

eagerbool

If True, all of the data is loaded into memory. If False, the data is lazily loaded when accessed.

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 DataTree 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 DataTree object.