MCPcopy
hub / github.com/dask/dask / test_array_bag_delayed

Function test_array_bag_delayed

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

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…