()
| 854 | |
| 855 | |
| 856 | def test_optimize_None(): |
| 857 | pytest.importorskip("numpy") |
| 858 | da = pytest.importorskip("dask.array") |
| 859 | |
| 860 | x = da.ones(10, chunks=(5,)) |
| 861 | y = x[:9][1:8][::2] + 1 # normally these slices would be fused |
| 862 | |
| 863 | def my_get(dsk, keys): |
| 864 | # but they aren't. +1 for the finalize task |
| 865 | assert len(dsk.__dask_graph__()) == len(y.dask) + 1 |
| 866 | return dask.get(dsk, keys) |
| 867 | |
| 868 | with dask.config.set(array_optimize=None, scheduler=my_get): |
| 869 | y.compute() |
| 870 | |
| 871 | |
| 872 | def test_scheduler_keyword(): |