Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
hua7450 authored Dec 5, 2024
1 parent fefb69d commit 6c19cef
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 13 deletions.
13 changes: 13 additions & 0 deletions policyengine_us/parameters/gov/bankruptcy/dependent_expense.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: The IRS limits the expense of dependent children education to this amount to each child under the chapter 7 bankruptcy means test.

values:
2024-01-01: 2275

metadata:
unit: currency-USD
period: year
label: Dependent children education expense per child
reference:
# The number, $189.58,comes from line 28 of the form, multiply by 12 and get the annual amount.
- title: Official Form 122A-2 Chapter 7 Means Test Calculation
href: https://www.cacb.uscourts.gov/sites/cacb/files/documents/forms/122A2.pdf#page=6
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- name: New Mexico is in west region.
period: 2024
input:
state_code_str: NM
output:
is_west_region: true

- name: California is in west region.
period: 2024
input:
state_code_str: CA
output:
is_west_region: true

- name: Massachusetts is not in west region.
period: 2024
input:
state_code_str: MA
output:
is_west_region: false
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ def formula(spm_unit, period, parameters):
)
education_expense = add(
spm_unit, period, ["k12_tuition_and_fees"]
) ## no more than $189.58 per child
)
child_count = add(spm_unit,period,["is_child_dependent"])
p = parameters(period).gov.bankruptcy
education_expense_allowance = child_count * p.dependent_expense
adjust_education_expense = min_(education_expense,education_expense_allowance)

charitable_contributions = add(
spm_unit,
period,
Expand All @@ -33,7 +38,7 @@ def formula(spm_unit, period, parameters):
+ health_savings_account_expense
+ care_expense
+ home_energy_costs
+ education_expense
+ adjust_education_expense
+ charitable_contributions
)
return total / MONTHS_IN_YEAR
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,20 @@ def formula(spm_unit, period, parameters):
p.housing_and_utilities.insurance_and_operating[state][size]
)

mortgage_or_rent_allowance = p.housing_and_utilities.mortgage_or_rent[
state
][size]
mortgage_or_rent_allowance = (
p.housing_and_utilities.mortgage_or_rent[state][size]
)
monthly_housing_expense = (
add(spm_unit, period, ["housing_cost"]) / MONTHS_IN_YEAR
)
net_mortgage_or_rent_expense = max_(
mortgage_or_rent_allowance - monthly_housing_expense, 0
)

household_vehicles_owned = spm_unit.household(
"household_vehicles_owned", period
)
household_vehicles_owned_cap = min_(household_vehicles_owned, 2)
qualify_vehicles_owned = add(spm_unit,period,["is_vehicle_loaned"])
qualify_vehicles_owned_cap = min_(qualify_vehicles_owned, 2)
ownership_costs_allowance = p.vehicle_operation.ownership_costs[
household_vehicles_owned_cap
qualify_vehicles_owned_cap
]
vehicle_mortgage_expense = (
add(spm_unit, period, ["vehicle_mortgage_expense"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
class vehicle_mortgage_expense(Variable):
value_type = float
entity = Person
label = "Vehivle mortgage expense"
label = "Vehicle mortgage expense"
unit = USD
definition_period = YEAR
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class is_west_region(Variable):
reference = "https://www.irs.gov/businesses/small-businesses-self-employed/local-standards-transportation"

def formula(spm_unit, period, parameters):
state = spm_unit.household("state_code", period)
state_code = spm_unit.household("state_code_str", period)

p = parameters(
period
).gov.bankruptcy.local_standards.vehicle_operation.state_group

return np.isin(state, p.west)
return np.isin(state_code, p.west)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from policyengine_us.model_api import *


class is_vehicle_loaned(Variable):
value_type = bool
entity = Person
label = "Is the vehicel loaned or leased"
definition_period = YEAR

def formula(person, period, parameters):
return person("vehicle_mortgage_expense",period) > 0

0 comments on commit 6c19cef

Please sign in to comment.