(self: DataTree, parent: DataTree, name: str)
| 561 | self._close = dataset._close |
| 562 | |
| 563 | def _pre_attach(self: DataTree, parent: DataTree, name: str) -> None: |
| 564 | super()._pre_attach(parent, name) |
| 565 | if name in parent.dataset.variables: |
| 566 | raise KeyError( |
| 567 | f"parent {parent.name} already contains a variable named {name}" |
| 568 | ) |
| 569 | path = str(NodePath(parent.path) / name) |
| 570 | node_ds = self.to_dataset(inherit=False) |
| 571 | parent_ds = parent._to_dataset_view(rebuild_dims=False, inherit=True) |
| 572 | check_alignment(path, node_ds, parent_ds, self.children) |
| 573 | _deduplicate_inherited_coordinates(self, parent) |
| 574 | |
| 575 | @property |
| 576 | def _node_coord_variables_with_index(self) -> Mapping[Hashable, Variable]: |
nothing calls this directly
no test coverage detected