Skip to content

Start generation counts from prepared campaigns - #1268

Merged
sbfnk merged 4 commits into
mainfrom
issue-1265-start-generation-counts-from-prepared-ca
Nov 27, 2026
Merged

sbfnk merged 4 commits into
mainfrom
issue-1265-start-generation-counts-from-prepared-ca

Conversation

@sbfnk-bot

Copy link
Copy Markdown
Collaborator

Add simulate(prepared; n_initial, max_generations, rng) to reuse prepared campaigns. It uses the existing simulate dispatch and infers the state type for single-type campaign tuples.

Checked seeded starts against model-specification starts for single- and multi-type models, and ran the generation-count, campaign, population and quality tests.

This PR closes #1265.

sbfnk-bot and others added 3 commits November 26, 2026 22:08
Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
Comment thread src/models/generation_counts.jl Resolved
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark comparison vs base

Minimum time per call. Buckets are PR time as a % of base, so lower is faster (🟢 faster, ⚪ within 5%, 🔴 slower). Counts of benchmarks per bucket:

Group 🟢 <50% 🟢 50–75% 🟢 75–95% ⚪ 95–105% 🔴 105–125% 🔴 125–150% 🔴 >150%
Evaluation · · · 19 · · ·
Evaluation — 19 benchmarks (by time change)
Benchmark base PR time memory
simulation: homogeneous SI, max_time 18.06 ms 17.52 ms ⚪ 0.97× ⚪ 1.0×
simulation: network, shared kernel 169.82 μs 166.67 μs ⚪ 0.98× ⚪ 1.0×
evaluation: compile_contact_pairs 26.64 μs 26.2 μs ⚪ 0.98× ⚪ 1.0×
simulation: branching process, HeldCapacity with DeferRefused 1.34 s 1.32 s ⚪ 0.99× ⚪ 1.0×
simulation: branching process 1.45 ms 1.43 ms ⚪ 0.99× ⚪ 1.0×
simulation: homogeneous, susceptibility trait 33.6 ms 33.18 ms ⚪ 0.99× ⚪ 1.0×
simulation: homogeneous 27.51 ms 27.19 ms ⚪ 0.99× ⚪ 1.0×
evaluation: chain size loglikelihood 1.97 μs 1.95 μs ⚪ 0.99× —
simulation: network, live kernel with policy 4.46 ms 4.43 ms ⚪ 0.99× ⚪ 1.0×
simulation: branching process, interventions 16.59 μs 16.48 μs ⚪ 0.99× ⚪ 1.0×
simulation: households 1.06 ms 1.05 ms ⚪ 0.99× ⚪ 1.0×
evaluation: pairwise_surv_loglik 24.24 μs 24.33 μs ⚪ 1.0× ⚪ 1.0×
evaluation: PoissonWeibull pdf 51.53 μs 51.69 μs ⚪ 1.0× ⚪ 1.0×
evaluation: PoissonLognormal pdf 36.76 μs 36.71 μs ⚪ 1.0× ⚪ 1.0×
simulation: network, live kernel 4.05 ms 4.05 ms ⚪ 1.0× ⚪ 1.0×
evaluation: PoissonWeibull pdf, large count 50.58 μs 50.56 μs ⚪ 1.0× ⚪ 1.0×
evaluation: PoissonLognormal pdf, large count 37.99 μs 37.98 μs ⚪ 1.0× ⚪ 1.0×
evaluation: ChainSizes loglikelihood 460.0 ns 460.0 ns ⚪ 1.0× —
evaluation: extinction_probability 891.0 ns 891.0 ns ⚪ 1.0× ⚪ 1.0×
AD gradients — 0 benchmarks (by time change)

none

Co-authored-by: sbfnk <sebastian.funk@lshtm.ac.uk>
@codecov

codecov Bot commented Nov 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.80%. Comparing base (759ea53) to head (2f23766).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1268   +/-   ##
=======================================
  Coverage   97.80%   97.80%           
=======================================
  Files         104      104           
  Lines       11852    11861    +9     
=======================================
+ Hits        11592    11601    +9     
  Misses        260      260           
Flag Coverage Δ
epibranch-ad 29.33% <0.00%> (-0.03%) ⬇️
epibranch-analytical 40.41% <0.00%> (-0.04%) ⬇️
epibranch-engine 52.37% <50.00%> (-0.01%) ⬇️
epibranch-inference 44.18% <0.00%> (-0.04%) ⬇️
epibranch-interventions 54.26% <100.00%> (+0.17%) ⬆️
epibranch-population 53.77% <50.00%> (-0.01%) ⬇️
epihouseholds 96.94% <ø> (ø)
epinetwork 95.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sbfnk-bot
sbfnk-bot marked this pull request as ready for review November 26, 2026 23:37
@sbfnk-bot
sbfnk-bot requested a review from sbfnk as a code owner November 26, 2026 23:37
@sbfnk
sbfnk merged commit b563bb4 into main Nov 27, 2026
29 checks passed
@sbfnk
sbfnk deleted the issue-1265-start-generation-counts-from-prepared-ca branch November 27, 2026 09:24
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.

Start generation counts from prepared campaigns

2 participants