
Datatree provides hierarchical data structure, more flexible than a single xarray.Dataset object. It is able to represent netCDF files / Zarr stores with multiple nested groups in a single in-memory object, but datatree.DataTree objects have many other uses, such as:
* organising many related datasets, e.g. results of the same experiment with different parameters, or simulations of the same system using different models, * analysing similar data at multiple resolutions simultaneously, such as when doing a convergence study, * comparing heterogenous but related data, such as experimental and theoretical data, I/O with nested data formats such as netCDF / Zarr groups.
The approach used is based on benbovy's DatasetNode example, the basic idea is that each tree node wraps a up to a single xarray.Dataset. The differences are that datatree:
* uses a node structure inspired by anytree for the tree, * implements path-like getting and setting, * has functions for mapping user-supplied functions over every node in the tree, * automatically dispatches some of xarray.Dataset's API over every node in the tree (such as .isel), * has a bunch of tests, * has a printable representation