Closed slevang closed 7 months ago
When applying a function to a node that has attrs but no data:
dt = DataTree() dt.attrs = {"foo": "bar"} ds = xr.Dataset({"x": xr.DataArray(0)}) dt["y"] = DataTree(data=xr.DataArray(0, name="y")) DataTree('None', parent=None) │ Dimensions: () │ Data variables: │ *empty* │ Attributes: │ foo: bar └── DataTree('y') Dimensions: () Data variables: y int64 0
map_over_subtree drops the attributes:
map_over_subtree
dt.attrs {'foo': 'bar'} dt.compute().attrs {}
Related: #262
When applying a function to a node that has attrs but no data:
map_over_subtree
drops the attributes:Related: #262