def test__grow(): obj = Repair(SIMPLE_PATH, seed=1) leaf = obj.neuron.sections[2] obj.repair_type_map = { section: RepairType.basal for section in obj.neuron.sections } obj.info = { 'sholl': { RepairType.basal: { 0: { 1: { Action.BIFURCATION: 0.5, Action.TERMINATION: 0, Action.CONTINUATION: 0.5 } } } }, 'dendritic_sections': obj.neuron.sections, 'intact_branching_angles': { RepairType.basal: { 1: [0.2] } } } obj._grow(leaf, 0, obj.neuron.soma.center) assert_equal(len(obj.neuron.sections), 8)
def test_best_case_angle_data(): obj = Repair(SIMPLE_PATH) obj.info = { 'intact_branching_angles': { SectionType.axon: { 0: [1, 2, 3], 1: [2, 2], 2: [] } } } # Use exact data for this specific branching angle assert_array_equal(obj._best_case_angle_data(SectionType.axon, 0), [1, 2, 3]) # No info for this branching angle, use aggregate data assert_array_equal(obj._best_case_angle_data(SectionType.axon, 2), [1, 2, 3, 2, 2])