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

Method _copy_node

xarray/core/datatree.py:947–956  ·  view source on GitHub ↗

Copy just one node of a tree.

(
        self, inherit: bool, deep: bool = False, memo: dict[int, Any] | None = None
    )

Source from the content-addressed store, hash-verified

945 self.children = children
946
947 def _copy_node(
948 self, inherit: bool, deep: bool = False, memo: dict[int, Any] | None = None
949 ) -> Self:
950 """Copy just one node of a tree."""
951 new_node = super()._copy_node(inherit=inherit, deep=deep, memo=memo)
952 data = self._to_dataset_view(rebuild_dims=False, inherit=inherit)._copy(
953 deep=deep, memo=memo
954 )
955 new_node._set_node_data(data)
956 return new_node
957
958 def get( # type: ignore[override]
959 self: DataTree, key: str, default: DataTree | DataArray | None = None

Callers

nothing calls this directly

Calls 3

_to_dataset_viewMethod · 0.95
_set_node_dataMethod · 0.80
_copyMethod · 0.45

Tested by

no test coverage detected