Skip to content

Commit

Permalink
add average voltage test for composite blox
Browse files Browse the repository at this point in the history
  • Loading branch information
harisorgn committed Aug 28, 2024
1 parent 45a33bf commit bda227c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using DifferentialEquations
@test all(sol[ss.n.V] .== Neuroblox.voltage_timeseries(sol, n))
end

@testset "Voltage timeseries [LIFExciCircuitBloxz]" begin
@testset "Voltage timeseries + Composite average [LIFExciCircuitBloxz]" begin
global_ns = :g
tspan = (0, 200)
V_reset = -55
Expand All @@ -40,4 +40,11 @@ end
V[V .== V_reset] .= NaN

@test all(isequal(V, Neuroblox.voltage_timeseries(sol, n)))
end

V_filtered = map(eachrow(V)) do V_t
v = filter(!isnan, V_t)
mean(v)
end

@test all(isequal(V_filtered, Neuroblox.average_voltage_timeseries(sol, n)))
end

0 comments on commit bda227c

Please sign in to comment.