MCPcopy Create free account
hub / github.com/dask/dask / test_xarray

Function test_xarray

dask/tests/test_sizeof.py:278–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

276
277
278def test_xarray():
279 xr = pytest.importorskip("xarray")
280 np = pytest.importorskip("numpy")
281
282 ind = np.arange(-66, 67, 1).astype(float)
283 arr = np.random.random((len(ind),))
284
285 dataset = (
286 xr.DataArray(
287 arr,
288 dims=["coord"],
289 coords={"coord": ind},
290 )
291 .rename("foo")
292 .to_dataset()
293 )
294 assert sizeof(dataset) > sizeof(arr)
295 assert sizeof(dataset.foo) >= sizeof(arr)
296 assert sizeof(dataset["coord"]) >= sizeof(ind)
297 assert sizeof(dataset.indexes) >= sizeof(ind)
298
299
300@pytest.mark.filterwarnings(

Callers

nothing calls this directly

Calls 4

astypeMethod · 0.45
arangeMethod · 0.45
randomMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected