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

Method test_data_arg

xarray/tests/test_datatree.py:64–70  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

62 DataTree(name="folder/data")
63
64 def test_data_arg(self) -> None:
65 ds = xr.Dataset({"foo": 42})
66 tree: DataTree = DataTree(dataset=ds)
67 assert_identical(tree.to_dataset(), ds)
68
69 with pytest.raises(TypeError):
70 DataTree(dataset=xr.DataArray(42, name="foo")) # type: ignore[arg-type]
71
72 def test_child_data_not_copied(self) -> None:
73 # regression test for https://github.com/pydata/xarray/issues/9683

Callers

nothing calls this directly

Calls 3

to_datasetMethod · 0.95
DataTreeClass · 0.90
assert_identicalFunction · 0.90

Tested by

no test coverage detected