diff --git a/policyengine_us/parameters/gov/bankruptcy/dependent_expense.yaml b/policyengine_us/parameters/gov/bankruptcy/dependent_expense.yaml index bfbf06e22f7..5760fb7e632 100644 --- a/policyengine_us/parameters/gov/bankruptcy/dependent_expense.yaml +++ b/policyengine_us/parameters/gov/bankruptcy/dependent_expense.yaml @@ -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 diff --git a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/ownership_costs.yaml b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/ownership_costs.yaml index 59ccd1887b7..9f29b8a52c8 100644 --- a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/ownership_costs.yaml +++ b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/ownership_costs.yaml @@ -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)) diff --git a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/public_transportation.yaml b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/public_transportation.yaml index 07848031ad2..98f56ec40ec 100644 --- a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/public_transportation.yaml +++ b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/public_transportation.yaml @@ -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 diff --git a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/midwest.yaml b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/midwest.yaml index a39b68944f4..d73363a9f15 100644 --- a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/midwest.yaml +++ b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/midwest.yaml @@ -38,7 +38,7 @@ NONE: metadata: unit: currency-USD - period: year + period: month label: Local standards of operating costs amount breakdown: - midwest_county diff --git a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/northeast.yaml b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/northeast.yaml index 35f79e30eda..80f3ca51f33 100644 --- a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/northeast.yaml +++ b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/northeast.yaml @@ -28,7 +28,7 @@ NONE: metadata: unit: currency-USD - period: year + period: month label: Local standards of operating costs amount breakdown: - northeast_county diff --git a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/south.yaml b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/south.yaml index b614bf05148..bc274030b91 100644 --- a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/south.yaml +++ b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/south.yaml @@ -48,7 +48,7 @@ NONE: metadata: unit: currency-USD - period: year + period: month label: Local standards of operating costs amount breakdown: - south_county diff --git a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/west.yaml b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/west.yaml index 4da0f399526..a3b1d603508 100644 --- a/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/west.yaml +++ b/policyengine_us/parameters/gov/bankruptcy/local_standards/vehicle_operation/region_operating_costs/west.yaml @@ -53,7 +53,7 @@ NONE: metadata: unit: currency-USD - period: year + period: month label: Local standards of operating costs amount breakdown: - west_county diff --git a/policyengine_us/tests/policy/baseline/gov/bankruptcy/chapter_7_bankruptcy_adjust_monthly_income.yaml b/policyengine_us/tests/policy/baseline/gov/bankruptcy/chapter_7_bankruptcy_adjust_monthly_income.yaml new file mode 100644 index 00000000000..a23dad776bd --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/bankruptcy/chapter_7_bankruptcy_adjust_monthly_income.yaml @@ -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 diff --git a/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_additonal_expenses_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_additonal_expenses_deductions.yaml new file mode 100644 index 00000000000..0433ecf48ac --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_additonal_expenses_deductions.yaml @@ -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 diff --git a/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_debt_payment_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_debt_payment_deductions.yaml new file mode 100644 index 00000000000..4841619ffdf --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_debt_payment_deductions.yaml @@ -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 diff --git a/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_local_standards_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_local_standards_deductions.yaml new file mode 100644 index 00000000000..4c83867eefe --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_local_standards_deductions.yaml @@ -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 diff --git a/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_other_necessary_expenses_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_other_necessary_expenses_deductions.yaml new file mode 100644 index 00000000000..89e5cac1b2a --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/bankruptcy/deductions/chapter_7_bankruptcy_other_necessary_expenses_deductions.yaml @@ -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 + diff --git a/policyengine_us/variables/gov/bankruptcy/chapter_7_bankruptcy_adjust_monthly_income.py b/policyengine_us/variables/gov/bankruptcy/chapter_7_bankruptcy_adjust_monthly_income.py index 2fee9e944bb..ac2c36612dc 100644 --- a/policyengine_us/variables/gov/bankruptcy/chapter_7_bankruptcy_adjust_monthly_income.py +++ b/policyengine_us/variables/gov/bankruptcy/chapter_7_bankruptcy_adjust_monthly_income.py @@ -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 @@ -43,4 +43,4 @@ def formula(spm_unit, period, parameters): + unemployment_compensation + pension_and_retirement_income ) - return total / MONTHS_IN_YEAR + return total diff --git a/policyengine_us/variables/gov/bankruptcy/chapter_7_bankruptcy_nonpriority_unsecured_debt.py b/policyengine_us/variables/gov/bankruptcy/chapter_7_bankruptcy_nonpriority_unsecured_debt.py index 295de300eee..dc861a22cc3 100644 --- a/policyengine_us/variables/gov/bankruptcy/chapter_7_bankruptcy_nonpriority_unsecured_debt.py +++ b/policyengine_us/variables/gov/bankruptcy/chapter_7_bankruptcy_nonpriority_unsecured_debt.py @@ -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" diff --git a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_additional_expense_deductions.py b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_additional_expense_deductions.py index ce151eabd4d..f352cbbdc0d 100644 --- a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_additional_expense_deductions.py +++ b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_additional_expense_deductions.py @@ -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 ) @@ -33,7 +33,7 @@ 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 @@ -41,4 +41,3 @@ def formula(spm_unit, period, parameters): + adjust_education_expense + charitable_contributions ) - return total / MONTHS_IN_YEAR diff --git a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_debt_payment_deductions.py b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_debt_payment_deductions.py index 499be68c203..ac5abc5a9e1 100644 --- a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_debt_payment_deductions.py +++ b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_debt_payment_deductions.py @@ -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 diff --git a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_local_standards_deductions.py b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_local_standards_deductions.py index af85150ff87..65caded19d8 100644 --- a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_local_standards_deductions.py +++ b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_local_standards_deductions.py @@ -20,24 +20,22 @@ 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 ) @@ -45,9 +43,8 @@ def formula(spm_unit, period, parameters): 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 diff --git a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_other_necessary_expenses_deductions.py b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_other_necessary_expenses_deductions.py index 9b1d2527f5a..4b0fef415cc 100644 --- a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_other_necessary_expenses_deductions.py +++ b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_other_necessary_expenses_deductions.py @@ -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"] @@ -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 diff --git a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_vehicle_operation_expense_deduction.py b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_vehicle_operation_expense_deduction.py index cd73acefd94..8f157c25c19 100644 --- a/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_vehicle_operation_expense_deduction.py +++ b/policyengine_us/variables/gov/bankruptcy/deductions/chapter_7_bankruptcy_vehicle_operation_expense_deduction.py @@ -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 ]