()
| 4800 | |
| 4801 | |
| 4802 | def 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 | |
| 4819 | def test_no_warnings_on_metadata(): |