The donor reader reads a blank household cost as zero before validation
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue nà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
- 74/100
Hướng nghiên cứu
Bắt đầu từ phép nghịch đảo của AllocateToReferencePerson trong concept_mapping.py:2728-2734 (tại 9505a0da1c), ba dòng ép kiểu sang float64, cộng theo hộ gia đình và điền bằng 0. Sau đó đọc hàm gọi read_populace_us_donor và khối kiểm tra hợp lệ tại transport.py:868-876, nơi duy nhất sử dụng phép giải mã này và là chỗ số 0 lọt qua các kiểm tra null, không hữu hạn và giới hạn. Hoàn thành khi một giá trị nguồn rỗng, không hữu hạn hoặc không phải số thực bị từ chối trước khi cộng, với một kiểm thử cho mỗi trường hợp; tái sử dụng probe trong issue để xác nhận cả hai trường hợp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
read_populace_us_donor decodes three household costs from person columns: rent from pre_subsidy_rent, mortgage interest from home_mortgage_interest and property tax from real_estate_taxes. Each binding uses AllocateToReferencePerson, and its inverse (concept_mapping.py:2728-2734 at 9505a0da1c) casts the person column to float64, sums it by household and fills a household with no persons with 0.
pandas skips blanks in that sum. A household whose persons all hold a blank cost reads 0, and a blank beside a value reads as that value. The cast also drops the imaginary part of a complex value, with a ComplexWarning and no error.
The reader validates the decoded tables next (transport.py:876). Its checks for nulls, non-finite values and bounds would refuse a blank cost, but they receive 0, so the reader accepts the donor. Only the reader calls this decode (transport.py:868).
A probe with the inverse's three lines shows both cases:
invert(pd.Series([np.nan, 5.0, np.nan]), person_household=[1, 1, 2], households=[1, 2, 3])
# array([5., 0., 0.])
invert(pd.Series([7 + 99j, 1 + 0j]), person_household=[1, 2], households=[1, 2])
# array([7., 1.]), with a ComplexWarning
I have not checked whether any donor file in use holds a blank in these columns.
A fix could refuse a blank, non-finite or non-real value in the source column before the sum, with one test per case. The check of #1698 found this; #1698 leaves decode unchanged, and its profiled read and the plain read decode these costs the same way.
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 6
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 190
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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/microcosm
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
PolicyEngine/microcosm#1766 ·
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 72/100
PolicyEngine/microcosm#1721 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
County rung: a malformed-geography refusal leaves an old county_surface.json success receiptĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PolicyEngine/microcosm#1638 ·
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 85/100
PolicyEngine/microcosm#1431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PolicyEngine/microcosm#1220 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của PolicyEngine/microcosm
Issue tương tự
-
claude-subscription-directsdk: tool calls with raw control characters in string values are droppedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NousResearch/hermes-official-plugins#538 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug(qdiffusion): EnergyModel.score_visible_logits computes biased visible/hidden on-ratios when solver returns variable solution counts per candidateCó thể đã có người làm @houzhongyu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
qboson/kaiwu-pytorch-plugin#2133 ·
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 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MakazhanAlpamys/Soup#3415 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày