Apply ordered aggregate capping to state nonrefundable credits#7984
Merged
Apply ordered aggregate capping to state nonrefundable credits#7984
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #7984 +/- ##
===========================================
- Coverage 100.00% 97.90% -2.10%
===========================================
Files 1 148 +147
Lines 13 2096 +2083
Branches 0 4 +4
===========================================
+ Hits 13 2052 +2039
- Misses 0 44 +44
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MaxGhenis
approved these changes
Apr 14, 2026
Contributor
MaxGhenis
left a comment
There was a problem hiding this comment.
Reviewed the Maryland refundable CDCC follow-up. The fix now uses the pre-ordering Part B amount for the refundable computation, and the fixture exercises the integrated path from federal CDCC through Maryland tax liability.
This was referenced Apr 14, 2026
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