Beispiel #1
0
def test_fuse_selections():
    def load(*args):
        pass

    dsk = {'x': (load, 'store', 'part', ['a', 'b']), 'y': (getitem, 'x', 'a')}
    merge = lambda t1, t2: (load, t2[1], t2[2], t1[2])
    dsk2 = fuse_selections(dsk, getitem, load, merge)
    dsk2 = cull(dsk2, 'y')
    assert dsk2 == {'y': (load, 'store', 'part', 'a')}
Beispiel #2
0
def test_fuse_selections():
    def load(*args):
        pass
    dsk = {'x': (load, 'store', 'part', ['a', 'b']),
           'y': (getitem, 'x', 'a')}
    merge = lambda t1, t2: (load, t2[1], t2[2], t1[2])
    dsk2 = fuse_selections(dsk, getitem, load, merge)
    dsk2 = cull(dsk2, 'y')
    assert dsk2 == {'y': (load, 'store', 'part', 'a')}