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)
| 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 | """ |
nothing calls this directly
no test coverage detected