def test_itriplet(): ref = [[0, 11, 111], [0, 11, 112], [11, 111, 1111], [111, 1111, 11111], [111, 1111, 11112], [111, 1111, 11113], [0, 12, 121], [0, 12, 122], [12, 121, 1211], [121, 1211, 12111], [121, 1211, 12112]] nt.assert_equal(list([n.value for n in t] for t in itriplet(REF_TREE2)), ref)
def i_segment_meander_angle(tree): '''Return an iterator to a tree meander angle The meander angle is defined as the angle between to adjacent segments. Applies neurom.morphmath.angle_3points to triplets of ''' return tr.imap_val(lambda t: mm.angle_3points(t[1], t[0], t[2]), tr.itriplet(tree))