MCPcopy Create free account
hub / github.com/pydata/xarray / test_load_datatree

Method test_load_datatree

xarray/tests/test_backends.py:6527–6535  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6525 da.to_netcdf(tmp)
6526
6527 def test_load_datatree(self) -> None:
6528 with create_tmp_file() as tmp:
6529 original = DataTree(Dataset({"foo": ("x", np.random.randn(10))}))
6530 original.to_netcdf(tmp)
6531 dt = load_datatree(tmp)
6532 xr.testing.assert_identical(original, dt)
6533 # this would fail if we used open_datatree instead of
6534 # load_datatree
6535 dt.to_netcdf(tmp)
6536
6537 @pytest.mark.skipif(
6538 ON_WINDOWS,

Callers

nothing calls this directly

Calls 6

to_netcdfMethod · 0.95
DataTreeClass · 0.90
DatasetClass · 0.90
load_datatreeFunction · 0.90
create_tmp_fileFunction · 0.85
to_netcdfMethod · 0.45

Tested by

no test coverage detected