NM Child Income Tax Credit: $75,001 bracket start gives $212 instead of $106

オープン 初心者向け
#10,073 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

バグは policyengine_us/parameters/gov/states/nm/tax/income/credits/ctc/amount.yaml のブラケット表にあります。4つ目のブラケットは75_001から始まっていますが、他のブラケットは切りのよい数値から始まっています。issue の再現スクリプトでは、AGI 75,001 のときに nm_ctc が 212 を返していますが、公式の表では 106 になります。開始値を 75_000 に変更し、issue の表にある 75,001 の3ケースを確認してください。その後、nm_ctc の YAML テストを実行し、他のブラケットが引き続き正しいことを確認してください。すべてのブラケット境界で公式の値と一致すれば完了です。

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

説明

Problem

For AGI exactly $75,001, nm_ctc returns the $50,000–$75,000 amount instead of the next bracket.

The 2025 New Mexico Child Income Tax Credit table (https://www.tax.newmexico.gov/new-mexico-child-tax-credit/, and PIT-RC Table 4 in the 2025 PIT packet already cited in the parameter) gives $212 per child for AGI over $50,000 through $75,000 and $106 per child over $75,000 through $100,000.

PolicyEngine-US 2.38.9, 2025:

Case Official nm_ctc
Single, AGI $75,000, one child $212 $212
Single, AGI $75,001, one child $106 $212
Joint, AGI $75,001, one child $106 $212
Single, AGI $75,001, two children $212 $424
Single, AGI $75,002, one child $106 $106

A 45-case panel (every bracket endpoint and adjacent value, single and joint, two children, age, dependency, TIN, no-child and negative-AGI controls) fails only at these three $75,001 cases, on 2.2.1 and 2.30.3 as well.

Cause and possible fix

nm_ctc uses p.amount.calc(agi, right=True) (upper-inclusive), which is right for the table. But in policyengine_us/parameters/gov/states/nm/tax/income/credits/ctc/amount.yaml the fourth bracket starts at 75_001 while the others start at the round number (25_000, 50_000, 100_000, ...). Changing 75_001 to 75_000 makes all 45 cases in that panel match.

Reproduce

from policyengine_us import Simulation
Y = 2025
sim = Simulation(situation={
    "people": {"p": {"age": {Y: 35}}, "c": {"age": {Y: 5}, "is_tax_unit_dependent": {Y: True}}},
    "tax_units": {"t": {"members": ["p", "c"], "filing_status": {Y: "SINGLE"}, "adjusted_gross_income": {Y: 75_001}}},
    "households": {"h": {"members": ["p", "c"], "state_code": {Y: "NM"}}},
    "families": {"f": {"members": ["p", "c"]}}, "spm_units": {"s": {"members": ["p", "c"]}},
    "marital_units": {"m": {"members": ["p"]}},
})
print(sim.calculate("nm_ctc", Y))  # 212, official table gives 106
主要言語
Python
スター
170
フォーク
217
平均マージ
4日 10時間
マージ済み PR(30日)
396

環境構築

はじめの一歩

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

PolicyEngine/policyengine-us のほかの issue

PolicyEngine/policyengine-us の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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