Skip to content

Commit

Permalink
Merge pull request #70 from JuliaGNI/make_tests_quicker
Browse files Browse the repository at this point in the history
Only computing two instances of initial conditions and parameters now.
  • Loading branch information
michakraus authored Jul 8, 2024
2 parents 382b318 + 3fb5f60 commit de55721
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/test_hodeensembles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ function test_multiple_initial_conditions(cho::Module)
# ensemble solution
esol = integrate(epr, ImplicitMidpoint())

sol = integrate(cho.hodeproblem(), ImplicitMidpoint())
@test esol.s[1].q.d.parent sol.q.d.parent
@test esol.s[2].q.d.parent sol.q.d.parent
@test esol.s[2].q.d.parent esol.s[1].q.d.parent
end

function test_multiple_parameters(cho::Module)
params_vec = Vector{NamedTuple}()

for i in 0:1
param_vals = ()

param_vals = ()
for key in keys(cho.default_parameters)
param_vals = (param_vals..., cho.default_parameters[key] .+ 1. * i)
end

params_vec = push!(params_vec, NamedTuple{keys(cho.default_parameters)}(param_vals))
end

Expand All @@ -33,9 +34,7 @@ function test_multiple_parameters(cho::Module)
# ensemble solution
esol = integrate(epr, ImplicitMidpoint())

sol = integrate(cho.hodeproblem(), ImplicitMidpoint())
@test esol.s[1].q.d.parent sol.q.d.parent
@test esol.s[2].q.d.parent sol.q.d.parent
@test esol.s[2].q.d.parent esol.s[1].q.d.parent
end

test_multiple_initial_conditions(cho)
Expand Down

0 comments on commit de55721

Please sign in to comment.