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

Method _detach

xarray/core/treenode.py:129–139  ·  view source on GitHub ↗
(self, parent: Self | None)

Source from the content-addressed store, hash-verified

127 return any(n is self for n in node.parents)
128
129 def _detach(self, parent: Self | None) -> None:
130 if parent is not None:
131 self._pre_detach(parent)
132 parents_children = parent.children
133 parent._children = {
134 name: child
135 for name, child in parents_children.items()
136 if child is not self
137 }
138 self._parent = None
139 self._post_detach(parent)
140
141 def _attach(self, parent: Self | None, child_name: str | None = None) -> None:
142 if parent is not None:

Callers 1

_set_parentMethod · 0.95

Calls 3

_pre_detachMethod · 0.95
_post_detachMethod · 0.95
itemsMethod · 0.80

Tested by

no test coverage detected