def test_section_meander_angles(): s0 = load_neuron(StringIO(u"""((CellBody) (0 0 0 0)) ((Dendrite) (0 0 0 2) (1 0 0 2) (2 0 0 2) (3 0 0 2) (4 0 0 2))"""), reader='asc').sections[SECTION_ID] nt.assert_equal(_sf.section_meander_angles(s0), [math.pi, math.pi, math.pi]) s1 = load_neuron(StringIO(u"""((CellBody) (0 0 0 0)) ((Dendrite) (0 0 0 2) (1 0 0 2) (1 1 0 2) (2 1 0 2) (2 2 0 2))"""), reader='asc').sections[SECTION_ID] nt.assert_equal(_sf.section_meander_angles(s1), [math.pi / 2, math.pi / 2, math.pi / 2]) s2 = load_neuron(StringIO(u"""((CellBody) (0 0 0 0)) ((Dendrite) (0 0 0 2) (0 0 1 2) (0 0 2 2) (0 0 0 2))"""), reader='asc').sections[SECTION_ID] nt.assert_equal(_sf.section_meander_angles(s2), [math.pi, 0.])
def test_section_meander_angles_single_segment(): s = load_neuron(StringIO(u"""((CellBody) (0 0 0 0)) ((Dendrite) (0 0 0 2) (1 1 1 2))"""), reader='asc').sections[1] nt.assert_equal(len(_sf.section_meander_angles(s)), 0)
def test_section_meander_angles_single_segment(): s = load_neuron(StringIO(u"""((CellBody) (0 0 0 0)) ((Dendrite) (0 0 0 2) (1 1 1 2))"""), reader='asc').sections[SECTION_ID] assert len(_sf.section_meander_angles(s)) == 0