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

Function test_array_bag_delayed

dask/tests/test_delayed.py:628–639  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

626
627
628def test_array_bag_delayed():
629 np = pytest.importorskip("numpy")
630 da = pytest.importorskip("dask.array")
631
632 arr1 = np.arange(100).reshape((10, 10))
633 arr2 = arr1.dot(arr1.T)
634 darr1 = da.from_array(arr1, chunks=(5, 5))
635 darr2 = da.from_array(arr2, chunks=(5, 5))
636 b = db.from_sequence([1, 2, 3])
637 seq = [arr1, arr2, darr1, darr2, b]
638 out = delayed(sum)([i.sum() for i in seq])
639 assert out.compute() == 2 * arr1.sum() + 2 * arr2.sum() + sum([1, 2, 3])
640
641
642def test_delayed_picklable():

Callers

nothing calls this directly

Calls 7

delayedFunction · 0.90
reshapeMethod · 0.80
sumFunction · 0.70
arangeMethod · 0.45
dotMethod · 0.45
sumMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected