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

Method test_set_data

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

Source from the content-addressed store, hash-verified

202 DataTree(name="mary", dataset="junk") # type: ignore[arg-type]
203
204 def test_set_data(self) -> None:
205 john = DataTree(name="john")
206 dat = xr.Dataset({"a": 0})
207 john.dataset = dat # type: ignore[assignment,unused-ignore]
208
209 assert_identical(john.to_dataset(), dat)
210
211 with pytest.raises(TypeError):
212 john.dataset = "junk" # type: ignore[assignment]
213
214 def test_has_data(self) -> None:
215 john = DataTree(name="john", dataset=xr.Dataset({"a": 0}))

Callers

nothing calls this directly

Calls 3

to_datasetMethod · 0.95
DataTreeClass · 0.90
assert_identicalFunction · 0.90

Tested by

no test coverage detected