Skip to content

Commit

Permalink
update SI
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelBrand1 committed Dec 18, 2024
1 parent 677d222 commit 3d624dc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
1 change: 1 addition & 0 deletions manuscript/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DataFramesMeta = "1313f7d8-7da2-5740-9ea0-a2ca25f37964"
DrWatson = "634d3b9d-ee7a-5ddf-bec9-22491ea816e1"
Expand Down
43 changes: 24 additions & 19 deletions manuscript/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ index_location = @__DIR__()
Pkg.activate(index_location)
Pkg.resolve()
Pkg.instantiate()
Pkg.add(["CairoMakie", "JLD2", "DataFramesMeta", "DrWatson"])
Pkg.add(["CairoMakie", "JLD2", "DataFramesMeta", "DrWatson", "CSV"])
using DataFramesMeta, JLD2
using DataFramesMeta, JLD2, CSV
```

Expand Down Expand Up @@ -66,23 +66,28 @@ We noted that for a substantial number of the model configurations there were mo
priorpred_dir = joinpath(@__DIR__(),"..", "pipeline/data/priorpredictive/")
priorpred_datafiles = readdir(priorpred_dir) |>
fns -> filter(fn -> contains(fn, ".jld2"), fns) #filter for .jld2 files
priorpred_outcomes_df = mapreduce(vcat, priorpred_datafiles) do fn
D = load(joinpath(priorpred_dir, fn))
igp = D["inference_config"]["igp"]
latent_model = D["inference_config"]["latent_model"]
gi_mean = D["inference_config"]["gi_mean"]
T1, T2 = split(D["inference_config"]["tspan"], "_")
runsuccess = D["priorpredictive"] .== "Pass"
df = DataFrame(
infection_gen_proc = igp,
latent_model = latent_model,
gi_mean = gi_mean,
T1 = T1,
T2 = T2,
T_diff = parse(Int, T2) - parse(Int, T1),
runsuccess = runsuccess,
)
priorpred_outcomes_df = DataFrame()
if !isfile(joinpath(index_location, "pass_fail_rdn1.csv"))
priorpred_outcomes_df = mapreduce(vcat, priorpred_datafiles) do fn
D = load(joinpath(priorpred_dir, fn))
igp = D["inference_config"]["igp"]
latent_model = D["inference_config"]["latent_model"]
gi_mean = D["inference_config"]["gi_mean"]
T1, T2 = split(D["inference_config"]["tspan"], "_")
runsuccess = D["priorpredictive"] .== "Pass"
df = DataFrame(
infection_gen_proc = igp,
latent_model = latent_model,
gi_mean = gi_mean,
T1 = T1,
T2 = T2,
T_diff = parse(Int, T2) - parse(Int, T1),
runsuccess = runsuccess,
)
end
CSV.write(joinpath(index_location, "pass_fail_rdn1.csv"), priorpred_outcomes_df)
else
priorpred_outcomes_df = CSV.File(joinpath(index_location, "pass_fail_rdn1.csv")) |> DataFrame
end
```

Expand Down

0 comments on commit 3d624dc

Please sign in to comment.