Make infection feedback a constructor option of the latent classes; remove `infection_process`
I maintainer di solito rispondono entro 6 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start with pyrenew/latent/base.py and the sample methods and constructors in population_infections.py and subpopulation_infections.py; compare their current renewal calls with InfectionsWithFeedback.sample in infection_process.py. Then update the exports and tests listed in the issue, including builder and integration coverage. Done means both latent classes support the paired feedback options and preserve the documented behavior, while the standalone infection classes still pass their tests.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Remove the InfectionProcess protocol and the infection_process constructor argument added in #847. Infection feedback becomes two optional constructor arguments of PopulationInfections and SubpopulationInfections, and each latent class defines its own renewal step.
Motivation
- Only two renewal steps exist, and one contains the other. Feedback with strength 0 gives exactly plain renewal. A pluggable protocol is more general than the code needs.
- Feedback should be easy to find. It should be a documented option of the latent class, not a separate object users must know to build.
- Coupled models can't use the protocol.
MobilitySubpopulationInfections(#901) needs the population fractions in its renewal step, which the protocol does not pass. Without the protocol, every latent class defines its renewal step the same way.
What the user writes
Today:
builder.configure_latent(
PopulationInfections,
...,
infection_process=InfectionsWithFeedback(
name="infections",
infection_feedback_strength=strength_rv,
infection_feedback_pmf=feedback_pmf_rv,
),
)
After this change:
builder.configure_latent(
PopulationInfections,
...,
infection_feedback_strength_rv=strength_rv,
infection_feedback_pmf_rv=feedback_pmf_rv,
)
SubpopulationInfections takes the same two arguments. Without feedback, nothing changes.
Behavior
- Given the same random variables and seed, results are identical to passing
infection_process=InfectionsWithFeedback(...)today. - Feedback is off unless both arguments are given. One without the other raises
ValueError. - A feedback PMF whose length differs from the generation interval, or a strength that does not broadcast to the shape of Rt, raises
ValueErrorwith both shapes. Today the PMF case is a shape error fromjnp.einsum. - Passing
infection_processraisesTypeError. - The recorded Rt used by the renewal equation is renamed:
rt_single_effectivetort_single_adjusted, andrt_subpop_effectivetort_subpop_adjusted. "Adjusted" matchescompute_infections_from_rt_with_feedback(Rt_rawin,Rt_adjustedout) and avoids a second meaning of "effective reproduction number".rt_singleandrt_subpop(raw Rt) are unchanged. InfectionsandInfectionsWithFeedbackare unchanged;pyrenew-multisignalusesInfectionsWithFeedbackdirectly.
Breaking change
infection_process, InfectionProcess, and the _effective sites were added in #847 (2026-07-01) and are in no tagged release. One CDC-internal project passes infection_process to SubpopulationInfections; it moves the two arguments onto the latent class and reads the renamed sites. The release notes show the before and after code and the site renames.
Order
Land before #901, which builds on the renewal step and names from this change.
Out of scope
- Changing the feedback model.
- Turning feedback on by default.
- Lingua principale
- Python
- Stelle
- 30
- Fork
- 11
- Merge medio
- 6g 1h
- PR unite (30g)
- 10
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CDCgov/PyRenew
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 6 giorni
-
Update wastewater measurements tutorial to avoid representing 0 concentrations as `-inf` log concentrationsForse già presa @cdc-mitzimorris l’ha presa 2 giorni fa. Aperta
CDCgov/PyRenew#915 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 6 giorni
-
Demonstrate how missing values should be specified and how they are handledForse già presa @cdc-mitzimorris l’ha presa 6 giorni fa. Aperta
CDCgov/PyRenew#911 · 5 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 6 giorni
Tutte le issue di CDCgov/PyRenew
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
fossasia/visdom-dev#69 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Frontend build fails with Frappe version-16: DataImport is no longer exported by @framework/uiApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
BUG: PROD: v1.3.0-beta Onboarding Profile Picture Misaligns When Name Validation Error AppearsForse già presa @RitikaSen27 l’ha presa oggi. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
AOSSIE-Org/PictoPy#1647 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[oblt-aw][autodoc] Update workflow docs for gh-aw v0.92.5 and detector permission scopeForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno