diff --git a/.gitignore b/.gitignore index 58790f702..17022d4a5 100644 --- a/.gitignore +++ b/.gitignore @@ -393,3 +393,6 @@ EpiAware/docs/src/getting-started/tutorials/censored-obs.md EpiAware/docs/Manifest*.toml !benchmark/Manifest.toml + +# Test data +!pipeline/test/analysis/test_data.jld2 diff --git a/pipeline/test/Project.toml b/pipeline/test/Project.toml index 61209072e..6a4164ae3 100644 --- a/pipeline/test/Project.toml +++ b/pipeline/test/Project.toml @@ -2,9 +2,11 @@ ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001" CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" +DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" DrWatson = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1" EpiAware = "b2eeebe4-5992-4301-9193-7ebc9f62c855" +JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688" MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d" RCall = "6f49c342-dc21-5d91-9882-a32aef131414" diff --git a/pipeline/test/analysis/make_prediction_dataframe_from_output.jl b/pipeline/test/analysis/make_prediction_dataframe_from_output.jl new file mode 100644 index 000000000..a4c015172 --- /dev/null +++ b/pipeline/test/analysis/make_prediction_dataframe_from_output.jl @@ -0,0 +1,20 @@ +@testset "test dataframe construct for one dataset" begin + using JLD2, DataFramesMeta + output = load(joinpath(@__DIR__(), "test_data.jld2")) + true_mean_gi = 10.0 + + df = make_prediction_dataframe_from_output(output, true_mean_gi) + @test !isempty(df) + @test "Scenario" in names(df) + @test "IGP_Model" in names(df) + @test "Latent_Model" in names(df) + @test "True_GI_Mean" in names(df) + @test "Used_GI_Mean" in names(df) + @test "Reference_Time" in names(df) + @test "Target" in names(df) + @test "q_025" in names(df) + @test "q_25" in names(df) + @test "q_5" in names(df) + @test "q_75" in names(df) + @test "q_975" in names(df) +end diff --git a/pipeline/test/analysis/test_analysis.jl b/pipeline/test/analysis/test_analysis.jl new file mode 100644 index 000000000..58076ec5d --- /dev/null +++ b/pipeline/test/analysis/test_analysis.jl @@ -0,0 +1 @@ +include("make_prediction_dataframe_from_output.jl") diff --git a/pipeline/test/analysis/test_data.jld2 b/pipeline/test/analysis/test_data.jld2 new file mode 100644 index 000000000..160b9c3af Binary files /dev/null and b/pipeline/test/analysis/test_data.jld2 differ