After #9621, the pinned 2043 example in the personal exemption rounding test no longer tells $25 rounding from $50

未关闭
#11,078 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
57/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, yaml
领域
data, testing

调研方向

Start with policyengine_us/tests/core/test_breakdown_parameter_uprating.py, especially the pinned example and its nearby comment; then inspect the named capital gains and Colorado CollegeInvest YAML cases. Check the reported threshold calculations against the test inputs to confirm which cases fail to distinguish the intended rules. Done means the test examples reliably distinguish the described rounding behavior and the comments accurately describe the index and boundary cases.

由索引模型根据 Issue 内容生成。

描述

test_personal_exemption_projection_rounding_bounds_and_order pins @example(year=2043, status="SEPARATE"), which #10825 added. On main's index, rounding the separate filers' threshold down to $25 and down to $50 first gives different amounts in 2043: $243,700 × U(2043) / U(2035) = $284,934.22, so $284,925 against $284,900.

#9621 moves gov.irs.uprating to the 12 months ending August, and after 2035 the index grows by 217.68 / 213.471 a year. On that index the 2043 threshold comes to $243,700 × (217.68 / 213.471)⁸ = $284,900.15, which rounds to $284,900 either way. A threshold that took the joint filers' $50 interval would pass every assertion at this example. On this index the two roundings first differ in 2039: $243,700 × (217.68 / 213.471)⁴ = $263,496.05, so $263,475 against $263,450.

The test's 20 Hypothesis draws may still reach such a year, but no pinned example guarantees one.

Changes

  • Replace the example with @example(year=2039, status="SEPARATE"), with a comment that gives the two amounts.
  • In the same file, the comment at line 87 says the index "follows CBO's chained CPI-U projection". The index grows at CBO's projected rate from its last observed window, so it reaches 218.69 for 2036, where CBO projects 217.68. "Grows with", the wording at exemptions.yaml line 212, fits.
  • In capital_gains_tax_increase.yaml, the middle input of each proposal case equals the threshold as written. The model stores taxable_income as a 32-bit float, so it reads $1,027,586.375 and $513,793.1875, each a cent or two below the threshold. The expected $20,000 holds at or below the threshold, and a comment can say which side the case tests.
  • The 2027 Colorado CollegeInvest cases (lines 71 to 90) can't tell rounding to the nearest $100 from rounding up: $26,996.87 and $40,392.27 give $27,000 and $40,400 either way. The same held on main's index ($26,980.83 and $40,368.26). A later year in which the two differ would pin the rule.

None of these changes what the model computes.

🤖 Generated with Claude Code

主要语言
Python
星标
178
派生
224
平均合并
2 天 7 小时
30 天内合并 PR
309

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PolicyEngine/policyengine-us 的其他 Issue

查看 PolicyEngine/policyengine-us 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。