Skip to content

Commit

Permalink
Change API of some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldeistler committed Nov 9, 2023
1 parent 6e0976b commit a23c586
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
16 changes: 4 additions & 12 deletions tests/neurax_identical/test_basic_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
def test_compartment():
dt = 0.025 # ms
t_max = 5.0 # ms

time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.02, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

comp = nx.Compartment().initialize()
comp.insert(HHChannel())
Expand Down Expand Up @@ -55,9 +53,7 @@ def test_branch():
nseg_per_branch = 2
dt = 0.025 # ms
t_max = 5.0 # ms

time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.02, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

comp = nx.Compartment().initialize()
branch = nx.Branch([comp for _ in range(nseg_per_branch)]).initialize()
Expand Down Expand Up @@ -93,9 +89,7 @@ def test_cell():
nseg_per_branch = 2
dt = 0.025 # ms
t_max = 5.0 # ms

time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.02, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

depth = 2
parents = [-1] + [b // 2 for b in range(0, 2**depth - 2)]
Expand Down Expand Up @@ -135,9 +129,7 @@ def test_net():
nseg_per_branch = 2
dt = 0.025 # ms
t_max = 5.0 # ms

time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.02, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

depth = 2
parents = [-1] + [b // 2 for b in range(0, 2**depth - 2)]
Expand Down
16 changes: 4 additions & 12 deletions tests/neurax_identical/test_radius_and_length.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
def test_radius_and_length_compartment():
dt = 0.025 # ms
t_max = 5.0 # ms

time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.02, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

comp = nx.Compartment().initialize()

Expand Down Expand Up @@ -60,9 +58,7 @@ def test_radius_and_length_branch():
nseg_per_branch = 2
dt = 0.025 # ms
t_max = 5.0 # ms

time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.02, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

comp = nx.Compartment().initialize()
branch = nx.Branch([comp for _ in range(nseg_per_branch)]).initialize()
Expand Down Expand Up @@ -103,9 +99,7 @@ def test_radius_and_length_cell():
nseg_per_branch = 2
dt = 0.025 # ms
t_max = 5.0 # ms

time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.02, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

depth = 2
parents = [-1] + [b // 2 for b in range(0, 2**depth - 2)]
Expand Down Expand Up @@ -151,9 +145,7 @@ def test_radius_and_length_net():
nseg_per_branch = 2
dt = 0.025 # ms
t_max = 5.0 # ms

time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.02, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

depth = 2
parents = [-1] + [b // 2 for b in range(0, 2**depth - 2)]
Expand Down
6 changes: 2 additions & 4 deletions tests/neurax_identical/test_swc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
def test_swc_cell():
dt = 0.025 # ms
t_max = 5.0 # ms
time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.2, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

cell = nx.read_swc("../morph.swc", nseg=2, max_branch_len=300.0)
cell.insert(HHChannel())
Expand Down Expand Up @@ -53,8 +52,7 @@ def test_swc_cell():
def test_swc_net():
dt = 0.025 # ms
t_max = 5.0 # ms
time_vec = jnp.arange(0.0, t_max + dt, dt)
current = nx.step_current(0.5, 1.0, 0.2, time_vec)
current = nx.step_current(0.5, 1.0, 0.02, dt, t_max)

cell1 = nx.read_swc("../morph.swc", nseg=2, max_branch_len=300.0)
cell2 = nx.read_swc("../morph.swc", nseg=2, max_branch_len=300.0)
Expand Down

0 comments on commit a23c586

Please sign in to comment.