You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The two renewal models duplicate their setup, so seeding changes have to be made twice #356
as_turing_model(::Renewal, ::ModelShape) and as_turing_model(::StochasticRenewal, ::Int) share about thirty lines: drawing Z_t and mapping it to Rt, resolving the generation interval and baking the step, the SeedingPath branch on the initialisation slot, and building the initial state.
Only the recursion differs. Renewal calls accumulate_scan; StochasticRenewal runs the propose/commit loop so it can draw in between.
That means a change to seeding or to generation-interval handling has to be made in two places. #347 changed both of those, which is exactly the kind of edit that would now need doing twice.
Shape
A @model helper returning the resolved pieces, called with to_submodel(..., false) from both so the variable names stay flat.
Something like
Two things to check when doing it.
The helper draws Z_t, init_incidence, gen and scan_step, so the prefixing has to stay off or every existing chain is renamed. Renewal takes a ModelShape and StochasticRenewal takes an Int, so the helper has to be shape-generic even though only one caller uses the matrix shape.
#348 rebased across #347 while both files were moving, and the refactor touches Renewal's model body, which is the part most likely to be edited concurrently.
Doing it separately keeps the risk off a change that is otherwise additive.
This was opened by a bot. Please ping @seabbs for any questions.
Activity
refactor(infections): draw both renewal models' setup once