The donor reader reads a blank household cost as zero before validation
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 74/100
調査の方向性
concept_mapping.py:2728-2734(コミット 9505a0da1c)にある AllocateToReferencePerson の逆変換から始めてください。ここは float64 へキャストし、世帯ごとに合計して 0 で埋める3行です。次に、呼び出し元の read_populace_us_donor と、transport.py:868-876 の検証ブロックを読んでください。この復号処理が使われている唯一の場所で、ここでは 0 が null・非有限値・範囲のチェックをすり抜けています。空、非有限、または実数でない元の値は合計の前に拒否されること、そしてケースごとにテストが1つあることが完了条件です。Issue にあるプローブを再利用して、両方のケースを確認してください。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 0
- フォーク
- 6
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 190
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PolicyEngine/microcosm のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
PolicyEngine/microcosm#1766 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PolicyEngine/microcosm#1721 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
PolicyEngine/microcosm#1638 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
PolicyEngine/microcosm#1431 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PolicyEngine/microcosm#1220 ·
メンテナーはふだん 1 日以内に返信
PolicyEngine/microcosm の issue をすべて見る
似ている issue
-
claude-subscription-directsdk: tool calls with raw control characters in string values are droppedオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NousResearch/hermes-official-plugins#538 ·
メンテナーはふだん 3 日以内に返信
-
bug(qdiffusion): EnergyModel.score_visible_logits computes biased visible/hidden on-ratios when solver returns variable solution counts per candidate対応中かも @houzhongyu が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
qboson/kaiwu-pytorch-plugin#2133 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MakazhanAlpamys/Soup#3415 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信