File: test_node_selection.py

package info (click to toggle)
neuron 8.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,760 kB
  • sloc: cpp: 149,571; python: 58,465; ansic: 50,329; sh: 3,510; xml: 213; pascal: 51; makefile: 35; sed: 5
file content (19 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def test_node_selection(neuron_instance):
    """Test selection of 3D nodes"""

    h, rxd, data, save_path = neuron_instance

    rxd.set_solve_type(dimension=3)
    dend = h.Section(name="dend")
    dend.L = 10
    dend.diam = 2

    cyt = rxd.Region([dend])
    c = rxd.Species(cyt)

    nodes = c.nodes

    assert nodes((5.2, 0.1, 0.3))[0].x3d == 5.125
    assert nodes((5.2, 0.1, 0.3))[0].y3d == 0.125
    assert nodes((5.2, 0.1, 0.3))[0].z3d == 0.375
    assert len(nodes((5, 0, 0))) == 1