Should data nodes and tree nodes be unrelated classes? #4
Description
Currently a DatasetNode
is both a node of the tree (so can have children) and can wrap a single xarray.Dataset
. If we followed #3 , we could instead choose to make TreeNodes unable to wrap Datasets directly, in favour of instead storing Dataset objects as children.
This would mean that multiple Datasets could be stored as the children of a single node, but I'm not sure if that's desirable or not. It would also ensure that the class representing a node of the tree is totally distinct from an xarray.Dataset (neither inheriting from xarray.Dataset nor wrapping it, only pointing to it as a child).
In conjunction with #3 this would mean that the syntax for selecting the variable 'pressure'
from the dataset stored under the node 'weather'
would be simply dt['weather']['pressure']
. (Although then selecting via dt['weather/pressure']
would become trickier.)