From 63ab73b0338279c293996542974e9d9fdb00febd Mon Sep 17 00:00:00 2001 From: Austin Francis Date: Thu, 21 Sep 2023 16:36:41 -0600 Subject: [PATCH 01/29] fixed filing status errors --- .../gov/states/va/tax/income/calc_line_14.py | 4 ++-- .../va_tax_credit_for_low_income_individuals.py | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py index 0f98a4cca..e8718bf48 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py @@ -14,12 +14,12 @@ def formula(tax_unit, period, parameters): filing_status = tax_unit("filing_status", period) - if filing_status == 1: + if filing_status == 0: va_standard_deduction = parameters( period ).gov.states.va.tax.income.va_standard_deduction.SINGLE - if filing_status == 2: + if filing_status == 1: va_standard_deduction = parameters( period ).gov.states.va.tax.income.va_standard_deduction.JOINT diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py index 8706d3f8e..acd9e0a4f 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py @@ -18,13 +18,16 @@ def formula(tax_unit, period, parameters): net_tax = tax_unit("va_income_tax_before_refundable_credits", period) - if filing_status == 1: + if filing_status == 3: + spouse_if_filing_jointly = 0 - elif filing_status == 2: - spouse_if_filing_jointly = 1 + elif filing_status == 1: + + spouse_if_filing_jointly = 1 + + else: - else: spouse_if_filing_jointly = 0 spouse_agi = tax_unit("spouse_separate_adjusted_gross_income", period) From 955d37f7dafaf403777b185a5c916b1bb3f655aa Mon Sep 17 00:00:00 2001 From: Austin Francis Date: Thu, 21 Sep 2023 23:05:30 -0600 Subject: [PATCH 02/29] fixed more filing status errors --- .../gov/states/va/tax/income/calc_line_14.py | 5 +++-- .../va/tax/income/va_adj_gross_income.py | 4 ++-- .../states/va/tax/income/va_age_deduction.py | 18 +++++++++--------- .../gov/states/va/tax/income/va_exemptions.py | 4 ++-- .../va/tax/income/va_standard_deduction.py | 4 ++-- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py index e8718bf48..a47c9a09c 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py @@ -13,8 +13,9 @@ def formula(tax_unit, period, parameters): # line_11 = tax_unit("va_standard_deduction",period) filing_status = tax_unit("filing_status", period) - - if filing_status == 0: + + # for single, head of household, widow filing status + if filing_status == 0 or filing_status == 2 or filing_status == 4: va_standard_deduction = parameters( period ).gov.states.va.tax.income.va_standard_deduction.SINGLE diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py index ecd4e08fd..be04036d6 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py @@ -24,13 +24,13 @@ def formula(tax_unit, period, parameters): subtotal = line3 - line8 - if filing_status == 1 or filing_status == 3: + if filing_status == 0 or filing_status == 2 or filing_status == 4 or filing_status == 2: if subtotal < single: tax_owed = 0 return tax_owed - if filing_status == 2: + if filing_status == 1: if subtotal < joint: tax_owed = 0 diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py index 7e8f90e06..4d3f71d31 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py @@ -29,25 +29,25 @@ def formula(tax_unit, period, parameters): spouse_fdcs = 0 # change this if age_of_head > 65: - if filing_status == 1: + if filing_status == 0 or filing_status == 2 or filing_status == 4: age_deduction_count = 1 - if filing_status == 2 & age_of_spouse > 65: + if (filing_status == 1 or filing_status == 3) & age_of_spouse > 65: age_deduction_count = 2 - if filing_status == 1: + if filing_status == 0 or filing_status == 2 or filing_status == 4: total_agi = federal_agi else: total_agi = federal_agi + spouse_agi - if filing_status == 1: + if filing_status == 0 or filing_status == 2 or filing_status == 4: total_fda = you_fdca else: total_fda = you_fdca + spouse_fdca - if filing_status == 1: + if filing_status == 0 or filing_status == 2 or filing_status == 4: total_fds = you_fdcs else: @@ -61,12 +61,12 @@ def formula(tax_unit, period, parameters): line8 = line6 - line7 - if filing_status == 1: + if filing_status == 0 or filing_status == 2 or filing_status == 4: threshold_ln9 = ( parameters.gov.states.va.tax.income.va_age_deduction_threshold.single ) - if filing_status == 2: + if filing_status == 1: threshold_ln9 = ( parameters.gov.states.va.tax.income.va_age_deduction_threshold.joint ) @@ -87,8 +87,8 @@ def formula(tax_unit, period, parameters): if line11 < line12: line14 = line12 - line11 - if filing_status == 1 or filing_status == 2: + if filing_status == 0 or filing_status == 2 or filing_status == 4 or filing_status == 1: return line14 - if filing_status == 3: + if filing_status == 3 and age_of_spouse >= 65: return line14 / 2 diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py index 254137527..11e95823c 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py @@ -27,10 +27,10 @@ def formula(tax_unit, period, parameters): filing_status = tax_unit("filing_status", period) - if filing_status == 1: + if filing_status == 0 or filing_status == 2 or filing_status == 4: spouse_if_filing_jointly = 0 - elif filing_status == 2: + elif filing_status == 1: spouse_if_filing_jointly = 1 else: diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py index 3afff085a..358447ded 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py @@ -12,12 +12,12 @@ class va_standard_deduction(Variable): def formula(tax_unit, period, parameters): filing_status = tax_unit("filing_status", period) - if filing_status == 1: + if filing_status == 0 or filing_status == 2 or filing_status == 4: standard_deduction = ( parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE ) - if filing_status == 2: + if filing_status == 1: standard_deduction = ( parameters.gov.states.va.tax.income.va_standard_deduction.JOINT ) From 2ac33911422d6652acb2a623c884032a6c970f69 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 21 Sep 2023 23:38:08 -0600 Subject: [PATCH 03/29] Black formatted files --- .../variables/gov/states/va/tax/income/calc_line_14.py | 2 +- .../gov/states/va/tax/income/va_adj_gross_income.py | 7 ++++++- .../gov/states/va/tax/income/va_age_deduction.py | 7 ++++++- .../income/va_tax_credit_for_low_income_individuals.py | 9 +++------ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py index a47c9a09c..ee26cf61d 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py @@ -13,7 +13,7 @@ def formula(tax_unit, period, parameters): # line_11 = tax_unit("va_standard_deduction",period) filing_status = tax_unit("filing_status", period) - + # for single, head of household, widow filing status if filing_status == 0 or filing_status == 2 or filing_status == 4: va_standard_deduction = parameters( diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py index be04036d6..af42c7027 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py @@ -24,7 +24,12 @@ def formula(tax_unit, period, parameters): subtotal = line3 - line8 - if filing_status == 0 or filing_status == 2 or filing_status == 4 or filing_status == 2: + if ( + filing_status == 0 + or filing_status == 2 + or filing_status == 4 + or filing_status == 2 + ): if subtotal < single: tax_owed = 0 diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py index 4d3f71d31..4ee4f671e 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py @@ -87,7 +87,12 @@ def formula(tax_unit, period, parameters): if line11 < line12: line14 = line12 - line11 - if filing_status == 0 or filing_status == 2 or filing_status == 4 or filing_status == 1: + if ( + filing_status == 0 + or filing_status == 2 + or filing_status == 4 + or filing_status == 1 + ): return line14 if filing_status == 3 and age_of_spouse >= 65: diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py index acd9e0a4f..08e113fe9 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py @@ -19,15 +19,12 @@ def formula(tax_unit, period, parameters): net_tax = tax_unit("va_income_tax_before_refundable_credits", period) if filing_status == 3: - spouse_if_filing_jointly = 0 - elif filing_status == 1: - - spouse_if_filing_jointly = 1 - - else: + elif filing_status == 1: + spouse_if_filing_jointly = 1 + else: spouse_if_filing_jointly = 0 spouse_agi = tax_unit("spouse_separate_adjusted_gross_income", period) From 35f0f7f17d0db81344fd3d5ec4aaaf4de8e98fd7 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 21 Sep 2023 23:39:04 -0600 Subject: [PATCH 04/29] Updated version in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6dcb44f7d..ea07f84b4 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="fiscalsim-us", - version="0.1.5", + version="0.1.6", author="Center for Growth and Opportunity at Utah State University (CGO)", author_email="fiscalsim@thecgo.org", long_description=readme, From c4e505ac5d5186b7685588ce5fa32d9bb760d004 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Thu, 21 Sep 2023 23:42:57 -0600 Subject: [PATCH 05/29] Updated changelog files --- CHANGELOG.md | 10 ++++++++++ changelog.yaml | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ca3947a5..7c1c2f3c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.6] - 2023-09-22 12:00:00 + +### Added + +- Updated Virginia tax logic with correct mapping from federal filing status to state filing status. + ## [0.1.5] - 2023-09-20 17:00:00 ### Added @@ -145,6 +151,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +[0.1.6]: https://github.com/TheCGO/fiscalsim-us/compare/0.1.5...0.1.6 +[0.1.5]: https://github.com/TheCGO/fiscalsim-us/compare/0.1.4...0.1.5 +[0.1.4]: https://github.com/TheCGO/fiscalsim-us/compare/0.1.3...0.1.4 +[0.1.3]: https://github.com/TheCGO/fiscalsim-us/compare/0.1.2...0.1.3 [0.1.2]: https://github.com/TheCGO/fiscalsim-us/compare/0.1.1...0.1.2 [0.1.1]: https://github.com/TheCGO/fiscalsim-us/compare/0.1.0...0.1.1 [0.1.0]: https://github.com/TheCGO/fiscalsim-us/compare/0.0.12...0.1.0 diff --git a/changelog.yaml b/changelog.yaml index 6a3e6d996..3ebfeb228 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -134,3 +134,8 @@ added: - Updated `README.md` and its badges. date: 2023-09-20 17:00:00 +- bump: patch + changes: + added: + - Updated Virginia tax logic with correct mapping from federal filing status to state filing status. + date: 2023-09-22 12:00:00 From b5fd19f9775c30815d8e225b0b97daa7533ef627 Mon Sep 17 00:00:00 2001 From: austinperryfrancis <83978656+austinperryfrancis@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:22:34 -0600 Subject: [PATCH 06/29] Update va_adj_gross_income.py --- .../variables/gov/states/va/tax/income/va_adj_gross_income.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py index af42c7027..24a781503 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py @@ -28,7 +28,7 @@ def formula(tax_unit, period, parameters): filing_status == 0 or filing_status == 2 or filing_status == 4 - or filing_status == 2 + or filing_status == 3 ): if subtotal < single: tax_owed = 0 From b4051b9708b1b4ca80602118c0f3cef900f8b48b Mon Sep 17 00:00:00 2001 From: Austin Francis Date: Wed, 27 Sep 2023 22:39:25 -0600 Subject: [PATCH 07/29] updated age deduction and reformatted filing status references --- .../gov/states/va/tax/income/calc_line_14.py | 13 ++- .../tax/income/va_additions_to_federal_agi.py | 3 +- .../va/tax/income/va_adj_gross_income.py | 14 +-- .../states/va/tax/income/va_age_deduction.py | 85 ++++++++++--------- .../states/va/tax/income/va_calc_line_3.py | 4 +- .../states/va/tax/income/va_calc_line_8.py | 4 +- .../gov/states/va/tax/income/va_exemptions.py | 15 ++-- ...va_income_tax_before_refundable_credits.py | 22 ----- .../va/tax/income/va_refundable_credits.py | 10 +-- .../va/tax/income/va_standard_deduction.py | 11 ++- ...a_tax_credit_for_low_income_individuals.py | 24 +++--- 11 files changed, 98 insertions(+), 107 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py index a47c9a09c..2cfd01e75 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py @@ -13,19 +13,24 @@ def formula(tax_unit, period, parameters): # line_11 = tax_unit("va_standard_deduction",period) filing_status = tax_unit("filing_status", period) - + filing_statuses = filing_status.possible_values + # for single, head of household, widow filing status - if filing_status == 0 or filing_status == 2 or filing_status == 4: + if ( + filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.WIDOW + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + ): va_standard_deduction = parameters( period ).gov.states.va.tax.income.va_standard_deduction.SINGLE - if filing_status == 1: + if filing_status == filing_statuses.JOINT: va_standard_deduction = parameters( period ).gov.states.va.tax.income.va_standard_deduction.JOINT - if filing_status == 3: + if filing_status == filing_statuses.SEPARATE: va_standard_deduction = parameters( period ).gov.states.va.tax.income.va_standard_deduction.SEPARATE diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py index 76ab4bc78..9341efd6a 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py @@ -19,8 +19,7 @@ def formula(tax_unit, period, parameters): ) additions_to_fed_agi = ( - income_from_obligations_fed_exempt - + fixed_date_conformity_additions + income_from_obligations_fed_exempt + fixed_date_conformity_additions ) return additions_to_fed_agi diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py index be04036d6..a04ff5947 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py @@ -15,22 +15,26 @@ def formula(tax_unit, period, parameters): line8 = tax_unit("va_calc_line_8", period) filing_status = tax_unit("filing_status", period) + filing_statuses = filing_status.possible_values - threshold = parameters( - period - ).gov.states.va.tax.income.va_adjusted_gross_income + threshold = parameters(period).gov.states.va.tax.income.va_adjusted_gross_income single = threshold.SINGLE joint = threshold.JOINT subtotal = line3 - line8 - if filing_status == 0 or filing_status == 2 or filing_status == 4 or filing_status == 2: + if ( + filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.SEPARATE + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + or filing_status == filing_statuses.WIDOW + ): if subtotal < single: tax_owed = 0 return tax_owed - if filing_status == 1: + if filing_status == filing_statuses.JOINT: if subtotal < joint: tax_owed = 0 diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py index 4d3f71d31..8f44ce614 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py @@ -11,84 +11,93 @@ class va_age_deduction(Variable): def formula(tax_unit, period, parameters): age_of_head = tax_unit("age_head", period) - age_of_spouse = tax_unit("age_spouse", period) - filing_status = tax_unit("filing_status", period) - + filing_statuses = filing_status.possible_values federal_agi = tax_unit("adjusted_gross_income", period) - spouse_agi = tax_unit("spouse_separate_adjusted_gross_income", period) - you_fdca = tax_unit("fixed_date_conformity_additions", period) - spouse_fdca = 0 # change this - you_fdcs = tax_unit("fixed_date_conformity_subtractions", period) - spouse_fdcs = 0 # change this - if age_of_head > 65: - if filing_status == 0 or filing_status == 2 or filing_status == 4: + if ( + filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + or filing_status == filing_status == filing_statuses.WIDOW + ): age_deduction_count = 1 - - if (filing_status == 1 or filing_status == 3) & age_of_spouse > 65: - age_deduction_count = 2 - - if filing_status == 0 or filing_status == 2 or filing_status == 4: total_agi = federal_agi - + elif ( + filing_status == filing_statuses.JOINT + or filing_status == filing_statuses.SEPARATE + ) & age_of_spouse > 65: + age_deduction_count = 2 else: total_agi = federal_agi + spouse_agi - if filing_status == 0 or filing_status == 2 or filing_status == 4: + if ( + filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + or filing_status == filing_statuses.WIDOW + ): total_fda = you_fdca - - else: - total_fda = you_fdca + spouse_fdca - - if filing_status == 0 or filing_status == 2 or filing_status == 4: total_fds = you_fdcs - else: + total_fda = you_fdca + spouse_fdca total_fds = you_fdcs + spouse_fdcs line4 = total_agi + total_fda - line6 = line4 - total_fds - line7 = 0 # Taxable benefits from the tax return, change this. - line8 = line6 - line7 - if filing_status == 0 or filing_status == 2 or filing_status == 4: + if ( + filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + or filing_status == filing_statuses.WIDOW + ): threshold_ln9 = ( parameters.gov.states.va.tax.income.va_age_deduction_threshold.single ) - - if filing_status == 1: + elif filing_status == filing_statuses.JOINT: threshold_ln9 = ( parameters.gov.states.va.tax.income.va_age_deduction_threshold.joint ) - - if filing_status == 3: + elif filing_status == filing_statuses.SEPARATE: threshold_ln9 = ( parameters.gov.states.va.tax.income.va_age_deduction_threshold.separate ) - if line8 > threshold_ln9: + if line8 >= threshold_ln9: line11 = line8 - threshold_ln9 + elif ( + filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + or filing_status == filing_statuses.WIDOW + or filing_status == filing_statuses.SEPARATE + ): + return 12_000 + elif filing_status == filing_statuses.JOINT: + return 24_000 - line12 = age_deduction_count * 12000 + line12 = age_deduction_count * 12_000 - if line11 > line12: - final_age_deduction = 0 + if line11 >= line12: + return 0 if line11 < line12: line14 = line12 - line11 - if filing_status == 0 or filing_status == 2 or filing_status == 4 or filing_status == 1: + if ( + filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + or filing_status == filing_statuses.WIDOW + or (filing_status == filing_statuses.SEPARATE and age_of_spouse < 65) + or ( + filing_status == filing_statuses.JOINT and age_of_spouse < 65 + ) # the form has you divide the total by 2, but then if your filing jointly, you'd have to add it back together, so it ends up being the undivided amount + ): return line14 - - if filing_status == 3 and age_of_spouse >= 65: + elif filing_status == filing_statuses.SEPARATE and age_of_spouse >= 65: return line14 / 2 diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_3.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_3.py index 9c4aa1181..adfe4538b 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_3.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_3.py @@ -12,8 +12,6 @@ class va_calc_line_3(Variable): def formula(tax_unit, period, parameters): federal_agi = tax_unit("adjusted_gross_income", period) - additions_to_federal_agi = tax_unit( - "va_additions_to_federal_agi", period - ) + additions_to_federal_agi = tax_unit("va_additions_to_federal_agi", period) return federal_agi + additions_to_federal_agi diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_8.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_8.py index 1f3bea037..5d6ce8cac 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_8.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_8.py @@ -12,8 +12,6 @@ class va_calc_line_8(Variable): def formula(tax_unit, period, parameters): age_deduction = tax_unit("va_age_deduction", period) - subtractions_to_federal_agi = tax_unit( - "va_subtractions_to_federal_agi", period - ) + subtractions_to_federal_agi = tax_unit("va_subtractions_to_federal_agi", period) return age_deduction + subtractions_to_federal_agi diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py index 11e95823c..5b69f55fd 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py @@ -26,16 +26,19 @@ def formula(tax_unit, period, parameters): dependents = tax_unit("tax_unit_dependents", period) filing_status = tax_unit("filing_status", period) - - if filing_status == 0 or filing_status == 2 or filing_status == 4: + filing_statuses = filing_status.possible_values + + if ( + filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + or filing_status == filing_statuses.WIDOW + or filing_status == filing_statuses.SEPARATE + ): spouse_if_filing_jointly = 0 - elif filing_status == 1: + elif filing_status == filing_statuses.JOINT: spouse_if_filing_jointly = 1 - else: - spouse_if_filing_jointly = 0 - you_p65 = (tax_unit("age_head", period) >= 65).astype(int) spouse_p65 = (tax_unit("age_spouse", period) >= 65).astype( diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py index fa485e0dc..24907d1de 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py @@ -17,28 +17,6 @@ def formula(tax_unit, period, parameters): if taxable_inc > 0: net_tax = rates.calc(taxable_inc) - # if taxable_inc < 3000: - - # net_tax = taxable_inc * .02 - - # if taxable_inc > 3000 and taxable_inc < 5000: - - # excess_taxable = taxable_inc - 3000 - - # net_tax = (excess_taxable * .03) + 60 - - # if taxable_inc > 5000 and taxable_inc < 17000: - - # excess_taxable = taxable_inc - 5000 - - # net_tax = (excess_taxable * .05) + 120 - - # if taxable_inc > 17000: - - # excess_taxable = taxable_inc - 17000 - - # net_tax = (excess_taxable * .0575) + 720 - else: net_tax = 0 diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_refundable_credits.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_refundable_credits.py index 2bc3d1591..c6aef5e5a 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_refundable_credits.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_refundable_credits.py @@ -27,12 +27,4 @@ def formula(tax_unit, period, parameters): line_24 = tax_unit("va_credits_from_enclosed_schedule_cr", period) - return ( - line_19 - + line_19b - + line_20 - + line_21 - + line_22 - + line_24 - + line_23 - ) + return line_19 + line_19b + line_20 + line_21 + line_22 + line_24 + line_23 diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py index 358447ded..425d665c6 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py @@ -11,18 +11,23 @@ class va_standard_deduction(Variable): def formula(tax_unit, period, parameters): filing_status = tax_unit("filing_status", period) + filing_statuses = filing_status.possible_values - if filing_status == 0 or filing_status == 2 or filing_status == 4: + if ( + filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + or filing_status == filing_statuses.WIDOW + ): standard_deduction = ( parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE ) - if filing_status == 1: + if filing_status == filing_statuses.JOINT: standard_deduction = ( parameters.gov.states.va.tax.income.va_standard_deduction.JOINT ) - if filing_status == 3: + if filing_status == filing_statuses.SEPARATE: standard_deduction = ( parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE ) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py index acd9e0a4f..3f994bd03 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py @@ -13,22 +13,22 @@ def formula(tax_unit, period, parameters): agi = tax_unit("va_adj_gross_income", period) filing_status = tax_unit("filing_status", period) + filing_statuses = filing_status.possible_values fed_eitc = tax_unit("earned_income_tax_credit", period) net_tax = tax_unit("va_income_tax_before_refundable_credits", period) - if filing_status == 3: - + if ( + filing_status == filing_statuses.SEPARATE + or filing_status == filing_statuses.SINGLE + or filing_status == filing_statuses.WIDOW + or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD + ): spouse_if_filing_jointly = 0 - elif filing_status == 1: - - spouse_if_filing_jointly = 1 - - else: - - spouse_if_filing_jointly = 0 + elif filing_status == filing_statuses.JOINT: + spouse_if_filing_jointly = 1 spouse_agi = tax_unit("spouse_separate_adjusted_gross_income", period) @@ -42,9 +42,9 @@ def formula(tax_unit, period, parameters): # logic to determine if the person qualifies for the EITC - threshold = parameters( - period - ).gov.states.va.tax.income.va_eitc_threshold.calc(total_num_exemptions) + threshold = parameters(period).gov.states.va.tax.income.va_eitc_threshold.calc( + total_num_exemptions + ) # threshold = 12880 + (4540*(total_num_exemptions-1)) From 8a1d4f8537807534a8ccbda5981eeab1e938262f Mon Sep 17 00:00:00 2001 From: Austin Francis Date: Tue, 10 Oct 2023 16:51:55 -0600 Subject: [PATCH 08/29] formatted files --- .../va/tax/income/va_additions_to_federal_agi.py | 3 ++- .../gov/states/va/tax/income/va_adj_gross_income.py | 4 +++- .../gov/states/va/tax/income/va_age_deduction.py | 13 ++++++++++--- .../gov/states/va/tax/income/va_calc_line_3.py | 4 +++- .../gov/states/va/tax/income/va_calc_line_8.py | 4 +++- .../states/va/tax/income/va_refundable_credits.py | 10 +++++++++- .../va_tax_credit_for_low_income_individuals.py | 6 +++--- 7 files changed, 33 insertions(+), 11 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py index 9341efd6a..76ab4bc78 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py @@ -19,7 +19,8 @@ def formula(tax_unit, period, parameters): ) additions_to_fed_agi = ( - income_from_obligations_fed_exempt + fixed_date_conformity_additions + income_from_obligations_fed_exempt + + fixed_date_conformity_additions ) return additions_to_fed_agi diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py index a04ff5947..63efac741 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py @@ -17,7 +17,9 @@ def formula(tax_unit, period, parameters): filing_status = tax_unit("filing_status", period) filing_statuses = filing_status.possible_values - threshold = parameters(period).gov.states.va.tax.income.va_adjusted_gross_income + threshold = parameters( + period + ).gov.states.va.tax.income.va_adjusted_gross_income single = threshold.SINGLE joint = threshold.JOINT diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py index 8f44ce614..b172c8198 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py @@ -93,11 +93,18 @@ def formula(tax_unit, period, parameters): filing_status == filing_statuses.SINGLE or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD or filing_status == filing_statuses.WIDOW - or (filing_status == filing_statuses.SEPARATE and age_of_spouse < 65) or ( - filing_status == filing_statuses.JOINT and age_of_spouse < 65 + filing_status == filing_statuses.SEPARATE + and age_of_spouse < 65 + ) + or ( + filing_status == filing_statuses.JOINT + and age_of_spouse < 65 ) # the form has you divide the total by 2, but then if your filing jointly, you'd have to add it back together, so it ends up being the undivided amount ): return line14 - elif filing_status == filing_statuses.SEPARATE and age_of_spouse >= 65: + elif ( + filing_status == filing_statuses.SEPARATE + and age_of_spouse >= 65 + ): return line14 / 2 diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_3.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_3.py index adfe4538b..9c4aa1181 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_3.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_3.py @@ -12,6 +12,8 @@ class va_calc_line_3(Variable): def formula(tax_unit, period, parameters): federal_agi = tax_unit("adjusted_gross_income", period) - additions_to_federal_agi = tax_unit("va_additions_to_federal_agi", period) + additions_to_federal_agi = tax_unit( + "va_additions_to_federal_agi", period + ) return federal_agi + additions_to_federal_agi diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_8.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_8.py index 5d6ce8cac..1f3bea037 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_8.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_8.py @@ -12,6 +12,8 @@ class va_calc_line_8(Variable): def formula(tax_unit, period, parameters): age_deduction = tax_unit("va_age_deduction", period) - subtractions_to_federal_agi = tax_unit("va_subtractions_to_federal_agi", period) + subtractions_to_federal_agi = tax_unit( + "va_subtractions_to_federal_agi", period + ) return age_deduction + subtractions_to_federal_agi diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_refundable_credits.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_refundable_credits.py index c6aef5e5a..2bc3d1591 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_refundable_credits.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_refundable_credits.py @@ -27,4 +27,12 @@ def formula(tax_unit, period, parameters): line_24 = tax_unit("va_credits_from_enclosed_schedule_cr", period) - return line_19 + line_19b + line_20 + line_21 + line_22 + line_24 + line_23 + return ( + line_19 + + line_19b + + line_20 + + line_21 + + line_22 + + line_24 + + line_23 + ) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py index 3f994bd03..0b19eaf55 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py @@ -42,9 +42,9 @@ def formula(tax_unit, period, parameters): # logic to determine if the person qualifies for the EITC - threshold = parameters(period).gov.states.va.tax.income.va_eitc_threshold.calc( - total_num_exemptions - ) + threshold = parameters( + period + ).gov.states.va.tax.income.va_eitc_threshold.calc(total_num_exemptions) # threshold = 12880 + (4540*(total_num_exemptions-1)) From b9f3f887af1c7d63b79b8d42727cbcdc7b5d93f7 Mon Sep 17 00:00:00 2001 From: Austin Francis Date: Tue, 10 Oct 2023 22:08:02 -0600 Subject: [PATCH 09/29] changed if statement to where statements to accomodate microsimulations --- .../gov/states/va/tax/income/calc_line_14.py | 37 ++-- .../va/tax/income/va_adj_gross_income.py | 39 ++-- .../states/va/tax/income/va_age_deduction.py | 184 +++++++++--------- .../gov/states/va/tax/income/va_exemptions.py | 50 ++--- .../gov/states/va/tax/income/va_income_tax.py | 11 +- ...va_income_tax_before_refundable_credits.py | 8 +- .../va/tax/income/va_standard_deduction.py | 27 +-- ...a_tax_credit_for_low_income_individuals.py | 66 ++----- 8 files changed, 170 insertions(+), 252 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py index 2cfd01e75..cef797b39 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py @@ -10,33 +10,28 @@ class calc_line_14(Variable): defined_for = StateCode.VA def formula(tax_unit, period, parameters): - # line_11 = tax_unit("va_standard_deduction",period) - filing_status = tax_unit("filing_status", period) filing_statuses = filing_status.possible_values - # for single, head of household, widow filing status - if ( - filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.WIDOW - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - ): - va_standard_deduction = parameters( - period - ).gov.states.va.tax.income.va_standard_deduction.SINGLE - - if filing_status == filing_statuses.JOINT: - va_standard_deduction = parameters( - period - ).gov.states.va.tax.income.va_standard_deduction.JOINT - - if filing_status == filing_statuses.SEPARATE: - va_standard_deduction = parameters( - period - ).gov.states.va.tax.income.va_standard_deduction.SEPARATE + va_standard_deduction = where( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.WIDOW) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD), + parameters(period).gov.states.va.tax.income.va_standard_deduction.SINGLE, + where( + filing_status == filing_statuses.JOINT, + parameters(period).gov.states.va.tax.income.va_standard_deduction.JOINT, + where( + filing_status == filing_statuses.SEPARATE, + parameters(period).gov.states.va.tax.income.va_standard_deduction.SEPARATE, + 0 # Default value if none of the conditions are met + ) + ) + ) line_12 = tax_unit("va_exemptions", period) subtotal = va_standard_deduction + line_12 return subtotal + diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py index 63efac741..4a3c0dfd4 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py @@ -11,37 +11,28 @@ class va_adj_gross_income(Variable): def formula(tax_unit, period, parameters): line3 = tax_unit("va_calc_line_3", period) - line8 = tax_unit("va_calc_line_8", period) - filing_status = tax_unit("filing_status", period) filing_statuses = filing_status.possible_values - threshold = parameters( - period - ).gov.states.va.tax.income.va_adjusted_gross_income + threshold = parameters(period).gov.states.va.tax.income.va_adjusted_gross_income single = threshold.SINGLE joint = threshold.JOINT subtotal = line3 - line8 - if ( - filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.SEPARATE - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - or filing_status == filing_statuses.WIDOW - ): - if subtotal < single: - tax_owed = 0 - - return tax_owed - - if filing_status == filing_statuses.JOINT: - if subtotal < joint: - tax_owed = 0 - - return tax_owed - - va_adj_gross_income = subtotal + tax_owed = where( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.SEPARATE) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | + (filing_status == filing_statuses.WIDOW), + where(subtotal < single, 0, subtotal), + where( + filing_status == filing_statuses.JOINT, + where(subtotal < joint, 0, subtotal), + subtotal + ) + ) + + return tax_owed - return va_adj_gross_income diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py index b172c8198..ed191c498 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py @@ -20,91 +20,99 @@ def formula(tax_unit, period, parameters): spouse_fdca = 0 # change this you_fdcs = tax_unit("fixed_date_conformity_subtractions", period) spouse_fdcs = 0 # change this - if age_of_head > 65: - if ( - filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - or filing_status == filing_status == filing_statuses.WIDOW - ): - age_deduction_count = 1 - total_agi = federal_agi - elif ( - filing_status == filing_statuses.JOINT - or filing_status == filing_statuses.SEPARATE - ) & age_of_spouse > 65: - age_deduction_count = 2 - else: - total_agi = federal_agi + spouse_agi - - if ( - filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - or filing_status == filing_statuses.WIDOW - ): - total_fda = you_fdca - total_fds = you_fdcs - else: - total_fda = you_fdca + spouse_fdca - total_fds = you_fdcs + spouse_fdcs - - line4 = total_agi + total_fda - line6 = line4 - total_fds - line7 = 0 # Taxable benefits from the tax return, change this. - line8 = line6 - line7 - - if ( - filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - or filing_status == filing_statuses.WIDOW - ): - threshold_ln9 = ( - parameters.gov.states.va.tax.income.va_age_deduction_threshold.single - ) - elif filing_status == filing_statuses.JOINT: - threshold_ln9 = ( - parameters.gov.states.va.tax.income.va_age_deduction_threshold.joint - ) - elif filing_status == filing_statuses.SEPARATE: - threshold_ln9 = ( - parameters.gov.states.va.tax.income.va_age_deduction_threshold.separate - ) - - if line8 >= threshold_ln9: - line11 = line8 - threshold_ln9 - elif ( - filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - or filing_status == filing_statuses.WIDOW - or filing_status == filing_statuses.SEPARATE - ): - return 12_000 - elif filing_status == filing_statuses.JOINT: - return 24_000 - - line12 = age_deduction_count * 12_000 - - if line11 >= line12: - return 0 - - if line11 < line12: - line14 = line12 - line11 - - if ( - filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - or filing_status == filing_statuses.WIDOW - or ( - filing_status == filing_statuses.SEPARATE - and age_of_spouse < 65 - ) - or ( - filing_status == filing_statuses.JOINT - and age_of_spouse < 65 - ) # the form has you divide the total by 2, but then if your filing jointly, you'd have to add it back together, so it ends up being the undivided amount - ): - return line14 - elif ( - filing_status == filing_statuses.SEPARATE - and age_of_spouse >= 65 - ): - return line14 / 2 + + age_deduction_count = where( + (age_of_head > 65) & + ( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | + (filing_status == filing_statuses.WIDOW) + ), + 1, + where( + (filing_status == filing_statuses.JOINT) & (age_of_spouse > 65), + 2, + 0 # Default value if none of the conditions are met + ) + ) + + total_agi = where( + age_deduction_count > 0, + federal_agi + spouse_agi, + federal_agi + ) + + total_fda = where( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | + (filing_status == filing_statuses.WIDOW), + you_fdca, + you_fdca + spouse_fdca + ) + + total_fds = where( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | + (filing_status == filing_statuses.WIDOW), + you_fdcs, + you_fdcs + spouse_fdcs + ) + + line4 = total_agi + total_fda + line6 = line4 - total_fds + line7 = 0 # Taxable benefits from the tax return, change this. + line8 = line6 - line7 + + threshold_ln9 = where( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | + (filing_status == filing_statuses.WIDOW), + parameters.gov.states.va.tax.income.va_age_deduction_threshold.single, + where( + filing_status == filing_statuses.JOINT, + parameters.gov.states.va.tax.income.va_age_deduction_threshold.joint, + parameters.gov.states.va.tax.income.va_age_deduction_threshold.separate + ) + ) + + line11 = where( + line8 >= threshold_ln9, + line8 - threshold_ln9, + where( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | + (filing_status == filing_statuses.WIDOW) | + (filing_status == filing_statuses.SEPARATE), + 12_000, + where(filing_status == filing_statuses.JOINT, 24_000, 0) + ) + ) + + line12 = age_deduction_count * 12_000 + + line14 = where(line11 < line12, line12 - line11, 0) + + result = where( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | + (filing_status == filing_statuses.WIDOW) | + ( + (filing_status == filing_statuses.SEPARATE) & (age_of_spouse < 65) + ) | + ( + (filing_status == filing_statuses.JOINT) & (age_of_spouse < 65) + ), + line14, + where( + (filing_status == filing_statuses.SEPARATE) & (age_of_spouse >= 65), + line14 / 2, + 0 + ) + ) + + # Check if age_of_head is less than 65 and set result to 0 in that case + result = where(age_of_head < 65, 0, result) + + return result + + diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py index 5b69f55fd..826db4606 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py @@ -10,51 +10,29 @@ class va_exemptions(Variable): defined_for = StateCode.VA def formula(tax_unit, period, parameters): - va_indiv_exempt_multiplier = parameters( - period - ).gov.states.va.tax.income.exemptions.indiv_exemption_multiplier - # va_indiv_exempt_multiplier = tax_unit("va_indiv_exemption_multiplier", - # period) - - # va_indiv_p65_exempt_multiplier = tax_unit( - # "va_indiv_exemption_over_65_multiplier",period) - - va_indiv_p65_exempt_multiplier = parameters( - period - ).gov.states.va.tax.income.exemptions.indiv_exemption_over_65_multiplier + va_indiv_exempt_multiplier = parameters(period).gov.states.va.tax.income.exemptions.indiv_exemption_multiplier + va_indiv_p65_exempt_multiplier = parameters(period).gov.states.va.tax.income.exemptions.indiv_exemption_over_65_multiplier dependents = tax_unit("tax_unit_dependents", period) - filing_status = tax_unit("filing_status", period) filing_statuses = filing_status.possible_values - if ( - filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - or filing_status == filing_statuses.WIDOW - or filing_status == filing_statuses.SEPARATE - ): - spouse_if_filing_jointly = 0 - - elif filing_status == filing_statuses.JOINT: - spouse_if_filing_jointly = 1 + spouse_if_filing_jointly = where( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | + (filing_status == filing_statuses.WIDOW) | + (filing_status == filing_statuses.SEPARATE), + 0, + where(filing_status == filing_statuses.JOINT, 1, 0) + ) you_p65 = (tax_unit("age_head", period) >= 65).astype(int) - - spouse_p65 = (tax_unit("age_spouse", period) >= 65).astype( - int - ) # check to see if this is valid if they are filing separately - + spouse_p65 = (tax_unit("age_spouse", period) >= 65).astype(int) you_blind = tax_unit("blind_head", period).astype(int) - spouse_blind = tax_unit("blind_spouse", period).astype(int) - total_section_A = ( - 1 + spouse_if_filing_jointly + dependents - ) * va_indiv_exempt_multiplier - - total_section_B = ( - you_p65 + spouse_p65 + you_blind + spouse_blind - ) * va_indiv_p65_exempt_multiplier + total_section_A = (1 + spouse_if_filing_jointly + dependents) * va_indiv_exempt_multiplier + total_section_B = (you_p65 + spouse_p65 + you_blind + spouse_blind) * va_indiv_p65_exempt_multiplier return total_section_A + total_section_B + diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax.py index 943f3be00..9a1b19b82 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax.py @@ -11,15 +11,10 @@ class va_income_tax(Variable): def formula(tax_unit, period, parameters): net_tax = tax_unit("va_income_tax_before_refundable_credits", period) - line_26 = tax_unit("va_refundable_credits", period) - if line_26 < net_tax: - owed_tax = net_tax - line_26 - - return owed_tax + owed_tax = where(line_26 < net_tax, net_tax - line_26, 0) + refund = where(net_tax < line_26, (line_26 - net_tax) * -1, 0) - if net_tax < line_26: - refund = (line_26 - net_tax) * -1 + return owed_tax + refund - return refund diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py index 24907d1de..ff3430737 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py @@ -11,13 +11,9 @@ class va_income_tax_before_refundable_credits(Variable): def formula(tax_unit, period, parameters): rates = parameters(period).gov.states.va.tax.income.va_tax_rates - taxable_inc = tax_unit("va_taxable_income", period) - if taxable_inc > 0: - net_tax = rates.calc(taxable_inc) - - else: - net_tax = 0 + net_tax = where(taxable_inc > 0, rates.calc(taxable_inc), 0) return net_tax + diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py index 425d665c6..727f8864c 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py @@ -13,23 +13,14 @@ def formula(tax_unit, period, parameters): filing_status = tax_unit("filing_status", period) filing_statuses = filing_status.possible_values - if ( - filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - or filing_status == filing_statuses.WIDOW - ): - standard_deduction = ( - parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE - ) - - if filing_status == filing_statuses.JOINT: - standard_deduction = ( - parameters.gov.states.va.tax.income.va_standard_deduction.JOINT - ) - - if filing_status == filing_statuses.SEPARATE: - standard_deduction = ( - parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE - ) + standard_deduction = where( + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | + (filing_status == filing_statuses.WIDOW)| + (filing_status == filing_statuses.SEPARATE), + parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE, + where(filing_status == filing_statuses.JOINT, parameters.gov.states.va.tax.income.va_standard_deduction.JOINT, parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE) + ) return standard_deduction + diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py index 0b19eaf55..575ee4780 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py @@ -11,68 +11,32 @@ class va_tax_credit_for_low_income_individuals(Variable): def formula(tax_unit, period, parameters): agi = tax_unit("va_adj_gross_income", period) - filing_status = tax_unit("filing_status", period) filing_statuses = filing_status.possible_values - fed_eitc = tax_unit("earned_income_tax_credit", period) - net_tax = tax_unit("va_income_tax_before_refundable_credits", period) - if ( - filing_status == filing_statuses.SEPARATE - or filing_status == filing_statuses.SINGLE - or filing_status == filing_statuses.WIDOW - or filing_status == filing_statuses.HEAD_OF_HOUSEHOLD - ): - spouse_if_filing_jointly = 0 - - elif filing_status == filing_statuses.JOINT: - spouse_if_filing_jointly = 1 + spouse_if_filing_jointly = where( + (filing_status == filing_statuses.SEPARATE) | + (filing_status == filing_statuses.SINGLE) | + (filing_status == filing_statuses.WIDOW) | + (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD), + 0, + where(filing_status == filing_statuses.JOINT, 1, 0) + ) spouse_agi = tax_unit("spouse_separate_adjusted_gross_income", period) - dependents = tax_unit("tax_unit_dependents", period) - total_num_exemptions = spouse_if_filing_jointly + dependents + 1 - total_agi = agi + spouse_agi - eitc_rate = parameters(period).gov.states.va.tax.income.va_eitc_rate + threshold = parameters(period).gov.states.va.tax.income.va_eitc_threshold.calc(total_num_exemptions) - # logic to determine if the person qualifies for the EITC - - threshold = parameters( - period - ).gov.states.va.tax.income.va_eitc_threshold.calc(total_num_exemptions) - - # threshold = 12880 + (4540*(total_num_exemptions-1)) - - if total_agi < threshold: - line_13 = total_num_exemptions * 300 - - # if fed_eitc > 0 : - - # line_13 = 0 - - line_14 = fed_eitc - - line_15 = line_14 * eitc_rate - - if line_15 > line_13: - line_16 = line_15 - else: - line_16 = line_13 - - if net_tax > line_16: - line_17 = line_16 - - else: - line_17 = net_tax - - return line_17 + line_13 = where(total_agi < threshold, total_num_exemptions * 300, 0) + line_14 = fed_eitc + line_15 = line_14 * eitc_rate + line_16 = where(line_15 > line_13, line_15, line_13) + line_17 = where(net_tax > line_16, line_16, 0) - else: - line_17 = 0 + return line_17 - return line_17 From 044b4f7dd52b430da6260dfd73fa2c0b2d02f4e9 Mon Sep 17 00:00:00 2001 From: Austin Francis Date: Tue, 10 Oct 2023 22:11:09 -0600 Subject: [PATCH 10/29] formatted the files --- .../gov/states/va/tax/income/calc_line_14.py | 25 +++--- .../va/tax/income/va_adj_gross_income.py | 17 ++-- .../states/va/tax/income/va_age_deduction.py | 83 +++++++++---------- .../gov/states/va/tax/income/va_exemptions.py | 27 +++--- .../gov/states/va/tax/income/va_income_tax.py | 1 - ...va_income_tax_before_refundable_credits.py | 1 - .../va/tax/income/va_standard_deduction.py | 15 ++-- ...a_tax_credit_for_low_income_individuals.py | 15 ++-- 8 files changed, 99 insertions(+), 85 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py index cef797b39..cf5a4bfc7 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py @@ -14,19 +14,25 @@ def formula(tax_unit, period, parameters): filing_statuses = filing_status.possible_values va_standard_deduction = where( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.WIDOW) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD), - parameters(period).gov.states.va.tax.income.va_standard_deduction.SINGLE, + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.WIDOW) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD), + parameters( + period + ).gov.states.va.tax.income.va_standard_deduction.SINGLE, where( filing_status == filing_statuses.JOINT, - parameters(period).gov.states.va.tax.income.va_standard_deduction.JOINT, + parameters( + period + ).gov.states.va.tax.income.va_standard_deduction.JOINT, where( filing_status == filing_statuses.SEPARATE, - parameters(period).gov.states.va.tax.income.va_standard_deduction.SEPARATE, - 0 # Default value if none of the conditions are met - ) - ) + parameters( + period + ).gov.states.va.tax.income.va_standard_deduction.SEPARATE, + 0, # Default value if none of the conditions are met + ), + ), ) line_12 = tax_unit("va_exemptions", period) @@ -34,4 +40,3 @@ def formula(tax_unit, period, parameters): subtotal = va_standard_deduction + line_12 return subtotal - diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py index 4a3c0dfd4..84c1c454e 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_adj_gross_income.py @@ -15,24 +15,25 @@ def formula(tax_unit, period, parameters): filing_status = tax_unit("filing_status", period) filing_statuses = filing_status.possible_values - threshold = parameters(period).gov.states.va.tax.income.va_adjusted_gross_income + threshold = parameters( + period + ).gov.states.va.tax.income.va_adjusted_gross_income single = threshold.SINGLE joint = threshold.JOINT subtotal = line3 - line8 tax_owed = where( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.SEPARATE) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | - (filing_status == filing_statuses.WIDOW), + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.SEPARATE) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) + | (filing_status == filing_statuses.WIDOW), where(subtotal < single, 0, subtotal), where( filing_status == filing_statuses.JOINT, where(subtotal < joint, 0, subtotal), - subtotal - ) + subtotal, + ), ) return tax_owed - diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py index ed191c498..962b07b0e 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py @@ -22,40 +22,39 @@ def formula(tax_unit, period, parameters): spouse_fdcs = 0 # change this age_deduction_count = where( - (age_of_head > 65) & - ( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | - (filing_status == filing_statuses.WIDOW) + (age_of_head > 65) + & ( + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) + | (filing_status == filing_statuses.WIDOW) ), 1, where( - (filing_status == filing_statuses.JOINT) & (age_of_spouse > 65), + (filing_status == filing_statuses.JOINT) + & (age_of_spouse > 65), 2, - 0 # Default value if none of the conditions are met - ) + 0, # Default value if none of the conditions are met + ), ) total_agi = where( - age_deduction_count > 0, - federal_agi + spouse_agi, - federal_agi + age_deduction_count > 0, federal_agi + spouse_agi, federal_agi ) total_fda = where( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | - (filing_status == filing_statuses.WIDOW), + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) + | (filing_status == filing_statuses.WIDOW), you_fdca, - you_fdca + spouse_fdca + you_fdca + spouse_fdca, ) total_fds = where( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | - (filing_status == filing_statuses.WIDOW), + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) + | (filing_status == filing_statuses.WIDOW), you_fdcs, - you_fdcs + spouse_fdcs + you_fdcs + spouse_fdcs, ) line4 = total_agi + total_fda @@ -64,28 +63,28 @@ def formula(tax_unit, period, parameters): line8 = line6 - line7 threshold_ln9 = where( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | - (filing_status == filing_statuses.WIDOW), + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) + | (filing_status == filing_statuses.WIDOW), parameters.gov.states.va.tax.income.va_age_deduction_threshold.single, where( filing_status == filing_statuses.JOINT, parameters.gov.states.va.tax.income.va_age_deduction_threshold.joint, - parameters.gov.states.va.tax.income.va_age_deduction_threshold.separate - ) + parameters.gov.states.va.tax.income.va_age_deduction_threshold.separate, + ), ) line11 = where( line8 >= threshold_ln9, line8 - threshold_ln9, where( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | - (filing_status == filing_statuses.WIDOW) | - (filing_status == filing_statuses.SEPARATE), + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) + | (filing_status == filing_statuses.WIDOW) + | (filing_status == filing_statuses.SEPARATE), 12_000, - where(filing_status == filing_statuses.JOINT, 24_000, 0) - ) + where(filing_status == filing_statuses.JOINT, 24_000, 0), + ), ) line12 = age_deduction_count * 12_000 @@ -93,26 +92,26 @@ def formula(tax_unit, period, parameters): line14 = where(line11 < line12, line12 - line11, 0) result = where( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | - (filing_status == filing_statuses.WIDOW) | - ( - (filing_status == filing_statuses.SEPARATE) & (age_of_spouse < 65) - ) | - ( + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) + | (filing_status == filing_statuses.WIDOW) + | ( + (filing_status == filing_statuses.SEPARATE) + & (age_of_spouse < 65) + ) + | ( (filing_status == filing_statuses.JOINT) & (age_of_spouse < 65) ), line14, where( - (filing_status == filing_statuses.SEPARATE) & (age_of_spouse >= 65), + (filing_status == filing_statuses.SEPARATE) + & (age_of_spouse >= 65), line14 / 2, - 0 - ) + 0, + ), ) # Check if age_of_head is less than 65 and set result to 0 in that case result = where(age_of_head < 65, 0, result) return result - - diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py index 826db4606..7825db344 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_exemptions.py @@ -10,20 +10,24 @@ class va_exemptions(Variable): defined_for = StateCode.VA def formula(tax_unit, period, parameters): - va_indiv_exempt_multiplier = parameters(period).gov.states.va.tax.income.exemptions.indiv_exemption_multiplier - va_indiv_p65_exempt_multiplier = parameters(period).gov.states.va.tax.income.exemptions.indiv_exemption_over_65_multiplier + va_indiv_exempt_multiplier = parameters( + period + ).gov.states.va.tax.income.exemptions.indiv_exemption_multiplier + va_indiv_p65_exempt_multiplier = parameters( + period + ).gov.states.va.tax.income.exemptions.indiv_exemption_over_65_multiplier dependents = tax_unit("tax_unit_dependents", period) filing_status = tax_unit("filing_status", period) filing_statuses = filing_status.possible_values spouse_if_filing_jointly = where( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | - (filing_status == filing_statuses.WIDOW) | - (filing_status == filing_statuses.SEPARATE), + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) + | (filing_status == filing_statuses.WIDOW) + | (filing_status == filing_statuses.SEPARATE), 0, - where(filing_status == filing_statuses.JOINT, 1, 0) + where(filing_status == filing_statuses.JOINT, 1, 0), ) you_p65 = (tax_unit("age_head", period) >= 65).astype(int) @@ -31,8 +35,11 @@ def formula(tax_unit, period, parameters): you_blind = tax_unit("blind_head", period).astype(int) spouse_blind = tax_unit("blind_spouse", period).astype(int) - total_section_A = (1 + spouse_if_filing_jointly + dependents) * va_indiv_exempt_multiplier - total_section_B = (you_p65 + spouse_p65 + you_blind + spouse_blind) * va_indiv_p65_exempt_multiplier + total_section_A = ( + 1 + spouse_if_filing_jointly + dependents + ) * va_indiv_exempt_multiplier + total_section_B = ( + you_p65 + spouse_p65 + you_blind + spouse_blind + ) * va_indiv_p65_exempt_multiplier return total_section_A + total_section_B - diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax.py index 9a1b19b82..6e33430d4 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax.py @@ -17,4 +17,3 @@ def formula(tax_unit, period, parameters): refund = where(net_tax < line_26, (line_26 - net_tax) * -1, 0) return owed_tax + refund - diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py index ff3430737..d55213660 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_tax_before_refundable_credits.py @@ -16,4 +16,3 @@ def formula(tax_unit, period, parameters): net_tax = where(taxable_inc > 0, rates.calc(taxable_inc), 0) return net_tax - diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py index 727f8864c..2a0e65bef 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_standard_deduction.py @@ -14,13 +14,16 @@ def formula(tax_unit, period, parameters): filing_statuses = filing_status.possible_values standard_deduction = where( - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | - (filing_status == filing_statuses.WIDOW)| - (filing_status == filing_statuses.SEPARATE), + (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) + | (filing_status == filing_statuses.WIDOW) + | (filing_status == filing_statuses.SEPARATE), parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE, - where(filing_status == filing_statuses.JOINT, parameters.gov.states.va.tax.income.va_standard_deduction.JOINT, parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE) + where( + filing_status == filing_statuses.JOINT, + parameters.gov.states.va.tax.income.va_standard_deduction.JOINT, + parameters.gov.states.va.tax.income.va_standard_deduction.SINGLE, + ), ) return standard_deduction - diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py index 575ee4780..6001872c2 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_tax_credit_for_low_income_individuals.py @@ -17,12 +17,12 @@ def formula(tax_unit, period, parameters): net_tax = tax_unit("va_income_tax_before_refundable_credits", period) spouse_if_filing_jointly = where( - (filing_status == filing_statuses.SEPARATE) | - (filing_status == filing_statuses.SINGLE) | - (filing_status == filing_statuses.WIDOW) | - (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD), + (filing_status == filing_statuses.SEPARATE) + | (filing_status == filing_statuses.SINGLE) + | (filing_status == filing_statuses.WIDOW) + | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD), 0, - where(filing_status == filing_statuses.JOINT, 1, 0) + where(filing_status == filing_statuses.JOINT, 1, 0), ) spouse_agi = tax_unit("spouse_separate_adjusted_gross_income", period) @@ -30,7 +30,9 @@ def formula(tax_unit, period, parameters): total_num_exemptions = spouse_if_filing_jointly + dependents + 1 total_agi = agi + spouse_agi eitc_rate = parameters(period).gov.states.va.tax.income.va_eitc_rate - threshold = parameters(period).gov.states.va.tax.income.va_eitc_threshold.calc(total_num_exemptions) + threshold = parameters( + period + ).gov.states.va.tax.income.va_eitc_threshold.calc(total_num_exemptions) line_13 = where(total_agi < threshold, total_num_exemptions * 300, 0) line_14 = fed_eitc @@ -39,4 +41,3 @@ def formula(tax_unit, period, parameters): line_17 = where(net_tax > line_16, line_16, 0) return line_17 - From c0b71ae0c3cb474ad18314bd263c5701914007f3 Mon Sep 17 00:00:00 2001 From: Austin Francis Date: Wed, 18 Oct 2023 22:39:21 -0600 Subject: [PATCH 11/29] fixed a bug in va_age_deduction --- .../variables/gov/states/va/tax/income/va_age_deduction.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py index 962b07b0e..fd6ab70d9 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py @@ -66,11 +66,11 @@ def formula(tax_unit, period, parameters): (filing_status == filing_statuses.SINGLE) | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | (filing_status == filing_statuses.WIDOW), - parameters.gov.states.va.tax.income.va_age_deduction_threshold.single, + parameters(period).gov.states.va.tax.income.va_age_deduction_threshold.SINGLE, where( filing_status == filing_statuses.JOINT, - parameters.gov.states.va.tax.income.va_age_deduction_threshold.joint, - parameters.gov.states.va.tax.income.va_age_deduction_threshold.separate, + parameters(period).gov.states.va.tax.income.va_age_deduction_threshold.JOINT, + parameters(period).gov.states.va.tax.income.va_age_deduction_threshold.SEPARATE, ), ) From 60339a60c2745c6e9964939dc59e58f6671bd802 Mon Sep 17 00:00:00 2001 From: mitchellpound Date: Sat, 21 Oct 2023 09:23:48 -0600 Subject: [PATCH 12/29] Fixed circularity for CO in state_income_tax var --- .../tax/income/additions/co_state_addback.py | 20 +++++-------------- .../gov/states/tax/income/state_income_tax.py | 2 +- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py b/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py index d4ca2cd45..45156587a 100644 --- a/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py +++ b/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py @@ -15,18 +15,8 @@ class co_state_addback(Variable): def formula(tax_unit, period, parameters): federal_itemizer = tax_unit("tax_unit_itemizes", period) - state_inctax = max_(0, tax_unit("state_income_tax", period)) - property_taxes = add(tax_unit, period, ["real_estate_taxes"]) - # follow worksheet on page 5 of 2021 Book cited above: - irs_schA_line_5d = state_inctax + property_taxes - irs_schA_line_5e = tax_unit("salt_deduction", period) - ws_line_a = where( - irs_schA_line_5d > irs_schA_line_5e, - max_(0, irs_schA_line_5e - property_taxes), - state_inctax, - ) - p = parameters(period).gov.irs.deductions - ws_line_b = add(tax_unit, period, p.itemized_deductions) - ws_line_c = tax_unit("standard_deduction", period) - ws_line_d = max_(0, ws_line_b - ws_line_c) - return federal_itemizer * min_(ws_line_a, ws_line_d) + # Colorado only requires taxpayers to add back state income tax from + # Federal Schedule A (line 5a). It does not require taxpayers to + # add back state real estate or property tax from Schedule A + state_inctax = max_(0, tax_unit("statelocal_sales_or_prior_inctax", period)) + return federal_itemizer * state_inctax diff --git a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py index 19560004e..eb6cdb0fc 100644 --- a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py +++ b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py @@ -10,7 +10,7 @@ class state_income_tax(Variable): adds = [ # state income tax variables listed in alphabetical order: "ca_income_tax", - # "co_income_tax", --- activating will cause circular logic errors + "co_income_tax", #--- activating will cause circular logic errors "dc_income_tax", "ia_income_tax", "il_income_tax", From 5ca626a158d8901e4024e554ee397b20994fdd70 Mon Sep 17 00:00:00 2001 From: mitchellpound Date: Sat, 21 Oct 2023 14:35:12 -0600 Subject: [PATCH 13/29] Fixed MO circularity in state_income_tax --- .../mo/tax/income/taxable_income/mo_net_state_income_taxes.py | 2 +- .../variables/gov/states/tax/income/state_income_tax.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py b/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py index 1bd42e2b5..2c613661f 100644 --- a/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py +++ b/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py @@ -20,7 +20,7 @@ def formula(tax_unit, period, parameters): p = parameters(period).gov.irs.deductions.itemized salt_cap = p.salt_and_real_estate.cap[filing_status] - uncapped_itax = max_(0, add(tax_unit, period, ["state_income_tax"])) + uncapped_itax = max_(0, add(tax_unit, period, ["statelocal_sales_or_prior_inctax"])) uncapped_ptax = add(tax_unit, period, ["real_estate_taxes"]) uncapped_salt = uncapped_itax + uncapped_ptax diff --git a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py index eb6cdb0fc..da49d267f 100644 --- a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py +++ b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py @@ -10,7 +10,7 @@ class state_income_tax(Variable): adds = [ # state income tax variables listed in alphabetical order: "ca_income_tax", - "co_income_tax", #--- activating will cause circular logic errors + "co_income_tax", "dc_income_tax", "ia_income_tax", "il_income_tax", @@ -23,7 +23,7 @@ class state_income_tax(Variable): "me_income_tax", "mn_income_tax", "mt_income_tax", - # "mo_income_tax", --- activating will cause circular logic errors + "mo_income_tax", "nc_income_tax", "nd_income_tax", "ne_income_tax", From 317d7625c7f3be22e581c99cbd21b1d991d0b594 Mon Sep 17 00:00:00 2001 From: Samuel Sanft Date: Mon, 23 Oct 2023 17:45:57 -0400 Subject: [PATCH 14/29] update environment.yml --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 8ea1ff530..7edf0354e 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,4 @@ name: fiscalsim-us-dev dependencies: - - python=3.10 + - python>=3.10,<3.12 - pip From a166f87dc681475c6d15bc8ae6063fc3a939f5f8 Mon Sep 17 00:00:00 2001 From: Samuel Sanft Date: Mon, 23 Oct 2023 17:54:18 -0400 Subject: [PATCH 15/29] update github action --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 8b253eb26..1c3916fde 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -6,7 +6,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.10"] + python-version: ["3.10", "3.11"] steps: - name: Checkout From 2a355813326880632d6aa07d924bd43bf0e697b9 Mon Sep 17 00:00:00 2001 From: mitchellpound Date: Mon, 23 Oct 2023 20:31:11 -0600 Subject: [PATCH 16/29] Fixed tests --- .../mo_net_state_income_taxes.yaml | 8 +++--- .../tax/income/additions/co_state_addback.py | 26 ++++++++++++++----- .../mo_net_state_income_taxes.py | 4 ++- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/fiscalsim_us/tests/policy/baseline/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.yaml b/fiscalsim_us/tests/policy/baseline/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.yaml index e8707e5d5..2d14e7f93 100644 --- a/fiscalsim_us/tests/policy/baseline/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.yaml +++ b/fiscalsim_us/tests/policy/baseline/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.yaml @@ -3,7 +3,7 @@ absolute_error_margin: 0 input: filing_status: SINGLE - state_income_tax: 0 + prior_year_state_income_tax_paid: 0 state_code: MO output: mo_net_state_income_taxes: 0.0 @@ -13,7 +13,7 @@ absolute_error_margin: 0.01 input: filing_status: SINGLE - state_income_tax: 23_000 + prior_year_state_income_tax_paid: 23_000 state_code: MO output: mo_net_state_income_taxes: 10_000 @@ -24,7 +24,7 @@ input: filing_status: SINGLE real_estate_taxes: 4_000 - state_income_tax: 3_000 + prior_year_state_income_tax_paid: 3_000 state_code: MO output: mo_net_state_income_taxes: 3_000 @@ -35,7 +35,7 @@ input: filing_status: JOINT real_estate_taxes: 4_000 - state_income_tax: 8_000 + prior_year_state_income_tax_paid: 8_000 state_code: MO output: mo_net_state_income_taxes: 6_666.67 # = 10_000 * 2/3 diff --git a/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py b/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py index 45156587a..efcb3b96b 100644 --- a/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py +++ b/fiscalsim_us/variables/gov/states/co/tax/income/additions/co_state_addback.py @@ -8,15 +8,27 @@ class co_state_addback(Variable): unit = USD definition_period = YEAR reference = ( - "https://tax.colorado.gov/sites/tax/files/documents/DR_104_Book_2021.pdf#page=5" - "https://tax.colorado.gov/sites/tax/files/documents/DR_104_Book_2022.pdf#page=5" + "https://tax.colorado.gov/sites/tax/files/documents/DR_104_Book_2021.pdf#page=5", + "https://tax.colorado.gov/sites/tax/files/documents/DR_104_Book_2022.pdf#page=5", + "https://tax.colorado.gov/sites/tax/files/documents/ITT_State_Income_Tax_Addback_Jan_2023.pdf", ) defined_for = StateCode.CO def formula(tax_unit, period, parameters): federal_itemizer = tax_unit("tax_unit_itemizes", period) - # Colorado only requires taxpayers to add back state income tax from - # Federal Schedule A (line 5a). It does not require taxpayers to - # add back state real estate or property tax from Schedule A - state_inctax = max_(0, tax_unit("statelocal_sales_or_prior_inctax", period)) - return federal_itemizer * state_inctax + + salt_deduct = tax_unit("salt_deduction", period) + local_taxes = add( + tax_unit, period, ["prior_year_local_income_tax_paid"] + ) + property_taxes = add(tax_unit, period, ["real_estate_taxes"]) + state_addback = max_(0, salt_deduct - local_taxes - property_taxes) + + # return the max between the "extra" itemized deductions above the std + # and the state taxes included in the SALT deduction + p = parameters(period).gov.irs.deductions + item_deducts = add(tax_unit, period, p.itemized_deductions) + std_deducts = tax_unit("standard_deduction", period) + alt_addback = max_(0, item_deducts - std_deducts) + + return federal_itemizer * min_(state_addback, alt_addback) diff --git a/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py b/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py index 2c613661f..63da281de 100644 --- a/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py +++ b/fiscalsim_us/variables/gov/states/mo/tax/income/taxable_income/mo_net_state_income_taxes.py @@ -20,7 +20,9 @@ def formula(tax_unit, period, parameters): p = parameters(period).gov.irs.deductions.itemized salt_cap = p.salt_and_real_estate.cap[filing_status] - uncapped_itax = max_(0, add(tax_unit, period, ["statelocal_sales_or_prior_inctax"])) + uncapped_itax = max_( + 0, add(tax_unit, period, ["prior_year_state_income_tax_paid"]) + ) uncapped_ptax = add(tax_unit, period, ["real_estate_taxes"]) uncapped_salt = uncapped_itax + uncapped_ptax From 2dd8ee9907e4d06cdc68e3fc48b2bdd8788034c8 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 09:10:27 -0600 Subject: [PATCH 17/29] Updated version in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b7c132e5d..a4594894d 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="fiscalsim-us", - version="0.2.3", + version="0.2.4", author="Center for Growth and Opportunity at Utah State University (CGO)", author_email="fiscalsim@thecgo.org", long_description=readme, From 964d773e818c946c3bde5264767866ea0011ee44 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 09:12:08 -0600 Subject: [PATCH 18/29] Updated CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ad434620..c58e5f853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.4] - 2023-10-24 10:00:00 + +### Added + +- Fixed circularity in CO tax logic +- Fixed circularity in MO tax logic + ## [0.2.3] - 2023-10-13 16:00:00 ### Added @@ -171,6 +178,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - First prototype version based off of openfisca-us and tax-calculator. +[0.2.4]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.3...v0.2.4 [0.2.3]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.2...v0.2.3 [0.2.2]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.1...v0.2.2 [0.2.1]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.0...v0.2.1 From cc3e12d81fd34410fa757373c7120fa7c56ec4aa Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 09:13:35 -0600 Subject: [PATCH 19/29] Updated changelog.yaml --- changelog.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.yaml b/changelog.yaml index 5fffd669b..78b4d1bf5 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -157,3 +157,9 @@ - adjusted `salt_deduction.py` to calculate based on the added variables - Adds three files `prior_year_state_income_tax_paid.py`, `prior_year_local_income_tax_paid.py`, and `sales_or_prior_year_state_and_local_income_tax.py` date: 2023-10-13 16:00:00 +- bump: patch + changes: + added: + - Fixed circularity in CO tax logic + - Fixed circularity in MO tax logic + date: 2023-10-24 10:00:00 From c1678f0bd70c2bbde939c2bea017c53fed307c83 Mon Sep 17 00:00:00 2001 From: Austin Francis Date: Tue, 24 Oct 2023 17:01:43 -0600 Subject: [PATCH 20/29] changed filenames to start with va_ prefix --- .../gov/states/va/tax/income/va_additions_to_federal_agi.py | 4 ++-- .../variables/gov/states/va/tax/income/va_age_deduction.py | 4 ++-- .../va/tax/income/{calc_line_14.py => va_calc_line_14.py} | 2 +- ...s_wages.py => va_disability_income_reported_as_wages.py} | 0 ...additions .py => va_fixed_date_conformity_additions .py} | 0 ...ractions.py => va_fixed_date_conformity_subtractions.py} | 0 ...d_exempt.py => va_income_from_obligations_fed_exempt.py} | 0 ...exempt.py => va_income_from_obligations_state_exempt.py} | 0 .../states/va/tax/income/va_subtractions_to_federal_agi.py | 6 +++--- .../variables/gov/states/va/tax/income/va_taxable_income.py | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) rename fiscalsim_us/variables/gov/states/va/tax/income/{calc_line_14.py => va_calc_line_14.py} (97%) rename fiscalsim_us/variables/gov/states/va/tax/income/{disability_income_reported_as_wages.py => va_disability_income_reported_as_wages.py} (100%) rename fiscalsim_us/variables/gov/states/va/tax/income/{fixed_date_conformity_additions .py => va_fixed_date_conformity_additions .py} (100%) rename fiscalsim_us/variables/gov/states/va/tax/income/{fixed_date_conformity_subtractions.py => va_fixed_date_conformity_subtractions.py} (100%) rename fiscalsim_us/variables/gov/states/va/tax/income/{income_from_obligations_fed_exempt.py => va_income_from_obligations_fed_exempt.py} (100%) rename fiscalsim_us/variables/gov/states/va/tax/income/{income_from_obligations_state_exempt.py => va_income_from_obligations_state_exempt.py} (100%) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py index 76ab4bc78..075ced9f7 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_additions_to_federal_agi.py @@ -11,11 +11,11 @@ class va_additions_to_federal_agi(Variable): def formula(tax_unit, period, parameters): income_from_obligations_fed_exempt = tax_unit( - "income_from_obligations_fed_exempt", period + "va_income_from_obligations_fed_exempt", period ) fixed_date_conformity_additions = tax_unit( - "fixed_date_conformity_additions", period + "va_fixed_date_conformity_additions", period ) additions_to_fed_agi = ( diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py index fd6ab70d9..50b7ab0aa 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py @@ -16,9 +16,9 @@ def formula(tax_unit, period, parameters): filing_statuses = filing_status.possible_values federal_agi = tax_unit("adjusted_gross_income", period) spouse_agi = tax_unit("spouse_separate_adjusted_gross_income", period) - you_fdca = tax_unit("fixed_date_conformity_additions", period) + you_fdca = tax_unit("va_fixed_date_conformity_additions", period) spouse_fdca = 0 # change this - you_fdcs = tax_unit("fixed_date_conformity_subtractions", period) + you_fdcs = tax_unit("va_fixed_date_conformity_subtractions", period) spouse_fdcs = 0 # change this age_deduction_count = where( diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_14.py similarity index 97% rename from fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py rename to fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_14.py index cf5a4bfc7..f876b9d84 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/calc_line_14.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_calc_line_14.py @@ -1,7 +1,7 @@ from fiscalsim_us.model_api import * -class calc_line_14(Variable): +class va_calc_line_14(Variable): value_type = float entity = TaxUnit label = "VA interim step to get to total virginia taxable income, line 14 on form 760 https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2021/760-2021.pdf" diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/disability_income_reported_as_wages.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_disability_income_reported_as_wages.py similarity index 100% rename from fiscalsim_us/variables/gov/states/va/tax/income/disability_income_reported_as_wages.py rename to fiscalsim_us/variables/gov/states/va/tax/income/va_disability_income_reported_as_wages.py diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/fixed_date_conformity_additions .py b/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_additions .py similarity index 100% rename from fiscalsim_us/variables/gov/states/va/tax/income/fixed_date_conformity_additions .py rename to fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_additions .py diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/fixed_date_conformity_subtractions.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_subtractions.py similarity index 100% rename from fiscalsim_us/variables/gov/states/va/tax/income/fixed_date_conformity_subtractions.py rename to fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_subtractions.py diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/income_from_obligations_fed_exempt.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_fed_exempt.py similarity index 100% rename from fiscalsim_us/variables/gov/states/va/tax/income/income_from_obligations_fed_exempt.py rename to fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_fed_exempt.py diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/income_from_obligations_state_exempt.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_state_exempt.py similarity index 100% rename from fiscalsim_us/variables/gov/states/va/tax/income/income_from_obligations_state_exempt.py rename to fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_state_exempt.py diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_subtractions_to_federal_agi.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_subtractions_to_federal_agi.py index 678ca075e..58d17bd8d 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_subtractions_to_federal_agi.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_subtractions_to_federal_agi.py @@ -11,15 +11,15 @@ class va_subtractions_to_federal_agi(Variable): def formula(tax_unit, period, parameters): income_from_obligations_state_exempt = tax_unit( - "income_from_obligations_state_exempt", period + "va_income_from_obligations_state_exempt", period ) fixed_date_conformity_subtractions = tax_unit( - "fixed_date_conformity_subtractions", period + "va_fixed_date_conformity_subtractions", period ) disability_income_reported_as_wages = tax_unit( - "disability_income_reported_as_wages", period + "va_disability_income_reported_as_wages", period ) subtractions_to_fed_agi = ( diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_taxable_income.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_taxable_income.py index 7ede12ca2..ee48bf968 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_taxable_income.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_taxable_income.py @@ -10,7 +10,7 @@ class va_taxable_income(Variable): defined_for = StateCode.VA def formula(tax_unit, period, parameters): - line_14 = tax_unit("calc_line_14", period) + line_14 = tax_unit("va_calc_line_14", period) line_9 = tax_unit("va_adj_gross_income", period) From 003854b90be7643b3499fc775d638d8d23f5751c Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 20:11:08 -0600 Subject: [PATCH 21/29] Black formatted va_age_deduction.py --- .../gov/states/va/tax/income/va_age_deduction.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py index 50b7ab0aa..ebfa05529 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_age_deduction.py @@ -66,11 +66,17 @@ def formula(tax_unit, period, parameters): (filing_status == filing_statuses.SINGLE) | (filing_status == filing_statuses.HEAD_OF_HOUSEHOLD) | (filing_status == filing_statuses.WIDOW), - parameters(period).gov.states.va.tax.income.va_age_deduction_threshold.SINGLE, + parameters( + period + ).gov.states.va.tax.income.va_age_deduction_threshold.SINGLE, where( filing_status == filing_statuses.JOINT, - parameters(period).gov.states.va.tax.income.va_age_deduction_threshold.JOINT, - parameters(period).gov.states.va.tax.income.va_age_deduction_threshold.SEPARATE, + parameters( + period + ).gov.states.va.tax.income.va_age_deduction_threshold.JOINT, + parameters( + period + ).gov.states.va.tax.income.va_age_deduction_threshold.SEPARATE, ), ) From 9e8767f8fe6d0b932c9bf96b3438a8ac47f01c37 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 20:13:48 -0600 Subject: [PATCH 22/29] Added VA to list in state_income_tax.py --- .../variables/gov/states/tax/income/state_income_tax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py index da49d267f..1f3a680b1 100644 --- a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py +++ b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py @@ -35,7 +35,7 @@ class state_income_tax(Variable): "or_income_tax", "pa_income_tax", "ri_income_tax", - # "va_income_tax", --- temporarily deactivated until change if to where + "va_income_tax", "ut_income_tax", "wa_income_tax", "wi_income_tax", From 1b8de5f1be0574367f8d3210e370520e7ea42483 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 20:35:08 -0600 Subject: [PATCH 23/29] Updated state and household variables --- .../gov/states/tax/income/state_income_tax.py | 3 ++- .../state_income_tax_before_refundable_credits.py | 5 +++++ .../household/household_refundable_tax_credits.py | 8 +++++++- .../household_tax_before_refundable_credits.py | 12 +++++++++--- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py index 1f3a680b1..ad61e5f24 100644 --- a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py +++ b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py @@ -35,8 +35,9 @@ class state_income_tax(Variable): "or_income_tax", "pa_income_tax", "ri_income_tax", - "va_income_tax", "ut_income_tax", + "va_income_tax", + "vt_income_tax", "wa_income_tax", "wi_income_tax", ] diff --git a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax_before_refundable_credits.py b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax_before_refundable_credits.py index 5f870eb03..10ddd02fa 100644 --- a/fiscalsim_us/variables/gov/states/tax/income/state_income_tax_before_refundable_credits.py +++ b/fiscalsim_us/variables/gov/states/tax/income/state_income_tax_before_refundable_credits.py @@ -8,17 +8,20 @@ class state_income_tax_before_refundable_credits(Variable): unit = USD definition_period = YEAR adds = [ + "ca_income_tax_before_refundable_credits", "co_income_tax_before_refundable_credits", "dc_income_tax_before_refundable_credits", "ia_income_tax_before_refundable_credits", "il_total_tax", "in_income_tax_before_refundable_credits", "ks_income_tax_before_refundable_credits", + "ky_income_tax_before_refundable_credits", "la_income_tax_before_refundable_credits", "ma_income_tax_before_refundable_credits", "md_income_tax_before_refundable_credits", "me_income_tax_before_refundable_credits", "mn_income_tax_before_refundable_credits", + "mt_income_tax_before_refundable_credits", "mo_income_tax_before_refundable_credits", "nc_income_tax", # NC has no refundable credits. "nd_income_tax_before_refundable_credits", @@ -27,8 +30,10 @@ class state_income_tax_before_refundable_credits(Variable): "nj_income_tax_before_refundable_credits", "nm_income_tax_before_refundable_credits", "ny_income_tax_before_refundable_credits", + "ok_income_tax_before_refundable_credits", "or_income_tax_before_refundable_credits", "pa_income_tax", # PA has no refundable credits. + "ri_income_tax_before_refundable_credits", "ut_income_tax_before_refundable_credits", "va_income_tax_before_refundable_credits", "vt_income_tax_before_refundable_credits", diff --git a/fiscalsim_us/variables/household/income/household/household_refundable_tax_credits.py b/fiscalsim_us/variables/household/income/household/household_refundable_tax_credits.py index aaff02949..4abcc6618 100644 --- a/fiscalsim_us/variables/household/income/household/household_refundable_tax_credits.py +++ b/fiscalsim_us/variables/household/income/household/household_refundable_tax_credits.py @@ -16,10 +16,13 @@ class household_refundable_tax_credits(Variable): "il_refundable_credits", # Illinois. "in_refundable_credits", # Indiana. "ks_refundable_credits", # Kansas. + "ky_refundable_credits", # Kentucky. + "la_refundable_credits", # Louisiana. "ma_refundable_credits", # Massachusetts. "me_refundable_credits", # Maine. "md_refundable_credits", # Maryland. "mn_refundable_credits", # Minnesota. + "mt_refundable_credits", # Montana. "mo_refundable_credits", # Missouri. # Skip NC, which has no refundable credits. "nd_refundable_credits", # North Dakota. @@ -28,11 +31,14 @@ class household_refundable_tax_credits(Variable): "nj_refundable_credits", # New Jersey. "nm_refundable_credits", # New Mexico. "ny_refundable_credits", # New York. + "ok_refundable_credits", # Oklahoma. "or_refundable_credits", # Oregon. # Skip PA, which has no refundable credits. - "wa_refundable_credits", # Washington. + "ri_refundable_credits", # Rhode Island. "ut_refundable_credits", # Utah. + "va_refundable_credits", # Virginia. "vt_refundable_credits", # Vermont. + "wa_refundable_credits", # Washington. "wi_refundable_credits", # Wisconsin. # LOCAL "nyc_refundable_credits", # New York City. diff --git a/fiscalsim_us/variables/household/income/household/household_tax_before_refundable_credits.py b/fiscalsim_us/variables/household/income/household/household_tax_before_refundable_credits.py index 105679034..29eec83f7 100644 --- a/fiscalsim_us/variables/household/income/household/household_tax_before_refundable_credits.py +++ b/fiscalsim_us/variables/household/income/household/household_tax_before_refundable_credits.py @@ -19,10 +19,13 @@ class household_tax_before_refundable_credits(Variable): "il_total_tax", "in_income_tax_before_refundable_credits", "ks_income_tax_before_refundable_credits", + "ky_income_tax_before_refundable_credits", + "la_income_tax_before_refundable_credits", "me_income_tax_before_refundable_credits", "ma_income_tax_before_refundable_credits", "md_income_tax_before_refundable_credits", "mn_income_tax_before_refundable_credits", + "mt_income_tax_before_refundable_credits", "mo_income_tax_before_refundable_credits", "nc_income_tax", # NC has no refundable credits. "nd_income_tax_before_refundable_credits", @@ -31,14 +34,17 @@ class household_tax_before_refundable_credits(Variable): "nj_income_tax_before_refundable_credits", "nm_income_tax_before_refundable_credits", "ny_income_tax_before_refundable_credits", + "ok_income_tax_before_refundable_credits", "or_income_tax_before_refundable_credits", "pa_income_tax", # PA has no refundable credits. - "wa_income_tax_before_refundable_credits", - "flat_tax", - "nyc_income_tax_before_refundable_credits", + "ri_income_tax_before_refundable_credits", "ut_income_tax_before_refundable_credits", + "va_income_tax_before_refundable_credits", "vt_income_tax_before_refundable_credits", + "wa_income_tax_before_refundable_credits", "wi_income_tax_before_refundable_credits", + "flat_tax", + "nyc_income_tax_before_refundable_credits", ] def formula(household, period, parameters): From bc0a9ef5aa23cc6f936de000defdfd8b17a36c7e Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 21:36:15 -0600 Subject: [PATCH 24/29] Updated states in household_state_income_tax.py --- fiscalsim_us/variables/gov/states/README.md | 1 + .../household/household_state_income_tax.py | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/README.md b/fiscalsim_us/variables/gov/states/README.md index b4fcb91c9..20b46040a 100644 --- a/fiscalsim_us/variables/gov/states/README.md +++ b/fiscalsim_us/variables/gov/states/README.md @@ -43,4 +43,5 @@ If you do not write tests for new variables created, the code coverage tests wil * [`state_income_tax`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py): You need to add your state's `[2-letter-state-abbrev]_income_tax` variable to the list in the `adds` command. * [`state_income_tax_before_refundable_credits`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/gov/states/tax/income/state_income_tax_before_refundable_credits.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command. * [`household_refundable_tax_credits`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_refundable_tax_credits.py): You need to add your state's `[2-letter-state-abbrev]_refundable_credits` variable to the list in the `adds` command. +* [`household_state_income_tax.py`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_state_income_tax.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command and your state's `[2-letter-state-abbrev]_refundable_credits` variable to the list in the `subtracts` command. * [`household_tax_before_refundable_credits`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_tax_before_refundable_credits.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command. diff --git a/fiscalsim_us/variables/household/income/household/household_state_income_tax.py b/fiscalsim_us/variables/household/income/household/household_state_income_tax.py index d6a8636b6..02fa574c6 100644 --- a/fiscalsim_us/variables/household/income/household/household_state_income_tax.py +++ b/fiscalsim_us/variables/household/income/household/household_state_income_tax.py @@ -16,23 +16,31 @@ class household_state_income_tax(Variable): "il_total_tax", "in_income_tax_before_refundable_credits", "ks_income_tax_before_refundable_credits", + "ky_income_tax_before_refundable_credits", + "la_income_tax_before_refundable_credits", "me_income_tax_before_refundable_credits", "ma_income_tax_before_refundable_credits", "md_income_tax_before_refundable_credits", "mn_income_tax_before_refundable_credits", + "mt_income_tax_before_refundable_credits", "mo_income_tax_before_refundable_credits", "nc_income_tax", "nd_income_tax_before_refundable_credits", "ne_income_tax_before_refundable_credits", "nh_income_tax_before_refundable_credits", "nj_income_tax_before_refundable_credits", + "nm_income_tax_before_refundable_credits", "ny_income_tax_before_refundable_credits", + "ok_income_tax_before_refundable_credits", "or_income_tax_before_refundable_credits", "pa_income_tax", - "wa_income_tax_before_refundable_credits", - "nyc_income_tax_before_refundable_credits", + "ri_income_tax_before_refundable_credits", "ut_income_tax_before_refundable_credits", + "va_income_tax_before_refundable_credits", + "vt_income_tax_before_refundable_credits", + "wa_income_tax_before_refundable_credits", "wi_income_tax_before_refundable_credits", + "nyc_income_tax_before_refundable_credits", ] subtracts = [ "ca_refundable_credits", # California. @@ -42,22 +50,32 @@ class household_state_income_tax(Variable): "il_refundable_credits", # Illinois. "in_refundable_credits", # Indiana. "ks_refundable_credits", # Kansas. + "ky_refundable_credits", # Kentucky. + "la_refundable_credits", # Louisiana. "ma_refundable_credits", # Massachusetts. "me_refundable_credits", # Maine. "md_refundable_credits", # Maryland. "mn_refundable_credits", # Minnesota. + "mt_refundable_credits", # Montana. "mo_refundable_credits", # Missouri. # Skip NC, which has no refundable credits. "nd_refundable_credits", # North Dakota. "ne_refundable_credits", # Nebraska. "nh_refundable_credits", # New Hampshire. + "nj_refundable_credits", # New Jersey. + "nm_refundable_credits", # New Mexico. "ny_refundable_credits", # New York. + "ok_refundable_credits", # Oklahoma. "or_refundable_credits", # Oregon. # Skip PA, which has no refundable credits. - "wa_refundable_credits", # Washington. - "nyc_refundable_credits", # New York City. + "ri_refundable_credits", # Rhode Island. "ut_refundable_credits", # Utah. + "va_refundable_credits", # Virginia. + "vt_refundable_credits", # Vermont. + "wa_refundable_credits", # Washington. "wi_refundable_credits", # Wisconsin. + # LOCAL + "nyc_refundable_credits", # New York City. ] def formula(tax_unit, period, parameters): From b739f4cf6fe5b589bd4b759b1778f297994d9f31 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 21:37:37 -0600 Subject: [PATCH 25/29] Updated time in changelog files --- CHANGELOG.md | 2 +- changelog.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a87e0f47..2a92ee79e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.2.5] - 2023-10-24 20:00:00 +## [0.2.5] - 2023-10-24 22:00:00 ### Added diff --git a/changelog.yaml b/changelog.yaml index 3e38ca0bf..aa9a8c1fa 100644 --- a/changelog.yaml +++ b/changelog.yaml @@ -168,4 +168,4 @@ added: - Updated environment.yml and build_and_test.yml to allow for python 3.11 - Updated Virginia tax logic with correct mapping from federal filing status to state filing status. - date: 2023-10-24 20:00:00 + date: 2023-10-24 22:00:00 From 4b238621f0253ebbe49e262d467754f817a9bac9 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 21:44:50 -0600 Subject: [PATCH 26/29] Updated variables/states/README.md --- fiscalsim_us/variables/gov/states/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/README.md b/fiscalsim_us/variables/gov/states/README.md index 20b46040a..28df5d583 100644 --- a/fiscalsim_us/variables/gov/states/README.md +++ b/fiscalsim_us/variables/gov/states/README.md @@ -41,7 +41,7 @@ If you do not write tests for new variables created, the code coverage tests wil ## Higher level variables to which you need to add (connect) your state variables * [`state_income_tax`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py): You need to add your state's `[2-letter-state-abbrev]_income_tax` variable to the list in the `adds` command. -* [`state_income_tax_before_refundable_credits`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/gov/states/tax/income/state_income_tax_before_refundable_credits.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command. -* [`household_refundable_tax_credits`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_refundable_tax_credits.py): You need to add your state's `[2-letter-state-abbrev]_refundable_credits` variable to the list in the `adds` command. +* [`state_income_tax_before_refundable_credits.py`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/gov/states/tax/income/state_income_tax_before_refundable_credits.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command. +* [`household_refundable_tax_credits.py`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_refundable_tax_credits.py): You need to add your state's `[2-letter-state-abbrev]_refundable_credits` variable to the list in the `adds` command. * [`household_state_income_tax.py`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_state_income_tax.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command and your state's `[2-letter-state-abbrev]_refundable_credits` variable to the list in the `subtracts` command. * [`household_tax_before_refundable_credits`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_tax_before_refundable_credits.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command. From 78876f381facd100ee3a6e849e33cacc9e384e16 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 21:46:57 -0600 Subject: [PATCH 27/29] Updated variables/states/README.md --- fiscalsim_us/variables/gov/states/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fiscalsim_us/variables/gov/states/README.md b/fiscalsim_us/variables/gov/states/README.md index 28df5d583..e208225b4 100644 --- a/fiscalsim_us/variables/gov/states/README.md +++ b/fiscalsim_us/variables/gov/states/README.md @@ -44,4 +44,4 @@ If you do not write tests for new variables created, the code coverage tests wil * [`state_income_tax_before_refundable_credits.py`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/gov/states/tax/income/state_income_tax_before_refundable_credits.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command. * [`household_refundable_tax_credits.py`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_refundable_tax_credits.py): You need to add your state's `[2-letter-state-abbrev]_refundable_credits` variable to the list in the `adds` command. * [`household_state_income_tax.py`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_state_income_tax.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command and your state's `[2-letter-state-abbrev]_refundable_credits` variable to the list in the `subtracts` command. -* [`household_tax_before_refundable_credits`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_tax_before_refundable_credits.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command. +* [`household_tax_before_refundable_credits.py`](https://github.com/TheCGO/fiscalsim-us/blob/main/fiscalsim_us/variables/household/income/household/household_tax_before_refundable_credits.py): You need to add your state's `[2-letter-state-abbrev]_income_tax_before_refundable_credits` variable to the list in the `adds` command. From 1576d9eec18a3c6fd31572bbe8db0a86994b30f0 Mon Sep 17 00:00:00 2001 From: Richard Evans Date: Tue, 24 Oct 2023 23:49:22 -0600 Subject: [PATCH 28/29] Updated main folder variables with file name not matching variable name --- .../va/tax/income/va_disability_income_reported_as_wages.py | 2 +- .../states/va/tax/income/va_fixed_date_conformity_additions .py | 2 +- .../va/tax/income/va_fixed_date_conformity_subtractions.py | 2 +- .../va/tax/income/va_income_from_obligations_fed_exempt.py | 2 +- .../va/tax/income/va_income_from_obligations_state_exempt.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_disability_income_reported_as_wages.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_disability_income_reported_as_wages.py index 8d6c42674..0857a8467 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_disability_income_reported_as_wages.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_disability_income_reported_as_wages.py @@ -1,7 +1,7 @@ from fiscalsim_us.model_api import * -class disability_income_reported_as_wages(Variable): +class va_disability_income_reported_as_wages(Variable): value_type = float entity = TaxUnit label = "VA disability income reported as wages - https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2021/760-2021.pdf" diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_additions .py b/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_additions .py index 991db0a4c..e0dc8e4fa 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_additions .py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_additions .py @@ -1,7 +1,7 @@ from fiscalsim_us.model_api import * -class fixed_date_conformity_additions(Variable): +class va_fixed_date_conformity_additions(Variable): value_type = float entity = TaxUnit label = "Va fixed date conformity additions https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2021/schedule-adj-2021.pdf" diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_subtractions.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_subtractions.py index 868d183bb..0680ff88e 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_subtractions.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_fixed_date_conformity_subtractions.py @@ -1,7 +1,7 @@ from fiscalsim_us.model_api import * -class fixed_date_conformity_subtractions(Variable): +class va_fixed_date_conformity_subtractions(Variable): value_type = float entity = TaxUnit label = "Va fixed date conformity subtractions https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2021/schedule-adj-2021.pdf" diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_fed_exempt.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_fed_exempt.py index 3465d3301..bb62cecd2 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_fed_exempt.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_fed_exempt.py @@ -1,7 +1,7 @@ from fiscalsim_us.model_api import * -class income_from_obligations_fed_exempt(Variable): +class va_income_from_obligations_fed_exempt(Variable): value_type = float entity = TaxUnit label = "VA income from obligations that are federally exempt https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2021/schedule-adj-2021.pdf" diff --git a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_state_exempt.py b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_state_exempt.py index c01fb6c06..5ee2d9571 100644 --- a/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_state_exempt.py +++ b/fiscalsim_us/variables/gov/states/va/tax/income/va_income_from_obligations_state_exempt.py @@ -1,7 +1,7 @@ from fiscalsim_us.model_api import * -class income_from_obligations_state_exempt(Variable): +class va_income_from_obligations_state_exempt(Variable): value_type = float entity = TaxUnit label = "VA income from obligations that are state exempt https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2021/schedule-adj-2021.pdf" From 0e1eecf22d3f3c981f05567120487108fa63a94d Mon Sep 17 00:00:00 2001 From: mitchellpound Date: Sat, 28 Oct 2023 12:08:18 -0600 Subject: [PATCH 29/29] Added la_agi_subtractions tests back --- .../la/tax/income/la_agi_subtractions.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 fiscalsim_us/tests/policy/baseline/gov/states/la/tax/income/la_agi_subtractions.yaml diff --git a/fiscalsim_us/tests/policy/baseline/gov/states/la/tax/income/la_agi_subtractions.yaml b/fiscalsim_us/tests/policy/baseline/gov/states/la/tax/income/la_agi_subtractions.yaml new file mode 100644 index 000000000..b3ef8033c --- /dev/null +++ b/fiscalsim_us/tests/policy/baseline/gov/states/la/tax/income/la_agi_subtractions.yaml @@ -0,0 +1,16 @@ +- name: LA subtractions from income + period: 2021 + absolute_error_margin: 0 + input: + filing_status: SINGLE + adjusted_gross_income: 100_000 + us_govt_interest: 1_000 + tax_unit_taxable_social_security: 1_000 + la_state_employee_retirement_benefits: 1_000 + la_state_teacher_retirement_benefits: 1_000 + la_federal_retirement_benefits: 1_000 + la_other_subtractions: 1_000 + la_exemptions: 0 + state_code: LA + output: + la_taxable_income: 94_000