xarray
xarray copied to clipboard
DAS-2067 - Migrate datatree io.py and common.py
This PR migrates what I believe is the last actual source code out of the xarray/datatree_/datatree directory into xarray/core. This is another piece of #8572.
I made a couple of decisions that I'd love some feedback/extra eyes on:
- I moved the remaining functions from
xarray/datatree_/datatree/io.pyinto their own module, rather thanxarray/backends/api.py. It felt like these were a little separate, but I can definitely be convinced otherwise. - I created a subclass for
TreeAttrAccessMixin. I really just wanted to swap over to usingAttrAccessMixin, but I ran into issues with__slots__. Looking at it, I think I would need to work on theDataTree,TreeNodeandNamedNodeclasses. I can go down that path, but thought I'd put up this PR for discussion before beginning that effort.
- [x] Continues #8572 (Contributed to last subitem of "Merge in code for DataTree class.")
- ~~Tests added~~
- [x] User visible changes (including notable bug fixes) are documented in
whats-new.rst - ~~New functions/methods are listed in
api.rst~~