Beispiel #1
0
async def test_dont_optimize_out(c, s, a, b):
    da = pytest.importorskip("dask.array")
    x = da.arange(10, chunks=(5, ))
    y = x.map_blocks(lambda x: x + 1)
    z = y.map_blocks(lambda x: 2 * x)
    w = z.sum()

    await c.compute(w, resources={tuple(y.__dask_keys__()): {"A": 1}})

    for key in map(tokey, y.__dask_keys__()):
        assert "executing" in str(a.story(key))
Beispiel #2
0
def test_dont_optimize_out(c, s, a, b):
    da = pytest.importorskip('dask.array')
    x = da.arange(10, chunks=(5,))
    y = x.map_blocks(lambda x: x + 1)
    z = y.map_blocks(lambda x: 2 * x)
    w = z.sum()

    yield c.compute(w, resources={tuple(y.__dask_keys__()): {'A': 1}},)

    for key in map(tokey, y.__dask_keys__()):
        assert 'executing' in str(a.story(key))
Beispiel #3
0
def test_dont_optimize_out(c, s, a, b):
    da = pytest.importorskip('dask.array')
    x = da.arange(10, chunks=(5,))
    y = x.map_blocks(lambda x: x + 1)
    z = y.map_blocks(lambda x: 2 * x)
    w = z.sum()

    yield c.compute(w, resources={tuple(y.__dask_keys__()): {'A': 1}},)

    for key in map(tokey, y.__dask_keys__()):
        assert 'executing' in str(a.story(key))