Skip to content

Commit

Permalink
add test files
Browse files Browse the repository at this point in the history
  • Loading branch information
hua7450 authored Dec 20, 2024
1 parent d42c1cc commit ba25732
Show file tree
Hide file tree
Showing 19 changed files with 111 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +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: 2_275
2024-01-01: 189.58

metadata:
unit: currency-USD
period: year
period: month
label: Dependent children education expense per child
reference:
# The number $189.58 comes from line 28 of the form, multiply it by 12 and get the annual amount.
# The number $189.58 only appears in line 28 of the form.
- 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
Expand Up @@ -7,7 +7,7 @@ description: The IRS limits the ownership costs by the local standards to this a

metadata:
unit: currency-USD
period: year
period: month
label: Local standards of ownership costs
breakdown:
- list(range(1,3))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ values:

metadata:
unit: currency-USD
period: year
period: month
label: Local standards of public transportation amount
reference:
- title: Local standards -- Transportation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ NONE:

metadata:
unit: currency-USD
period: year
period: month
label: Local standards of operating costs amount
breakdown:
- midwest_county
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NONE:

metadata:
unit: currency-USD
period: year
period: month
label: Local standards of operating costs amount
breakdown:
- northeast_county
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ NONE:

metadata:
unit: currency-USD
period: year
period: month
label: Local standards of operating costs amount
breakdown:
- south_county
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ NONE:

metadata:
unit: currency-USD
period: year
period: month
label: Local standards of operating costs amount
breakdown:
- west_county
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- name: Case 1.
period: 2024
input:
irs_employment_income: 100
alimony_income: 100
child_support_received: 100
partnership_s_corp_income: 100
farm_income: 100
farm_rent_income: 100
rental_income: 100
dividend_income: 100
interest_income: 100
unemployment_compensation: 100
pension_income: 100
retirement_distributions: 100
output:
chapter_7_bankruptcy_adjust_monthly_income: 1_200
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: Case 1, have housing cost and vehile mortgage expense.
period: 2024-01
input:
health_insurance_premiums: 120
health_savings_account_payroll_contributions: 120
care_expenses: 0
k12_tuition_and_fees: 2_400
is_child_dependent: true
charitable_cash_donations: 0
charitable_non_cash_donations: 0
output:
chapter_7_bankruptcy_additonal_expenses_deductions: 209.58
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- name: Case 1, have housing cost and vehile mortgage expense.
period: 2024-01
input:
housing_cost: 120
vehicle_mortgage_expense: 0
output:
chapter_7_bankruptcy_debt_payment_deductions: 10

- name: Case 2, both expenses are 0.
period: 2024-01
input:
housing_cost: 0
vehicle_mortgage_expense: 0
output:
chapter_7_bankruptcy_debt_payment_deductions: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- name: Case 1, have housing cost and vehile mortgage expense.
period: 2024-01
input:
spm_unit_size: 3
state_code: CA
housing_cost: 22_800
has_a_vehicle_loan: true
vehicle_mortgage_expense: 7_200
public_transportation_expense: 230

output:
chapter_7_bankruptcy_local_standards_deductions: 978
# 716 + 28 + 19 + 215
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
- name: Case 1, medical expense higher than medical deductions.
period: 2024-01
input:
income_tax: 120
child_support_expense: 0
childcare_expenses: 0
chapter_7_bankruptcy_out_of_pocket_health_care_deduction: 100
medical_out_of_pocket_expenses: 220

output:
chapter_7_bankruptcy_other_necessary_expenses_deductions: 20

- name: Case 2, medical expense smaller than medical deductions.
period: 2024-01
input:
income_tax: 120
child_support_expense: 0
childcare_expenses: 0
chapter_7_bankruptcy_out_of_pocket_health_care_deduction: 100
medical_out_of_pocket_expenses: 20

output:
chapter_7_bankruptcy_other_necessary_expenses_deductions: 10

Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def formula(spm_unit, period, parameters):
spm_unit, period, ["farm_rent_income", "rental_income"]
)
interest_and_dividends_income = add(
spm_unit, period, ["divident_income", "interest_income"]
spm_unit, period, ["dividend_income", "interest_income"]
)
unemployment_compensation = add(
spm_unit, period, ["unemployment_compensation"]
)
pension_and_retirement_income = add(
spm_unit, period, ["pension_income", "retirement_distribution"]
spm_unit, period, ["pension_income", "retirement_distributions"]
)
total = (
employment_income
Expand All @@ -43,4 +43,4 @@ def formula(spm_unit, period, parameters):
+ unemployment_compensation
+ pension_and_retirement_income
)
return total / MONTHS_IN_YEAR
return total
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ class chapter_7_bankruptcy_nonpriority_unsecured_debt(Variable):
value_type = float
entity = SPMUnit
label = "Nonpriority unsecured debt"
definition_period = YEAR
definition_period = MONTH
reference = "https://www.cacb.uscourts.gov/sites/cacb/files/documents/forms/122A2.pdf#page=9"
documentation = "Line 41a in form 122A-2"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def formula(spm_unit, period, parameters):
spm_unit, period, ["health_savings_account_payroll_contributions"]
)

care_expense = add(spm_unit, period, ["care_expeses"])
care_expense = add(spm_unit, period, ["care_expenses"])
home_energy_costs = spm_unit.household(
"current_home_energy_use", period
)
Expand All @@ -33,12 +33,11 @@ def formula(spm_unit, period, parameters):
period,
["charitable_cash_donations", "charitable_non_cash_donations"],
)
total = (
return (
health_insurance_expense
+ health_savings_account_expense
+ care_expense
+ home_energy_costs
+ adjust_education_expense
+ charitable_contributions
)
return total / MONTHS_IN_YEAR
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ def formula(spm_unit, period, parameters):
vehicle_mortgage_expense = add(
spm_unit, period, ["vehicle_mortgage_expense"]
)
total = housing_expense + vehicle_mortgage_expense
return total / MONTHS_IN_YEAR
return housing_expense + vehicle_mortgage_expense
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,31 @@ def formula(spm_unit, period, parameters):
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
)
housing_expense = add(spm_unit, period, ["housing_cost"])
net_mortgage_or_rent_expense = max_(
mortgage_or_rent_allowance - monthly_housing_expense, 0
mortgage_or_rent_allowance - housing_expense, 0
)

qualify_vehicles_owned = add(spm_unit, period, ["is_vehicle_loaned"])
qualify_vehicles_owned = add(spm_unit, period, ["has_a_vehicle_loan"])
qualify_vehicles_owned_cap = min_(
qualify_vehicles_owned, p.vehicle_operation.vehicles_owned_cap
)
ownership_costs_allowance = p.vehicle_operation.ownership_costs[
qualify_vehicles_owned_cap
]
vehicle_mortgage_expense = (
add(spm_unit, period, ["vehicle_mortgage_expense"])
/ MONTHS_IN_YEAR
vehicle_mortgage_expense = add(
spm_unit, period, ["vehicle_mortgage_expense"]
)

net_vehicle_ownership_expense = max_(
ownership_costs_allowance - vehicle_mortgage_expense, 0
)

public_transportation_allowance = (
p.vehicle_operation.public_transportation
)
public_transportation_expense = (
add(spm_unit, period, ["public_transportation_expense"])
/ MONTHS_IN_YEAR
public_transportation_expense = add(
spm_unit, period, ["public_transportation_expense"]
)

have_one_ore_more_vehicles = qualify_vehicles_owned >= 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def formula(spm_unit, period, parameters):
childcare_expenses = spm_unit("childcare_expenses", period)

out_of_pocket_healthcare_allowance = spm_unit(
"chapter_7_bankruptcy_out_of_pocket_health_care_deductions", period
"chapter_7_bankruptcy_out_of_pocket_health_care_deduction", period
)
out_of_pocket_healthcare_expense = add(
spm_unit, period, ["medical_out_of_pocket_expenses"]
Expand All @@ -28,10 +28,9 @@ def formula(spm_unit, period, parameters):
0,
)

total = (
return (
income_tax
+ child_support_expense
+ childcare_expenses
+ additional_health_care_expenses
)
return total / MONTHS_IN_YEAR
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def formula(spm_unit, period, parameters):

qualify_vehicles_owned = add(spm_unit, period, ["has_a_vehicle_loan"])
qualify_vehicles_owned_cap = min_(qualify_vehicles_owned, 2)
northeast = spm_unit("northeast_county", period)
midwest = spm_unit("midwest_county", period)
south = spm_unit("south_county", period)
west = spm_unit("west_county", period)
northeast = spm_unit.household("northeast_county", period)
midwest = spm_unit.household("midwest_county", period)
south = spm_unit.household("south_county", period)
west = spm_unit.household("west_county", period)
vehicle_operating_expense_northeast = p.northeast[northeast][
qualify_vehicles_owned_cap
]
Expand Down

0 comments on commit ba25732

Please sign in to comment.