xarray icon indicating copy to clipboard operation
xarray copied to clipboard

DAS-2067 - Migrate datatree io.py and common.py

Open owenlittlejohns opened this issue 1 year ago • 0 comments

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.py into their own module, rather than xarray/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 using AttrAccessMixin, but I ran into issues with __slots__. Looking at it, I think I would need to work on the DataTree, TreeNode and NamedNode classes. 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~~

owenlittlejohns avatar May 06 '24 23:05 owenlittlejohns