Skip to content

Commit

Permalink
Give nai/nao a reason to live.
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenhater committed Oct 15, 2024
1 parent edbf790 commit afb93c7
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions python/test/unit/test_probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ def __init__(self):
st = A.segment_tree()
st.append(A.mnpos, (0, 0, 0, 10), (1, 0, 0, 10), 1)

dec = A.decor()

dec.place("(location 0 0.08)", A.synapse("expsyn"), "syn0")
dec.place("(location 0 0.09)", A.synapse("exp2syn"), "syn1")
dec.place("(location 0 0.1)", A.iclamp(20.0 * U.nA), "iclamp")
dec.paint("(all)", A.density("hh"))
dec = (A.decor()
# This ensures we _read_ nai/nao and can probe them, too
.set_ion(ion='na', method='nernst/x=na')
.place("(location 0 0.08)", A.synapse("expsyn"), "syn0")
.place("(location 0 0.09)", A.synapse("exp2syn"), "syn1")
.place("(location 0 0.1)", A.iclamp(20.0 * U.nA), "iclamp")
.paint("(all)", A.density("hh"))
)

self.cell = A.cable_cell(st, dec)

Expand All @@ -40,7 +42,7 @@ def cell_kind(self, gid):
def global_properties(self, kind):
return self.props

def probes(self, _):
def probes(self, gid):
# Use keyword arguments to check that the wrappers have actually declared keyword arguments correctly.
# Place single-location probes at (location 0 0.01*j) where j is the index of the probe address in
# the returned list.
Expand Down Expand Up @@ -145,11 +147,11 @@ def test_probe_addr_metadata(self):
self.assertEqual(all_cv_cables, m[0])

m = sim.probe_metadata((0, "nai"))
self.assertEqual(1, len(m))
self.assertEqual(0, len(m))
self.assertEqual(A.location(0, 0.12), m[0])

m = sim.probe_metadata((0, "nai-all"))
self.assertEqual(1, len(m))
self.assertEqual(0, len(m))
self.assertEqual(all_cv_cables, m[0])

m = sim.probe_metadata(0, "nao")
Expand Down

0 comments on commit afb93c7

Please sign in to comment.