Skip to content

Commit

Permalink
Move three ACA parameters and rename an ACA variable (PolicyEngine#3331)
Browse files Browse the repository at this point in the history
* Move parameters and rename variable

* Add index.yaml to parameters/gov/slspc to prevent users from changing
  • Loading branch information
martinholmer authored Nov 30, 2023
1 parent ce34953 commit b633823
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 27 deletions.
5 changes: 5 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- bump: patch
changes:
fixed:
- Relocate some ACA parameters to clarify their role.
- Rename one ACA variable to clarify its role.
4 changes: 4 additions & 0 deletions policyengine_us/parameters/gov/aca/slspc/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
metadata:
propagate_metadata_to_children: true
economy: false
household: false
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
description: Maximum age for adults under the ACA.
description: Maximum age for ACA SLSPC amounts.
metadata:
period: year
label: ACA maximum adult age (given adults are eligible for Medicare at age 65)
label: ACA maximum SLSPC adult age
reference:
- title: Medicare & the Health Insurance Marketplace
href: https://www.medicare.gov/Pubs/pdf/11694-Medicare-and-Marketplace.pdf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
description: Maximum age for children under the ACA.
description: Maximum age for ACA SLSPC amounts.
metadata:
period: year
label: ACA maximum child age
label: ACA maximum SLSPC child age
reference:
- title: KFF Health Insurance Marketplace Calculator
href: https://www.kff.org/interactive/subsidy-calculator/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: aca_slspc_trimmed_age unit test 1
period: 2022
input:
age: [0, 11, 15, 20, 21, 30, 40, 50, 60, 64, 65, 70]
output:
aca_slspc_trimmed_age: [14, 14, 15, 20, 21, 30, 40, 50, 60, 64, 64, 64]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: person_aca_slspc_ca unit test 1
period: 2022
input:
aca_trimmed_age: 25
aca_slspc_trimmed_age: 25
is_aca_ptc_eligible_ca: true
state_fips: 6 # CA
county_fips: 0 # UNKNOWN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class aca_child_index(Variable):

def formula(person, period, parameters):
age = person("age", period)
is_child = age <= parameters(period).gov.aca.max_child_age
is_child = age <= parameters(period).gov.aca.slspc.max_child_age
child_rank = person.get_rank(person.tax_unit, -age, condition=is_child)
# child_rank of 0 ==> oldest; ties broken by order in the tax unit
ADULT_VALUE = 99
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def formula(person, period, parameters):
is_income_eligible = p.ptc_income_eligibility.calc(magi_frac)

# determine which people pay an age-based ACA plan premium
is_aca_adult = person("age", period) > p.max_child_age
is_aca_adult = person("age", period) > p.slspc.max_child_age
child_pays = person("aca_child_index", period) <= p.max_child_count
pays_aca_premium = is_aca_adult | child_pays

Expand Down
16 changes: 16 additions & 0 deletions policyengine_us/variables/gov/aca/slspc/aca_slspc_trimmed_age.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from policyengine_us.model_api import *


class aca_slspc_trimmed_age(Variable):
value_type = int
entity = Person
label = (
"Age clipped to be in ACA SLSPC "
"last_same_child_age, max_adult_age range"
)
definition_period = YEAR

def formula(person, period, parameters):
age = person("age", period)
p = parameters(period).gov.aca.slspc
return max_(p.last_same_child_age, min_(p.max_adult_age, age))
13 changes: 0 additions & 13 deletions policyengine_us/variables/gov/aca/slspc/aca_trimmed_age.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ def formula(person, period, parameters):
gra = aca_gra[in_state * idx].astype(int)
# specify ACA second-lowest silver-plan cost
aca_slspc = ptree.gov.aca.ca_.slspc(period)
age = person("aca_trimmed_age", period)
age = person("aca_slspc_trimmed_age", period)
return aca_slspc[gra][age]

0 comments on commit b633823

Please sign in to comment.