Skip to content

Commit

Permalink
rm old unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBrand1 committed Nov 4, 2024
1 parent 58ac869 commit 2e368d9
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions EpiAware/test/EpiInfModels/ODEProcess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,3 @@
@test eltype(params_mixed.u0) == Float64
@test eltype(params_mixed.p) == Float64
end

@testitem "ODEProcess + generate_latent_infs Tests" begin
using OrdinaryDiffEq

function simple_ode!(du, u, p, t)
du[1] = p[1] * u[1]
end

u0 = [1.0]
p = [-0.5]
params = ODEParams(u0 = u0, p = p)
tspan = (0.0, 10.0)
prob = ODEProblem(simple_ode!, u0, tspan, p)

# Define a simple solver and function for testing
solver = Tsit5()
sol2infs = sol -> sol[1, :]

# Create an instance of ODEProcess for testing
infectionmodel = ODEProcess(; prob, ts = [0.0, 1.0, 2.0], solver, sol2infs)

@testset "ODEProcess constructor" begin
@test infectionmodel isa ODEProcess
@test infectionmodel.prob == prob
@test infectionmodel.ts == [0.0, 1.0, 2.0]
@test infectionmodel.solver == solver
@test infectionmodel.sol2infs == sol2infs
end

@testset "infection generation accuracy" begin
actual_infs = map(t -> exp(params.p[1] * t), infectionmodel.ts)
generated_infs = generate_latent_infs(infectionmodel, params)()
@test generated_infsactual_infs atol=1e-6
end
end

0 comments on commit 2e368d9

Please sign in to comment.