MCPcopy Index your code
hub / github.com/pydata/xarray / identical

Method identical

xarray/core/datatree.py:1566–1595  ·  view source on GitHub ↗

Like equals, but also checks attributes on all datasets, variables and coordinates, and requires that any inherited coordinates at the tree root are also inherited on the other tree. Parameters ---------- other : DataTree The other tree o

(self, other: DataTree)

Source from the content-addressed store, hash-verified

1564 return set(self.parent.coords if self.parent else []) # type: ignore[arg-type]
1565
1566 def identical(self, other: DataTree) -> bool:
1567 """
1568 Like equals, but also checks attributes on all datasets, variables and
1569 coordinates, and requires that any inherited coordinates at the tree
1570 root are also inherited on the other tree.
1571
1572 Parameters
1573 ----------
1574 other : DataTree
1575 The other tree object to compare to.
1576
1577 See Also
1578 --------
1579 Dataset.identical
1580 DataTree.isomorphic
1581 DataTree.equals
1582 """
1583 if not self.isomorphic(other):
1584 return False
1585
1586 if self.name != other.name:
1587 return False
1588
1589 if self._inherited_coords_set() != other._inherited_coords_set():
1590 return False
1591
1592 return all(
1593 node.dataset.identical(other_node.dataset)
1594 for node, other_node in zip_subtrees(self, other)
1595 )
1596
1597 def filter(self: DataTree, filterfunc: Callable[[DataTree], bool]) -> DataTree:
1598 """

Callers

nothing calls this directly

Calls 3

isomorphicMethod · 0.95
_inherited_coords_setMethod · 0.95
zip_subtreesFunction · 0.90

Tested by

no test coverage detected