Skip to content

Commit 9b04d43

Browse files
committed
create script for generating postprocessed truth data
And bundle into single script for DRY
1 parent b79c7e7 commit 9b04d43

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using EpiAwarePipeline, EpiAware, JLD2, DrWatson, DataFramesMeta, CSV
2+
3+
## Define scenarios
4+
scenarios = ["measures_outbreak", "smooth_outbreak", "smooth_endemic", "rough_endemic"]
5+
6+
if !isfile(plotsdir("plotting_data/predictions.csv"))
7+
@info "Prediction dataframe does not exist, generating now"
8+
include("create_prediction_dataframe.jl")
9+
end
10+
11+
if !isfile(plotsdir("plotting_data/truthdata.csv"))
12+
@info "Truth dataframe does not exist, generating now"
13+
include("create_truth_dataframe.jl")
14+
end

pipeline/scripts/create_prediction_dataframe.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
using EpiAwarePipeline, EpiAware, AlgebraOfGraphics, JLD2, DrWatson, DataFramesMeta,
2-
Statistics, Distributions, DrWatson, CSV
3-
4-
## Define scenarios
5-
scenarios = ["measures_outbreak", "smooth_outbreak", "smooth_endemic", "rough_endemic"]
6-
71
## Define true GI means
82
true_gi_means = [2.0, 10.0, 20.0]
93

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
truth_df = mapreduce(vcat, scenarios) do scenario
2+
truth_data_files = readdir(datadir("truth_data")) |>
3+
strs -> filter(s -> occursin("jld2", s), strs) |>
4+
strs -> filter(s -> occursin(scenario, s), strs)
5+
mapreduce(vcat, truth_data_files) do filename
6+
D = load(joinpath(datadir("truth_data"), filename))
7+
make_truthdata_dataframe(D, scenario)
8+
end
9+
end
10+
11+
CSV.write(plotsdir("plotting_data/truthdata.csv"), truth_df)

0 commit comments

Comments
 (0)