MCPcopy
hub / github.com/pydata/xarray / test_deepcopy_recursive

Function test_deepcopy_recursive

xarray/tests/test_dataset.py:8245–8264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8243
8244
8245def test_deepcopy_recursive() -> None:
8246 # GH:issue:7111
8247
8248 # direct recursion
8249 ds = xr.Dataset({"a": (["x"], [1, 2])})
8250 ds.attrs["other"] = ds
8251
8252 # TODO: cannot use assert_identical on recursive Vars yet...
8253 # lets just ensure that deep copy works without RecursionError
8254 ds.copy(deep=True)
8255
8256 # indirect recursion
8257 ds2 = xr.Dataset({"b": (["y"], [3, 4])})
8258 ds.attrs["other"] = ds2
8259 ds2.attrs["other"] = ds
8260
8261 # TODO: cannot use assert_identical on recursive Vars yet...
8262 # lets just ensure that deep copy works without RecursionError
8263 ds.copy(deep=True)
8264 ds2.copy(deep=True)
8265
8266
8267def test_clip(ds) -> None:

Callers

nothing calls this directly

Calls 1

copyMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…