Migrate datatree.py module into xarray.core.
This PR migrates the datatree.py module to xarray/core/datatree.py, as part of the on-going effort to merge xarray-datatree into xarray itself.
Most of the changes are import path changes, and type-hints, but there is one minor change to the methods available on the DataTree class: to_array has been converted to to_dataarray, to align with the method on Dataset. (See conversation here)
This PR was initially published as a draft here.
- [x] Completes migration step for
datatree/datatree.pyhttps://github.com/pydata/xarray/issues/8572 - [x] Tests added
- [ ] User visible changes (including notable bug fixes) are documented in
whats-new.rst - [ ] New functions/methods are listed in
api.rst
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient. If you have questions, some answers may be found in our contributing guidelines.
@TomNicholas - I think this PR is at a point now where it can be reviewed again in earnest. 🤞
With @shoyer 's blessing (in the meeting) I hereby merge this PR
Congratulations on completing your first pull request! Welcome to Xarray! We are proud of you, and hope to see you again! 