Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBrand1 committed Oct 6, 2024
1 parent d733d90 commit af8c394
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 12 additions & 0 deletions pipeline/test/pipeline/test_pipelinefunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ end
fetch(res)
@test isnothing(res)
end

@testset "do_pipeline test: prior predictive" begin
using Dagger
pipelines = map([SmoothOutbreakPipeline, MeasuresOutbreakPipeline,
SmoothEndemicPipeline, RoughEndemicPipeline]) do pipetype
pipetype(; ndraws = 10, nchains = 1, testmode = true, priorpredictive = true)
end

res = do_pipeline(pipelines)
fetch(res)
@test isnothing(res)
end
5 changes: 2 additions & 3 deletions pipeline/test/plotting/prior_pred_plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
SmoothEndemicPipeline, RoughEndemicPipeline] |> rand
P = pipetype(; testmode = true, nchains = 1, ndraws = 2000, priorpredictive = true)
inference_config = make_inference_configs(P) |> rand

inference_config["T"] = 21
#Add missing data
missingdata = Dict("y_t" => missing, "I_t" => fill(1.0, 100), "truth_I0" => 1.0,
"truth_gi_mean" => inference_config["gi_mean"])
results = generate_inference_results(missingdata, inference_config, P)

fig = prior_predictive_plot(results["inference_config"], results["inference_results"],
results["epiprob"]; ps = [0.025, 0.1, 0.25])
fig = results["priorpredictive"]

@test fig isa Figure
end

0 comments on commit af8c394

Please sign in to comment.