Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

calculate_household raises SPMInputError for households without county_fips

オープン
#543 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@MaxGhenis がすでに取り組んでいます。

2026年9月30日 から。

  • #544 @MaxGhenis による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

Start at the pe.us.calculate_household entry point and read policyengine_us/spm.py, especially require_county_input and the default SPM selection. Reproduce the state-only example, then verify county and explicit national selections against the stated behavior, including the skill-examples failures. Done means state-only households return results without weakening explicit-selection or population-data validation.

索引モデルが issue の本文から書いたものです。

説明

pe.us.calculate_household fails for every household that gives a state but no county. With policyengine 6.2.0 (policyengine-us 2.2.1, spm-calculator 1.0.0):

import policyengine as pe
pe.us.calculate_household(
    people=[{"age": 40, "employment_income": 50_000}, {"age": 8}],
    tax_unit={"filing_status": "HEAD_OF_HOUSEHOLD"},
    household={"state_code": "CA"},
    year=2026,
)

raises SPMInputError: County selection has no county FIPS input ('') from policyengine_us/spm.py require_county_input. The default output columns include spm_unit_is_in_spm_poverty, and the bundle's default SPM selection is county measurement, so the whole call fails even when the caller wants only taxes and benefits. Adding county_fips or spm={"geography_kind": "national"} works around it.

Impact: every state-only household call since 6.0.0, including the examples in the PolicyEngine skills (PolicyEngine/policyengine-skills skill-examples fails on 8 examples, e.g. run 36653351748).

Expected: a state-only household returns a result. A state alone does not identify a Census SPM estimation area, so it should be measured nationally, and the result should say that national measurement replaced the default county selection. A household with county_fips keeps its county's area. Explicit selections keep failing closed, and population data keeps requiring observed counties.

主要言語
Python
スター
8
フォーク
9
平均マージ
15時間 28分
マージ済み PR(30日)
13

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PolicyEngine/policyengine.py のほかの issue

PolicyEngine/policyengine.py の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。