Skip to content

Commit

Permalink
fix make_prediction_dataframe_from_output
Browse files Browse the repository at this point in the history
And add simple unit test with committed test data
  • Loading branch information
SamuelBrand1 committed Dec 9, 2024
1 parent e1744e1 commit 7e6238b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions pipeline/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 20 additions & 0 deletions pipeline/test/analysis/make_prediction_dataframe_from_output.jl
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions pipeline/test/analysis/test_analysis.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include("make_prediction_dataframe_from_output.jl")
Binary file added pipeline/test/analysis/test_data.jld2
Binary file not shown.

0 comments on commit 7e6238b

Please sign in to comment.