Esempio n. 1
0
def test__futures_to_dask_arrays(c, s, a, b):
    import dask.array as da

    fs = c.map(np.ones, [(5, i) for i in range(1, 6)], pure=False)
    arrs = yield _futures_to_dask_arrays(fs)
    assert len(fs) == len(arrs) == 5

    assert all(a.shape == (5, i + 1) for i, a in enumerate(arrs))
    assert all(a.dtype == np.ones(1).dtype for a in arrs)
    assert all(isinstance(a, da.Array) for a in arrs)

    xs = yield c._gather(c.compute(arrs))
    assert all((x == 1).all() for x in xs)
def test__futures_to_dask_arrays(e, s, a, b):
    import dask.array as da

    fs = e.map(np.ones, [(5, i) for i in range(1, 6)], pure=False)
    arrs = yield _futures_to_dask_arrays(fs)
    assert len(fs) == len(arrs) == 5

    assert all(a.shape == (5, i + 1) for i, a in enumerate(arrs))
    assert all(a.dtype == np.ones(1).dtype for a in arrs)
    assert all(isinstance(a, da.Array) for a in arrs)

    xs = yield e._gather(e.compute(arrs))
    assert all((x == 1).all() for x in xs)