(child: DataTree, parent: DataTree)
| 194 | |
| 195 | |
| 196 | def _deduplicate_inherited_coordinates(child: DataTree, parent: DataTree) -> None: |
| 197 | # This method removes repeated indexes (and corresponding coordinates) |
| 198 | # that are repeated between a DataTree and its parents. |
| 199 | removed_something = False |
| 200 | for name in parent._indexes: |
| 201 | if name in child._node_indexes: |
| 202 | # Indexes on a Dataset always have a corresponding coordinate. |
| 203 | # We already verified that these coordinates match in the |
| 204 | # check_alignment() call from _pre_attach(). |
| 205 | del child._node_indexes[name] |
| 206 | del child._node_coord_variables[name] |
| 207 | removed_something = True |
| 208 | |
| 209 | if removed_something: |
| 210 | child._node_dims = calculate_dimensions( |
| 211 | child._data_variables | child._node_coord_variables |
| 212 | ) |
| 213 | |
| 214 | for grandchild in child._children.values(): |
| 215 | _deduplicate_inherited_coordinates(grandchild, child) |
| 216 | |
| 217 | |
| 218 | def _check_for_slashes_in_names(variables: Iterable[Hashable]) -> None: |
no test coverage detected
searching dependent graphs…