Exemple #1
0
def test_branch_order():

    branch_order_map = {
        (0, 11): 1,
        (11, 111, 1111): 2,
        (1111, 11111): 3,
        (1111, 11112): 3,
        (1111, 11113): 3,
        (11, 112): 2,
        (0, 12): 1,
        (12, 121, 1211): 2,
        (1211, 12111): 3,
        (1211, 12112): 3,
        (12, 122): 2
    }
    for sec in ptr.isection(MOCK_TREE):
        nt.assert_equal(mtr.branch_order(sec),
                        branch_order_map[tuple(p for p in ptr.val_iter(sec))])
Exemple #2
0
def test_point_at_path_fraction():
    section = isection(SIMPLE_TREE).next()
    res = sec.point_at_path_fraction(section, 0.5)
    nt.eq_(tuple(res), (0., 4., 0.))