Make infection feedback a constructor option of the latent classes; remove `infection_process`
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 30
- フォーク
- 11
- 平均マージ
- 6日 20時間
- マージ済み PR(30日)
- 5
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CDCgov/PyRenew のほかの issue
-
Support date-based right-truncation offsets対応中かも @cdc-mitzimorris が 4 日前に担当しました。 オープン
CDCgov/PyRenew#928 · コメント 1 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 4 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 4 日以内に返信
-
clean up model
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
CDCgov/PyRenew#923 · コメント 3 件 ·
メンテナーはふだん 4 日以内に返信
-
Complete non-centering in temporal-process innovation parameterizations再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンclean up
難易度 4/5 3〜5日 初心者へのやさしさ 53/100
CDCgov/PyRenew#921 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
Standardize initial value handling across `TemporalProcess`es再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
CDCgov/PyRenew#917 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
似ている issue
-
integration: logger
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
home-assistant/core#191147 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
documentation p4
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
MillenniumDawn/focus-tree-creation-tool#417 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CharlesP44/Beem_Energy#96 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
rheeloaded/paperpull#153 ·
メンテナーはふだん 1 日以内に返信