From 076348276a6ac4cd8e62c43571e6e365c467dfac Mon Sep 17 00:00:00 2001 From: Pavel Makarchuk <110687043+PavelMakarchuk@users.noreply.github.com> Date: Tue, 24 Dec 2024 13:42:09 -0500 Subject: [PATCH] Adjust the Illinois income tax before non-refundable credits variable format (#5393) --- changelog_entry.yaml | 4 ++ .../il_k12_education_expense_credit.yaml | 6 +-- .../credits/il_property_tax_credit.yaml | 4 +- .../gov/states/il/tax/income/integration.yaml | 53 +++++++++++++++++++ ...me_tax_before_non_refundable_credits.yaml} | 6 +-- ..._income_tax_before_refundable_credits.yaml | 6 +-- .../il_k12_education_expense_credit.py | 2 +- .../income/credits/il_property_tax_credit.py | 2 +- ...come_tax_before_non_refundable_credits.py} | 2 +- ...il_income_tax_before_refundable_credits.py | 2 +- 10 files changed, 72 insertions(+), 15 deletions(-) create mode 100644 policyengine_us/tests/policy/baseline/gov/states/il/tax/income/integration.yaml rename policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/{il_income_tax_before_nonrefundable_credits.yaml => il_income_tax_before_non_refundable_credits.yaml} (65%) rename policyengine_us/variables/gov/states/il/tax/income/{il_income_tax_before_nonrefundable_credits.py => il_income_tax_before_non_refundable_credits.py} (90%) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb2d..b63548f8b97 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Illinois income tax before non-refundable credits variable format. diff --git a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/credits/il_k12_education_expense_credit.yaml b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/credits/il_k12_education_expense_credit.yaml index a23073c6e7a..b40922419b8 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/credits/il_k12_education_expense_credit.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/credits/il_k12_education_expense_credit.yaml @@ -3,7 +3,7 @@ input: age: 30 k12_tuition_and_fees: 10_000 - il_income_tax_before_nonrefundable_credits: 10_000 + il_income_tax_before_non_refundable_credits: 10_000 il_property_tax_credit: 5_000 state_code: IL output: @@ -14,7 +14,7 @@ input: age: 30 k12_tuition_and_fees: 10_000 - il_income_tax_before_nonrefundable_credits: 10_000 + il_income_tax_before_non_refundable_credits: 10_000 il_property_tax_credit: 9_750 state_code: IL output: @@ -25,7 +25,7 @@ input: age: 30 k12_tuition_and_fees: 2_250 - il_income_tax_before_nonrefundable_credits: 100_000 + il_income_tax_before_non_refundable_credits: 100_000 il_property_tax_credit: 2_000 state_code: IL output: diff --git a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/credits/il_property_tax_credit.yaml b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/credits/il_property_tax_credit.yaml index 75c0909a81d..9069278632c 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/credits/il_property_tax_credit.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/credits/il_property_tax_credit.yaml @@ -8,7 +8,7 @@ tax_units: tax_unit: members: [person1] - il_income_tax_before_nonrefundable_credits: 10_000 + il_income_tax_before_non_refundable_credits: 10_000 households: household: members: [person1] @@ -26,7 +26,7 @@ tax_units: tax_unit: members: [person1] - il_income_tax_before_nonrefundable_credits: 10_000 + il_income_tax_before_non_refundable_credits: 10_000 households: household: members: [person1] diff --git a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/integration.yaml b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/integration.yaml new file mode 100644 index 00000000000..7b18468c0f5 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/integration.yaml @@ -0,0 +1,53 @@ +- name: Single person with high income + absolute_error_margin: 5 + period: '2023' + input: + people: + person1: + age: 40 + employment_income: 1_000_001.0 + ssi: 0 + state_supplement: 0 + wic: 0 + tax_units: + tax_unit: + members: [person1] + tax_unit_childcare_expenses: 0 + premium_tax_credit: 0 + local_income_tax: 0 + state_sales_tax: 0 + il_use_tax: 0 + spm_units: + spm_unit: + members: [person1] + snap: 0 + tanf: 0 + households: + household: + members: [person1] + state_fips: 17 + output: + income_tax: 325207.5 + il_income_tax: 49500.0 + taxsim_tfica: 31632.400390625 + adjusted_gross_income: 1000000.0 + tax_unit_taxable_unemployment_compensation: 0.0 + tax_unit_taxable_social_security: 0.0 + standard_deduction: 13850.0 + exemptions: 0.0 + taxable_income_deductions_if_itemizing: 10000.0 + taxable_income: 986150.0 + income_tax_main_rates: 325207.5 + ctc: 0.0 + refundable_ctc: 0.0 + cdcc: 0.0 + eitc: 0.0 + amt_income: 1000000.0 + alternative_minimum_tax: 0.0 + qualified_business_income_deduction: 0.0 + il_taxable_income: 1000000.0 + il_property_tax_credit: 0.0 + il_eitc: 0.0 + il_ctc: 0.0 + net_investment_income_tax: 0.0 + recovery_rebate_credit: 0.0 diff --git a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_nonrefundable_credits.yaml b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_non_refundable_credits.yaml similarity index 65% rename from policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_nonrefundable_credits.yaml rename to policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_non_refundable_credits.yaml index 153f8d4964a..8de72030711 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_nonrefundable_credits.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_non_refundable_credits.yaml @@ -5,7 +5,7 @@ il_taxable_income: 1204985 state_code: IL output: - il_income_tax_before_nonrefundable_credits: (1204985 * 0.0495) + 12345 + il_income_tax_before_non_refundable_credits: (1204985 * 0.0495) + 12345 - name: "Test #2" period: 2021 input: @@ -13,7 +13,7 @@ il_taxable_income: 259082 state_code: IL output: - il_income_tax_before_nonrefundable_credits: (259082 * 0.0495) + 19034 + il_income_tax_before_non_refundable_credits: (259082 * 0.0495) + 19034 - name: "Test #3" period: 2021 input: @@ -21,4 +21,4 @@ il_taxable_income: 2843756 state_code: IL output: - il_income_tax_before_nonrefundable_credits: (2843756 * 0.0495) + 34598 + il_income_tax_before_non_refundable_credits: (2843756 * 0.0495) + 34598 diff --git a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_refundable_credits.yaml b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_refundable_credits.yaml index 3ee22f1f11c..fb4ff7f152d 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_refundable_credits.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/il/tax/income/taxes/il_income_tax_before_refundable_credits.yaml @@ -1,7 +1,7 @@ - name: "Test #1" period: 2021 input: - il_income_tax_before_nonrefundable_credits: 12983 + il_income_tax_before_non_refundable_credits: 12983 il_nonrefundable_credits: 1234 state_code: IL output: @@ -9,7 +9,7 @@ - name: "Test #2" period: 2021 input: - il_income_tax_before_nonrefundable_credits: 87235 + il_income_tax_before_non_refundable_credits: 87235 il_nonrefundable_credits: 1287 state_code: IL output: @@ -17,7 +17,7 @@ - name: "Test #3" period: 2021 input: - il_income_tax_before_nonrefundable_credits: 1498124 + il_income_tax_before_non_refundable_credits: 1498124 il_nonrefundable_credits: 345892 state_code: IL output: diff --git a/policyengine_us/variables/gov/states/il/tax/income/credits/il_k12_education_expense_credit.py b/policyengine_us/variables/gov/states/il/tax/income/credits/il_k12_education_expense_credit.py index 688fbd99646..e974066033c 100644 --- a/policyengine_us/variables/gov/states/il/tax/income/credits/il_k12_education_expense_credit.py +++ b/policyengine_us/variables/gov/states/il/tax/income/credits/il_k12_education_expense_credit.py @@ -16,7 +16,7 @@ def formula(tax_unit, period, parameters): reduced_tuition_and_fees = max_(0, tuition_and_fees - p.reduction) k12_credit = min_(reduced_tuition_and_fees * p.rate, p.cap) pre_credit_tax = tax_unit( - "il_income_tax_before_nonrefundable_credits", period + "il_income_tax_before_non_refundable_credits", period ) il_property_tax_credit = tax_unit("il_property_tax_credit", period) avail_tax = max_(0, pre_credit_tax - il_property_tax_credit) diff --git a/policyengine_us/variables/gov/states/il/tax/income/credits/il_property_tax_credit.py b/policyengine_us/variables/gov/states/il/tax/income/credits/il_property_tax_credit.py index 81547ca73c4..0b020880b7c 100644 --- a/policyengine_us/variables/gov/states/il/tax/income/credits/il_property_tax_credit.py +++ b/policyengine_us/variables/gov/states/il/tax/income/credits/il_property_tax_credit.py @@ -13,7 +13,7 @@ class il_property_tax_credit(Variable): def formula(tax_unit, period, parameters): ptax_paid = add(tax_unit, period, ["real_estate_taxes"]) pre_credit_tax = tax_unit( - "il_income_tax_before_nonrefundable_credits", period + "il_income_tax_before_non_refundable_credits", period ) p = parameters(period).gov.states.il.tax.income.credits return min_(ptax_paid * p.property_tax.rate, pre_credit_tax) diff --git a/policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_nonrefundable_credits.py b/policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_non_refundable_credits.py similarity index 90% rename from policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_nonrefundable_credits.py rename to policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_non_refundable_credits.py index a9dbc7a4daa..aa1ac80d1cb 100644 --- a/policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_nonrefundable_credits.py +++ b/policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_non_refundable_credits.py @@ -1,7 +1,7 @@ from policyengine_us.model_api import * -class il_income_tax_before_nonrefundable_credits(Variable): +class il_income_tax_before_non_refundable_credits(Variable): value_type = float entity = TaxUnit label = "IL income tax before credits" diff --git a/policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_refundable_credits.py b/policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_refundable_credits.py index cfffa62aeb8..dab87904509 100644 --- a/policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_refundable_credits.py +++ b/policyengine_us/variables/gov/states/il/tax/income/il_income_tax_before_refundable_credits.py @@ -11,6 +11,6 @@ class il_income_tax_before_refundable_credits(Variable): defined_for = StateCode.IL def formula(tax_unit, period, parameters): - taxbc = tax_unit("il_income_tax_before_nonrefundable_credits", period) + taxbc = tax_unit("il_income_tax_before_non_refundable_credits", period) non_refundable_credits = tax_unit("il_nonrefundable_credits", period) return max_(taxbc - non_refundable_credits, 0)