Skip to content

Modifying script for additional model run and results storage - #24

Merged
gvegayon merged 7 commits into
mainfrom
copilot/modify-template-script-increase-seeds
Jul 7, 2026
Merged

gvegayon merged 7 commits into
mainfrom
copilot/modify-template-script-increase-seeds

Conversation

Copilot AI commented May 20, 2026 •

Copy link
Copy Markdown
Contributor
  • Inspect PR Modifying script for additional model run and results storage #24 review thread and identify actionable new comments
  • Run existing lint/build/test commands to establish baseline before edits
  • Apply only requested code changes from review suggestions
  • Run targeted tests for changed areas and verify no regressions
  • Run final parallel validation (Code Review + CodeQL)
  • Reply to each addressed actionable comment with commit hash

Copilot AI and others added 2 commits May 20, 2026 20:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a second (“+1 seed”) simulation run per city and introduces a new sensitivity analysis report to relate final outbreak size to initial seed cases while controlling for demographics.

Changes:

  • scenarios/template.qmd: run a second simulation set with one additional seed case and save outputs to separate *_plus1seed.csv files.
  • sensitivity_analyses/seeds_vs_outbreak_controls.qmd: new analysis that reads baseline/+1 outputs and fits/plots a regression with population, vaccination rate, and age-structure controls.
  • Repo wiring updates: narrow README file globbing, document the new analysis in DETAILS.md, and un-ignore the new plus1 CSV outputs.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sensitivity_analyses/seeds_vs_outbreak_controls.qmd New demographic-controls analysis reading baseline and +1 seed scenario outputs.
scenarios/template.qmd Adds an additional +1 seed simulation run and writes separate result CSVs.
README.qmd Restricts scenario file discovery to baseline outbreak-size CSVs.
DETAILS.md Documents the new sensitivity analysis file.
.gitignore Ensures the new *_plus1seed.csv outputs are not ignored.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +46
baseline_files <- list.files(
"scenarios",
pattern = "_outbreak_size\\.csv$",
full.names = TRUE
)

plus1_files <- list.files(
"scenarios",
pattern = "_outbreak_size_plus1seed\\.csv$",
full.names = TRUE
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like using the here::here() R function. Instead, I am a fan of symbolic links. If needed, let's add the corresponding symbolic link so we can ensure this works if you render it from the root directory or within sensitivity_analyses.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in commit 0aa7c54: I added sensitivity_analyses/scenarios as a symbolic link to ../scenarios so the QMD resolves the same scenarios/ path when rendered from either location.

Comment thread scenarios/template.qmd
Comment on lines +292 to +310
#| label: running-simulations-plus1-seed
expected_active_cases_plus1 <- expected_active_cases + 1L

get_virus(measles_model, 0L) |>
set_distribution_virus(
distfun = distribute_virus_randomly(
prevalence = expected_active_cases_plus1,
as_proportion = FALSE
)
)

measles_model |>
run_multiple(
ndays = params$ndays,
nsims = params$nsims,
seed = params$seed,
saver = make_saver("outbreak_size", "hospitalizations"),
nthreads = params$nthreads
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree with this. We need to have the same number of runs, even if it means twice the time. We will be using those later in the future, so let's not follow this advice.

Copilot AI requested a review from gvegayon May 20, 2026 22:19
@gvegayon
gvegayon merged commit 5ae0b5c into main Jul 7, 2026
12 checks passed
@gvegayon
gvegayon deleted the copilot/modify-template-script-increase-seeds branch July 7, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants