budget.households is the sum of squared household weights
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 20/100
調査の方向性
Start in simulation_output_budget.build_budgetary_impact and inspect how _sum_output_variable handles the household MicroDataFrame and its household_weight column. The existing test test_builder_budgetary_impact_uses_materialized_columns_and_uk_state_tax_zero uses plain DataFrames; add coverage with a real MicroDataFrame and verify the household count is 3 for weights [1, 2]. An open linked pull request (#767) is already addressing this issue.
索引モデルが issue の本文から書いたものです。
説明
Problem
The economy comparison's budget.households is the sum of squared household weights, not the household count. It is about 10⁴ times too high on every run, national and state:
Run (/us/economy/{reform}/over/2) |
budget.households |
Actual households |
|---|---|---|
region=state/ny, 2026 |
135,597,233,840 | ~7.5 million |
region=state/ca, 2026 |
197,620,236,261 | ~13.5 million |
region=state/va, 2027 |
44,192,009,994 | ~3.3 million |
Cause
simulation_output_budget.build_budgetary_impact sets households=_sum_output_variable(baseline, "household_weight", entity="household").
_sum_output_variable returns float(data[variable].sum()). Here data is the household MicroDataFrame, which policyengine weights by household_weight. So data["household_weight"] is a weighted MicroSeries, and its .sum() is Σ w × w.
Weights [1, 2] give 5.0 instead of 3.0. The existing test (test_builder_budgetary_impact_uses_materialized_columns_and_uk_state_tax_zero) uses plain pd.DataFrames, so it never caught this.
This came in with 36d3be0 ("adapt simulation worker to PolicyEngine v4 outputs").
The other budget fields are correct. They are meant to be weighted sums.
Impact
Clients divide by this field. For example, policyengine-app-v2 computes the headline average change per household as -budget.budgetary_impact / budget.households. That number is therefore about 10⁴ times too small on every report.
Fix
Count entities with a plain sum of their weight column, and test it on a real MicroDataFrame.
- 主要言語
- Python
- スター
- 1
- フォーク
- 1
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PolicyEngine/policyengine-sim-api のほかの issue
-
Integration tests fail due to missing UV virtual environment setup対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
PolicyEngine/policyengine-sim-api#314 ·
メンテナーはふだん 1 日以内に返信
-
Update policyengine to 6.3.2対応中かも @policyengine が 1 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 25/100
PolicyEngine/policyengine-sim-api#770 ·
メンテナーはふだん 1 日以内に返信
-
Update policyengine to 6.3.1対応中かも @policyengine が 1 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 25/100
PolicyEngine/policyengine-sim-api#768 ·
メンテナーはふだん 1 日以内に返信
-
Run ruff check in CI with the first group of rule families対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
PolicyEngine/policyengine-sim-api#764 ·
メンテナーはふだん 1 日以内に返信
-
Move the deploy pipeline's multi-line steps into tested scripts対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
PolicyEngine/policyengine-sim-api#761 ·
メンテナーはふだん 1 日以内に返信
PolicyEngine/policyengine-sim-api の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
task
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
danparshall/claude_researcher#87 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
datajoint/datajoint-python#1586 ·
メンテナーはふだん 1 日以内に返信
-
1D intercept of length 1 is accepted as `fix_params` in population GLM with more than 1 unit対応中かも @dhvani7014 が今日担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
flatironinstitute/nemos#642 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
uniswap-python/uniswap-python#487 ·