Apply ordered aggregate capping to state nonrefundable credits#7984
Draft
PavelMakarchuk wants to merge 2 commits intomainfrom
Draft
Apply ordered aggregate capping to state nonrefundable credits#7984PavelMakarchuk wants to merge 2 commits intomainfrom
PavelMakarchuk wants to merge 2 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scope
This PR does not implement the full federal-style
potentialandactual/appliednonrefundable credit pattern for each individual state credit.Instead, it changes how the aggregate nonrefundable credit bucket is applied against pre-credit tax liability in the states covered here. Raw state credit variables remain their underlying potential amounts.
That means this PR is a tax-application-layer cleanup, not the final per-credit redesign.
Follow-up Needed
A follow-up refactor should add federal-style per-credit applied variables so each state nonrefundable credit can expose:
That is the step needed to return true form-order credit values.
Testing
uv run ruff check policyengine_us/variables/gov/states/tax/income/non_refundable_credit_cap.py policyengine_us/variables/gov/states/ar/tax/income/ar_non_refundable_credits.py policyengine_us/variables/gov/states/az/tax/income/az_non_refundable_credits.py policyengine_us/variables/gov/states/ct/tax/income/ct_non_refundable_credits.py policyengine_us/variables/gov/states/dc/tax/income/credits/dc_non_refundable_credits.py policyengine_us/variables/gov/states/de/tax/income/de_non_refundable_credits.py policyengine_us/variables/gov/states/ga/tax/income/ga_non_refundable_credits.py policyengine_us/variables/gov/states/hi/tax/income/hi_non_refundable_credits.py policyengine_us/variables/gov/states/id/tax/income/id_non_refundable_credits.py policyengine_us/variables/gov/states/ky/tax/income/credits/ky_non_refundable_credits.py policyengine_us/variables/gov/states/la/tax/income/la_non_refundable_credits.py policyengine_us/variables/gov/states/ma/tax/income/ma_non_refundable_credits.py policyengine_us/variables/gov/states/md/tax/income/credits/md_non_refundable_credits.py policyengine_us/variables/gov/states/me/tax/income/me_non_refundable_credits.py policyengine_us/variables/gov/states/mo/tax/income/credits/mo_non_refundable_credits.py policyengine_us/variables/gov/states/ms/tax/income/ms_non_refundable_credits.py policyengine_us/variables/gov/states/nc/tax/income/nc_non_refundable_credits.py policyengine_us/variables/gov/states/ny/tax/income/ny_non_refundable_credits.py policyengine_us/variables/gov/states/oh/tax/income/oh_non_refundable_credits.py policyengine_us/variables/gov/states/ri/tax/income/ri_non_refundable_credits.py policyengine_us/variables/gov/states/sc/tax/income/sc_non_refundable_credits.py policyengine_us/variables/gov/states/ut/tax/income/credits/ut_non_refundable_credits.py policyengine_us/variables/gov/states/va/tax/income/va_non_refundable_credits.py policyengine_us/variables/gov/states/wi/tax/income/credits/wi_non_refundable_credits.py policyengine_us/variables/gov/states/wv/tax/income/wv_non_refundable_credits.pyuv run ruff format --check policyengine_us/variables/gov/states/tax/income/non_refundable_credit_cap.py policyengine_us/variables/gov/states/ar/tax/income/ar_non_refundable_credits.py policyengine_us/variables/gov/states/az/tax/income/az_non_refundable_credits.py policyengine_us/variables/gov/states/ct/tax/income/ct_non_refundable_credits.py policyengine_us/variables/gov/states/dc/tax/income/credits/dc_non_refundable_credits.py policyengine_us/variables/gov/states/de/tax/income/de_non_refundable_credits.py policyengine_us/variables/gov/states/ga/tax/income/ga_non_refundable_credits.py policyengine_us/variables/gov/states/hi/tax/income/hi_non_refundable_credits.py policyengine_us/variables/gov/states/id/tax/income/id_non_refundable_credits.py policyengine_us/variables/gov/states/ky/tax/income/credits/ky_non_refundable_credits.py policyengine_us/variables/gov/states/la/tax/income/la_non_refundable_credits.py policyengine_us/variables/gov/states/ma/tax/income/ma_non_refundable_credits.py policyengine_us/variables/gov/states/md/tax/income/credits/md_non_refundable_credits.py policyengine_us/variables/gov/states/me/tax/income/me_non_refundable_credits.py policyengine_us/variables/gov/states/mo/tax/income/credits/mo_non_refundable_credits.py policyengine_us/variables/gov/states/ms/tax/income/ms_non_refundable_credits.py policyengine_us/variables/gov/states/nc/tax/income/nc_non_refundable_credits.py policyengine_us/variables/gov/states/ny/tax/income/ny_non_refundable_credits.py policyengine_us/variables/gov/states/oh/tax/income/oh_non_refundable_credits.py policyengine_us/variables/gov/states/ri/tax/income/ri_non_refundable_credits.py policyengine_us/variables/gov/states/sc/tax/income/sc_non_refundable_credits.py policyengine_us/variables/gov/states/ut/tax/income/credits/ut_non_refundable_credits.py policyengine_us/variables/gov/states/va/tax/income/va_non_refundable_credits.py policyengine_us/variables/gov/states/wi/tax/income/credits/wi_non_refundable_credits.py policyengine_us/variables/gov/states/wv/tax/income/wv_non_refundable_credits.pypython policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/az/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ct/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/il/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ky/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ar/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ga/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/md/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/ny/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/oh/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/wi/tax/income --batches 1python policyengine_us/tests/test_batched.py policyengine_us/tests/policy/baseline/gov/states/wv/tax/income --batches 1