Skip to content

Commit 711bc4a

Browse files
committed
format
1 parent 164ace7 commit 711bc4a

11 files changed

Lines changed: 46 additions & 36 deletions

share/lib/python/neuron/rxd/geometry.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ def _volumes1d(sec: Union[nrn.Section, "rxdsection.RxDSection"]) -> numpy.ndarra
6262
diam0, diam1 = diams[i : i + 2]
6363
pt0, pt1 = pts[i : i + 2]
6464
volume += (
65-
numpy.pi
66-
* (pt1 - pt0)
67-
/ 12.0
68-
* (diam0**2 + diam0 * diam1 + diam1**2)
65+
numpy.pi * (pt1 - pt0) / 12.0 * (diam0**2 + diam0 * diam1 + diam1**2)
6966
)
7067
vols[iseg] = volume
7168

share/lib/python/neuron/rxd/multiCompartmentReaction.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,7 @@ def _update_rates(self):
204204
msg = (
205205
"sources and destinations"
206206
if sources and dests
207-
else "sources"
208-
if sources
209-
else "destinations"
207+
else "sources" if sources else "destinations"
210208
)
211209
raise RxDException(
212210
"Multicompartment reactions the membrane and %s must share common sections. %r"

share/lib/python/neuron/rxdtests/tests/hybrid/bistable_hybrid.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
ca = rxd.Species(
2929
r,
3030
d=diff_constant,
31-
initial=lambda node: 1
32-
if (0.8 < node.x and node.segment in dend1)
33-
or (node.x < 0.2 and node.segment in dend2)
34-
else 0,
31+
initial=lambda node: (
32+
1
33+
if (0.8 < node.x and node.segment in dend1)
34+
or (node.x < 0.2 and node.segment in dend2)
35+
else 0
36+
),
3537
)
3638
bistable_reaction = rxd.Rate(ca, -ca * (1 - ca) * (0.01 - ca))
3739
h.finitialize()

share/lib/python/neuron/rxdtests/tests/hybrid/bistable_hybrid_change_nthread.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
ca = rxd.Species(
2929
r,
3030
d=diff_constant,
31-
initial=lambda node: 1
32-
if (0.8 < node.x and node.segment in dend1)
33-
or (node.x < 0.2 and node.segment in dend2)
34-
else 0,
31+
initial=lambda node: (
32+
1
33+
if (0.8 < node.x and node.segment in dend1)
34+
or (node.x < 0.2 and node.segment in dend2)
35+
else 0
36+
),
3537
)
3638
bistable_reaction = rxd.Rate(ca, -ca * (1 - ca) * (0.01 - ca))
3739
h.finitialize()

share/lib/python/neuron/rxdtests/tests/hybrid/bistable_hybrid_cvode.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
r,
2929
d=diff_constant,
3030
atolscale=0.1,
31-
initial=lambda node: 1
32-
if (0.8 < node.x and node.segment in dend1)
33-
or (node.x < 0.2 and node.segment in dend2)
34-
else 0,
31+
initial=lambda node: (
32+
1
33+
if (0.8 < node.x and node.segment in dend1)
34+
or (node.x < 0.2 and node.segment in dend2)
35+
else 0
36+
),
3537
)
3638
bistable_reaction = rxd.Rate(ca, -ca * (1 - ca) * (0.01 - ca))
3739
h.finitialize()

share/lib/python/neuron/rxdtests/tests/hybrid/bistable_hybrid_cvode_change_nthread.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
r,
2929
d=diff_constant,
3030
atolscale=0.1,
31-
initial=lambda node: 1
32-
if (0.8 < node.x and node.segment in dend1)
33-
or (node.x < 0.2 and node.segment in dend2)
34-
else 0,
31+
initial=lambda node: (
32+
1
33+
if (0.8 < node.x and node.segment in dend1)
34+
or (node.x < 0.2 and node.segment in dend2)
35+
else 0
36+
),
3537
)
3638
bistable_reaction = rxd.Rate(ca, -ca * (1 - ca) * (0.01 - ca))
3739
h.finitialize()

share/lib/python/neuron/rxdtests/tests/hybrid/pure_diffusion_hybrid.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434
ca = rxd.Species(
3535
r,
3636
d=diff_constant,
37-
initial=lambda node: 1
38-
if (0.8 < node.x and node.segment in dend1)
39-
or (node.x < 0.2 and node.segment in dend2)
40-
else 0,
37+
initial=lambda node: (
38+
1
39+
if (0.8 < node.x and node.segment in dend1)
40+
or (node.x < 0.2 and node.segment in dend2)
41+
else 0
42+
),
4143
)
4244
h.finitialize()
4345
initial_amount = (

share/lib/python/neuron/rxdtests/tests/hybrid/pure_diffusion_hybrid_cvode.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434
ca = rxd.Species(
3535
r,
3636
d=diff_constant,
37-
initial=lambda node: 1
38-
if (0.8 < node.x and node.segment in dend1)
39-
or (node.x < 0.2 and node.segment in dend2)
40-
else 0,
37+
initial=lambda node: (
38+
1
39+
if (0.8 < node.x and node.segment in dend1)
40+
or (node.x < 0.2 and node.segment in dend2)
41+
else 0
42+
),
4143
)
4244
h.finitialize()
4345
initial_amount = (

share/lib/python/neuron/tests/test_all.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
$Id$
55
"""
66

7-
87
# import your specific test here
98
# and add it to the "suite" function below
109
from neuron.tests import test_vector, test_neuron

share/lib/python/neuron/tests/test_rxd.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,13 @@ def trivial_ecs(scale, lock, path=None):
9898
d=2.62,
9999
charge=1,
100100
atolscale=scale,
101-
initial=lambda nd: 1.0
102-
if abs(nd.x3d) <= L / 2.0 and abs(nd.y3d) <= L / 2.0 and abs(nd.z3d) <= L / 2.0
103-
else 0.0,
101+
initial=lambda nd: (
102+
1.0
103+
if abs(nd.x3d) <= L / 2.0
104+
and abs(nd.y3d) <= L / 2.0
105+
and abs(nd.z3d) <= L / 2.0
106+
else 0.0
107+
),
104108
)
105109

106110
# record the concentration at (0,0,0)

0 commit comments

Comments
 (0)