budget.households is the sum of squared household weights
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 20/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 1
- Fork
- 1
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 40
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PolicyEngine/policyengine-sim-api
-
Integration tests fail due to missing UV virtual environment setupCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
PolicyEngine/policyengine-sim-api#314 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update policyengine to 6.4.3Có thể đã có người làm @policyengine đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 35/100
PolicyEngine/policyengine-sim-api#812 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Update policyengine to 6.4.2Có thể đã có người làm @policyengine đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 40/100
PolicyEngine/policyengine-sim-api#810 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Register weighted-microdata rules: weights aren't valuesCó thể đã có người làm @anth-volk đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
PolicyEngine/policyengine-sim-api#806 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
PolicyEngine/policyengine-sim-api#805 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của PolicyEngine/policyengine-sim-api
Issue tương tự
-
Workflow.schedule stops when a cron deadline passes before sleepCó thể đã có người làm @HuaTNA đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] HiveDialect shares its colspecs dict with SQLAlchemy's DefaultDialect (python/pyhive)Có thể đã có người làm @rusackas đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
apache/kyuubi#7786 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[20.0] hr_work_entry: Duration column of Export Time Entries is truncated to whole hoursCó thể đã có người làm @odooaktiv đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
fix formatting of the sample database page of the docsCó thể đã có người làm @Aaqibhafeezkhan đã nhận hôm nay. Đang mởdocumentation good first issue help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
chaoss/CollectOSS#544 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày