Skip to content

Commit d87e324

Browse files
authored
added a test
1 parent 24070a2 commit d87e324

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

test/rxd/test_state_reaction.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
import numpy as np
23
from .testutils import compare_data, tol
34

45

@@ -37,3 +38,17 @@ def test_state_reaction2(neuron_instance):
3738
h.finitialize(-65)
3839
h.continuerun(1)
3940
assert sec(0.5).ca2i == sec(0.5).cai
41+
42+
43+
def test_numpy_rate(neuron_instance):
44+
"""Test a simple rxd.Rate involving a numpy value"""
45+
n, rxd, data, save_path = neuron_instance
46+
soma = n.Section("soma")
47+
soma.L = soma.diam = 10
48+
cyt = rxd.Region([soma], name="cyt", nrn_region="i")
49+
c = rxd.Species(cyt, name="c", charge=1, initial=0)
50+
r = rxd.Rate(c, np.float64(1))
51+
n.dt = 0.025
52+
n.finitialize(-65)
53+
n.fadvance()
54+
assert(c.nodes[0].concentration == 0.025)

0 commit comments

Comments
 (0)