Skip to content

Commit 7e6238b

Browse files
committed
fix make_prediction_dataframe_from_output
And add simple unit test with committed test data
1 parent e1744e1 commit 7e6238b

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,3 +393,6 @@ EpiAware/docs/src/getting-started/tutorials/censored-obs.md
393393
EpiAware/docs/Manifest*.toml
394394

395395
!benchmark/Manifest.toml
396+
397+
# Test data
398+
!pipeline/test/analysis/test_data.jld2

pipeline/test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
33
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
44
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
5+
DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964"
56
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
67
DrWatson = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1"
78
EpiAware = "b2eeebe4-5992-4301-9193-7ebc9f62c855"
9+
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
810
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
911
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d"
1012
RCall = "6f49c342-dc21-5d91-9882-a32aef131414"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@testset "test dataframe construct for one dataset" begin
2+
using JLD2, DataFramesMeta
3+
output = load(joinpath(@__DIR__(), "test_data.jld2"))
4+
true_mean_gi = 10.0
5+
6+
df = make_prediction_dataframe_from_output(output, true_mean_gi)
7+
@test !isempty(df)
8+
@test "Scenario" in names(df)
9+
@test "IGP_Model" in names(df)
10+
@test "Latent_Model" in names(df)
11+
@test "True_GI_Mean" in names(df)
12+
@test "Used_GI_Mean" in names(df)
13+
@test "Reference_Time" in names(df)
14+
@test "Target" in names(df)
15+
@test "q_025" in names(df)
16+
@test "q_25" in names(df)
17+
@test "q_5" in names(df)
18+
@test "q_75" in names(df)
19+
@test "q_975" in names(df)
20+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include("make_prediction_dataframe_from_output.jl")

pipeline/test/analysis/test_data.jld2

453 KB
Binary file not shown.

0 commit comments

Comments
 (0)