Skip to content

Commit

Permalink
Add test for NET_RECEIVE{ INITIAL { ... }}.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Sep 18, 2024
1 parent 15bb0df commit 9c5cd15
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/usecases/net_receive/initsyn.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
NEURON {
POINT_PROCESS InitSyn
RANGE a0
}

ASSIGNED {
a0
}

NET_RECEIVE(w, a) {
INITIAL {
a = a0
}
}
27 changes: 27 additions & 0 deletions test/usecases/net_receive/test_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import numpy as np

from neuron import h, gui
from neuron.units import ms


def test_net_receive_initial():
nseg = 1

soma = h.Section()
soma.nseg = nseg

syn = h.InitSyn(soma(0.5))
syn.a0 = 329.012

stim = h.NetStim()
nc = h.NetCon(stim, syn, 0, 0.0, 0.1)

h.stdinit()

assert nc.wcnt() == 2
assert nc.weight[0] == 0.1
assert nc.weight[1] == syn.a0


if __name__ == "__main__":
test_net_receive_initial()

0 comments on commit 9c5cd15

Please sign in to comment.