Skip to content

Commit

Permalink
DAS-2062: renames as_array -> to_dataarray
Browse files Browse the repository at this point in the history
  • Loading branch information
flamingbear committed Mar 4, 2024
1 parent e9ea165 commit 94b17f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ New Features
Breaking changes
~~~~~~~~~~~~~~~~

- ``Datatree``'s ``as_array`` renamed ``to_dataarray`` to align with ``Dataset``. (:pull:`8789`)
By `Owen Littlejohns <https://github.com/owenlittlejohns>`_ and `Matt Savoie
<https://github.com/flamingbear>`_


Deprecations
~~~~~~~~~~~~
Expand All @@ -58,7 +62,7 @@ Internal Changes
By `Matt Savoie <https://github.com/flamingbear>`_ and `Tom Nicholas
<https://github.com/TomNicholas>`_.
- Migrates ``datatree`` functionality into ``xarray/core``. (:pull: `8789`)
By `Owen Littlejohns <https://github.com/owenlittlejohns`_ and `Tom Nicholas
By `Owen Littlejohns <https://github.com/owenlittlejohns>`_ and `Tom Nicholas
<https://github.com/TomNicholas>`_.


Expand Down
2 changes: 1 addition & 1 deletion xarray/core/datatree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,7 @@ def merge_child_nodes(self, *paths, new_path: T_Path) -> DataTree:

# TODO some kind of .collapse() or .flatten() method to merge a subtree

def as_dataarray(self) -> DataArray:
def to_dataarray(self) -> DataArray:
return self.ds.as_dataarray()

@property
Expand Down

0 comments on commit 94b17f9

Please sign in to comment.