Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
fixed:
- Add safety catch in aca_ptc to return zero before 2025 to prevent breaking 2024 microsim runs.
27 changes: 19 additions & 8 deletions policyengine_us/tests/policy/baseline/gov/aca/ptc/aca_ptc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
- name: aca_ptc unit test 1
- name: ACA PTC returns zero before 2025
absolute_error_margin: 0.01
period: 2022
period: 2024
input:
is_aca_ptc_eligible: true
slcsp: 1_200
aca_magi: 25_000
aca_required_contribution_percentage: 0.04
output:
aca_ptc: 0

- name: ACA PTC calculated for 2025
absolute_error_margin: 0.01
period: 2025
input:
is_aca_ptc_eligible: true
slcsp: 1_200
Expand All @@ -9,24 +20,24 @@
output:
aca_ptc: 200 # 1200 - 0.04 * 25000 = 200

- name: aca_ptc unit test 2
- name: ACA PTC floors at zero when contribution exceeds plan cost
absolute_error_margin: 0.01
period: 2022
period: 2025
input:
is_aca_ptc_eligible: true
slcsp: 1_200
aca_magi: 25_000
aca_required_contribution_percentage: 0.05
output:
aca_ptc: 0 # 1200 - 0.05 * 25000 = -50
aca_ptc: 0 # 1200 - 0.05 * 25000 = -50, floored to 0

- name: aca_ptc unit test 1
- name: ACA PTC zero when not eligible
absolute_error_margin: 0.01
period: 2022
period: 2025
input:
is_aca_ptc_eligible: false
slcsp: 1_200
aca_magi: 25_000
aca_required_contribution_percentage: 0.04
output:
aca_ptc: 0 # 1200 - 0.04 * 25000 = 200
aca_ptc: 0
3 changes: 3 additions & 0 deletions policyengine_us/variables/gov/aca/ptc/aca_ptc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class aca_ptc(Variable):
defined_for = "is_aca_ptc_eligible"

def formula(tax_unit, period, parameters):
return 0

def formula_2025(tax_unit, period, parameters):
plan_cost = tax_unit("slcsp", period)
income = tax_unit("aca_magi", period)
applicable_figure = tax_unit(
Expand Down
Loading