pymc.backends.zarr.ZarrTrace.to_datatree#
- ZarrTrace.to_datatree(save_warmup=False, eager=False)[source]#
Convert
ZarrTracetoDataTree.The zarr group hierarchy naturally translates into a
DataTree, so this conversion opens the whole hierarchy withxarray.open_datatree(). The_sampling_stategroup is excluded, and the warmup groups are only included ifsave_warmupisTrue. Each group’s attributes are extended with the globaltuning_stepsandsampling_timemetadata.- Parameters:
Notes
xarrayrequires the zarr groups to have consolidated metadata, which is written by callingzarr.consolidate_metadata()on the root’s store. Consolidated metadata is not (yet) part of the zarr v3 specification, so zarr will warn about it. The returnedDataTreeoperates on freshly opened datasets, so future changes to theZarrTraceare not reflected in it.