Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 90fcf1b

Browse files
committed
Improve function calling coverage.
1 parent eac9050 commit 90fcf1b

File tree

3 files changed

+50
-8
lines changed

3 files changed

+50
-8
lines changed

test/usecases/function/non_threadsafe.mod

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ ASSIGNED {
1010
x
1111
}
1212

13-
STATE {
14-
z
15-
}
16-
17-
LINEAR lin {
18-
~ z = 2
19-
}
20-
2113
FUNCTION x_plus_a(a) {
2214
x_plus_a = x + a
2315
}
@@ -34,3 +26,13 @@ INITIAL {
3426
x = 1.0
3527
gbl = 42.0
3628
}
29+
30+
: A LINEAR block makes a MOD file not VECTORIZED.
31+
STATE {
32+
z
33+
}
34+
35+
LINEAR lin {
36+
~ z = 2
37+
}
38+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
NEURON {
2+
POINT_PROCESS point_non_threadsafe
3+
RANGE x
4+
GLOBAL gbl
5+
}
6+
7+
ASSIGNED {
8+
gbl
9+
v
10+
x
11+
}
12+
13+
FUNCTION x_plus_a(a) {
14+
x_plus_a = x + a
15+
}
16+
17+
FUNCTION v_plus_a(a) {
18+
v_plus_a = v + a
19+
}
20+
21+
FUNCTION identity(v) {
22+
identity = v
23+
}
24+
25+
INITIAL {
26+
x = 1.0
27+
gbl = 42.0
28+
}
29+
30+
: A LINEAR block makes a MOD file not VECTORIZED.
31+
STATE {
32+
z
33+
}
34+
35+
LINEAR lin {
36+
~ z = 2
37+
}
38+

test/usecases/function/test_functions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def check_callable(get_instance):
3636
values = [0.1 + k for k in range(nseg)]
3737

3838
point_processes = {x: h.point_functions(s(x)) for x in coords}
39+
point_non_threadsafe = {x: h.point_non_threadsafe(s(x)) for x in coords}
3940

4041
check_callable(lambda x: s(x).functions)
4142
check_callable(lambda x: s(x).non_threadsafe)
4243
check_callable(lambda x: point_processes[x])
44+
check_callable(lambda x: point_non_threadsafe[x])

0 commit comments

Comments
 (0)