Xarray-FMCR uses Xarray datatrees to provide a standard in-memory and storage representation of Forecast Model Run Collections that can then be access via the various forecast views (best estimate/constant offset/constant time/model run).
def from_model_runs(datasets: dict[str | datetime.datetime | pd.Timestamp, xr.Dataset] | Iterable[xr.dataset]) -> datatree.DataTree:
"""
From a collection of xarray datasets, assemble a datatree of forecasts
If datasets contain a single length dimension of `forecast_reference_time`, or an attribute as such, they can be passed in as an `Iterable`, otherwise a dictionary mapping `forecast_reference_time` to datasets can be passed in. Dimensions other than time are expected to match.