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

Function test_constructor_plugin

dask/array/tests/test_array_core.py:4802–4816  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4800
4801
4802def test_constructor_plugin():
4803 L = []
4804 L2 = []
4805 with dask.config.set(array_plugins=[L.append, L2.append]):
4806 x = da.ones(10, chunks=5)
4807 y = x + 1
4808
4809 assert L == L2 == [x, y]
4810
4811 with dask.config.set(array_plugins=[lambda x: x.compute()]):
4812 x = da.ones(10, chunks=5)
4813 y = x + 1
4814
4815 assert isinstance(y, np.ndarray)
4816 assert len(L) == 2
4817
4818
4819def test_no_warnings_on_metadata():

Callers

nothing calls this directly

Calls 3

setMethod · 0.80
onesMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected