pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.63k stars 1.09k forks source link

Updates to DataTree.equals and DataTree.identical #9627

Closed shoyer closed 1 month ago

shoyer commented 1 month ago

In contrast to equals, identical now also checks that any inherited variables are inherited on both objects. However, they do not need to be inherited from the same source. This aligns the behavior of identical with the DataTree __repr__.

I've also removed the from_root argument from equals and identical. If a user wants to compare trees from their roots, a better (simpler) inference is to simply call these methods on the .root properties. I would also like to remove the strict_names argument, but that will require switching to use the new zip_subtrees (#9623) first.