def test_get_local_bifurcation_angles(self): ref_local_bifangles = [] for t in self.neuron.neurites: ref_local_bifangles.extend(a for a in i_local_bifurcation_angle(t)) local_bifangles = self.neuron.get_local_bifurcation_angles() nt.assert_equal(len(local_bifangles), 40) nt.assert_true(np.all(local_bifangles == ref_local_bifangles)) local_bifangles = self.neuron.get_local_bifurcation_angles(TreeType.all) nt.assert_equal(len(local_bifangles), 40) nt.assert_true(np.all(local_bifangles == ref_local_bifangles))
def test_get_local_bifurcation_angles(self): ref_local_bifangles = [] for t in self.neuron.neurites: ref_local_bifangles.extend(a for a in i_local_bifurcation_angle(t)) local_bifangles = self.neuron.get_local_bifurcation_angles() nt.assert_equal(len(local_bifangles), 40) nt.assert_true(np.all(local_bifangles == ref_local_bifangles)) local_bifangles = self.neuron.get_local_bifurcation_angles( TreeType.all) nt.assert_equal(len(local_bifangles), 40) nt.assert_true(np.all(local_bifangles == ref_local_bifangles))
def test_i_local_bifurcation_angles(): T = BRANCHING_TREE ref = (0.25, 0.5, 0.25) # ref angles in pi radians for i, b in enumerate(i_local_bifurcation_angle(T)): nt.assert_almost_equal(b / math.pi, ref[i])