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

Abierto
#11,078 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
57/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python, yaml
Área
data, testing

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
178
Forks
224
Merge medio
2 d 7 h
PR fusionados (30 d)
309

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PolicyEngine/policyengine-us

Todos los issues de PolicyEngine/policyengine-us

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.