Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add state-level summary tax variables #5436

Merged
merged 13 commits into from
Jan 7, 2025

Conversation

MaxGhenis
Copy link
Contributor

@MaxGhenis MaxGhenis commented Jan 4, 2025

Fix #5435

Adds:

  • state_eitc
  • state_ctc
  • state_cdcc
  • state_property_tax_credit
  • state_agi
  • state_standard_deduction
  • state_itemized_deductions
  • state_taxable_income

Also includes a script to generate all the variables for states that allow married filing separately on same return, e.g. coalescing dc_taxable_income_indiv and dc_taxable_income_joint into dc_taxable_income.

Copy link

codecov bot commented Jan 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.04%. Comparing base (f4c9441) to head (4718486).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #5436    +/-   ##
========================================
  Coverage   99.04%   99.04%            
========================================
  Files        2649     2670    +21     
  Lines       38447    38717   +270     
  Branches      168      168            
========================================
+ Hits        38078    38348   +270     
  Misses        335      335            
  Partials       34       34            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@PavelMakarchuk PavelMakarchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of other credits with similar concerns around start / end dates - integration tests could show whether it is worth adopting specific logic (reviewed states until MD)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have commonly returned the adjusted_gross_income for states which adopt federal AGI for integration testing purposes - it could be worth creating state specific AGI variables with an adds = adjusted_gross_income function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's address that separately. I filed #5440

- id_ctc # Idaho Child Tax Credit
- il_ctc # Illinois Child Tax Credit
- ma_dependent_credit # Massachusetts Dependent Credit
- md_ctc # Maryland Child Tax Credit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mn_child_and_working_families_credits would be worth adding since it dependents on the number of CTC eligible children

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added here and in state_eitcs.yaml

- md_eitc # Maryland
- me_eitc # Maine
- mi_eitc # Michigan
- mn_wfc # Minnesota (called “Working Family Credit”)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this credit was discontinued in 2023 - we need to make a second list post 2023 for the value to not be returned

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's address in #5441

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar as AGI - we have returned the federal value for the state field in TAXSIM when testing

0000-01-01:
- ar
- de
- ia
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IA married filing separately option as disabled in 2023

0000-01-01:
- az_dependent_tax_credit # Arizona Dependent Tax Credit
- ca_yctc # California Young Child Tax Credit
- co_ctc # Colorado Child Tax Credit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CO CTC was adopted in 2022 - I am not sure if the value will be returned as 0 or n/a when testing for 2021

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar concern for all periods before 2021 - could we add on integration test for all of the created variables just to see if it is supported for each year (e.g. 2020 - 2024)

- co_ctc # Colorado Child Tax Credit
- co_family_affordability_credit # Colorado Family Affordability Credit
- ct_child_tax_rebate # Connecticut Child Tax Rebate
- dc_ctc # District of Columbia Child Tax Credit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only available starting in 2025

Suggested change
- dc_ctc # District of Columbia Child Tax Credit
- dc_ctc # District of Columbia Child Tax Credit

- ca_yctc # California Young Child Tax Credit
- co_ctc # Colorado Child Tax Credit
- co_family_affordability_credit # Colorado Family Affordability Credit
- ct_child_tax_rebate # Connecticut Child Tax Rebate
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- ct_child_tax_rebate # Connecticut Child Tax Rebate
- ct_child_tax_rebate # Connecticut Child Tax Rebate

only applicable in 2022 but this would return a value for 2023 and forward

- co_family_affordability_credit # Colorado Family Affordability Credit
- ct_child_tax_rebate # Connecticut Child Tax Rebate
- dc_ctc # District of Columbia Child Tax Credit
- id_ctc # Idaho Child Tax Credit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- id_ctc # Idaho Child Tax Credit
- id_ctc # Idaho Child Tax Credit

The credit will be discontinued in 2026

- ct_child_tax_rebate # Connecticut Child Tax Rebate
- dc_ctc # District of Columbia Child Tax Credit
- id_ctc # Idaho Child Tax Credit
- il_ctc # Illinois Child Tax Credit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- il_ctc # Illinois Child Tax Credit
- il_ctc # Illinois Child Tax Credit

The IL CTC is available starting in 2024

@MaxGhenis
Copy link
Contributor Author

MaxGhenis commented Jan 6, 2025

Can we address the year piece in a separate PR per #5441? I'd like to get this in to start using in policyengine-taxsim.

@PavelMakarchuk
Copy link
Collaborator

Can we address the year piece in a separate PR per #5441? I'd like to get this in to start using in policyengine-taxsim.

Sure, can we just add one integration test here? Just one household for the years 2021 - 2024 with the new variables as outputs, just to check whether it returns 0s or na's (any state such as IL, CT or DC with program parameter values post 2021)

@PavelMakarchuk
Copy link
Collaborator

Error message:

../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/runner.py:341: in from_call
    result: TResult | None = func()
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/runner.py:242: in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_hooks.py:513: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_callers.py:182: in _multicall
    return outcome.get_result()
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_result.py:100: in get_result
    raise exc.with_traceback(exc.__traceback__)
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_callers.py:167: in _multicall
    teardown.throw(outcome._exception)
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/threadexception.py:92: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/threadexception.py:68: in thread_exception_runtest_hook
    yield
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_callers.py:167: in _multicall
    teardown.throw(outcome._exception)
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/unraisableexception.py:95: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/unraisableexception.py:70: in unraisable_exception_runtest_hook
    yield
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_callers.py:167: in _multicall
    teardown.throw(outcome._exception)
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/logging.py:848: in pytest_runtest_call
    yield from self._runtest_for(item, "call")
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/logging.py:831: in _runtest_for
    yield
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_callers.py:167: in _multicall
    teardown.throw(outcome._exception)
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/capture.py:879: in pytest_runtest_call
    return (yield)
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_callers.py:167: in _multicall
    teardown.throw(outcome._exception)
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/skipping.py:257: in pytest_runtest_call
    return (yield)
../anaconda3/envs/pe/lib/python3.10/site-packages/pluggy/_callers.py:103: in _multicall
    res = hook_impl.function(*args)
../anaconda3/envs/pe/lib/python3.10/site-packages/_pytest/runner.py:174: in pytest_runtest_call
    item.runtest()
../anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/tools/test_runner.py:263: in runtest
    self.check_output()
../anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/tools/test_runner.py:312: in check_output
    self.check_variable(
../anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/tools/test_runner.py:355: in check_variable
    actual_value = self.simulation.calculate(variable_name, period)
../anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/simulations/simulation.py:472: in calculate
    result = self._calculate(variable_name, period)
../anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/simulations/simulation.py:702: in _calculate
    array = self._run_formula(variable, population, period)
../anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/simulations/simulation.py:927: in _run_formula
    values = values + self.calculate(
../anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/simulations/simulation.py:472: in calculate
    result = self._calculate(variable_name, period)
../anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/simulations/simulation.py:702: in _calculate
    array = self._run_formula(variable, population, period)
../anaconda3/envs/pe/lib/python3.10/site-packages/policyengine_core/simulations/simulation.py:992: in _run_formula
    array = formula(population, period, parameters_at)
E   TypeError: <lambda>() missing 1 required positional argument: 'parameters'

@MaxGhenis
Copy link
Contributor Author

@PavelMakarchuk I changed the test you added to provide a total state AGI summed across the tax unit rather than a list.

@PavelMakarchuk PavelMakarchuk merged commit ceee09b into PolicyEngine:master Jan 7, 2025
4 of 5 checks passed
@MaxGhenis MaxGhenis deleted the MaxGhenis/issue5435 branch January 7, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add summary state-level variables
2 participants