Add structural federal mortgage interest deduction#7875
Merged
Conversation
f74b1b0 to
c50abc1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7875 +/- ##
============================================
+ Coverage 71.46% 100.00% +28.53%
============================================
Files 4099 4 -4095
Lines 59132 146 -58986
Branches 288 0 -288
============================================
- Hits 42257 146 -42111
+ Misses 16869 0 -16869
+ Partials 6 0 -6
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:
|
- Document the sentinel behavior of origination_year == 0 in _mortgage_balance_cap - Explain the mathematical equivalence of _limited_mortgage_balance to the statutory formula - Add test verifying graceful handling when no structural mortgage inputs are provided Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Reviewed and approved. The MID math checks out against §163(h)(3)(F) for multiple scenarios (grandfathered, post-TCJA, mixed-vintage, MFS half-caps). Original code written by Codex; Claude Code reviewed, verified the statutory logic, and pushed minor improvements:
|
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
Testing
uv run ruff format --check policyengine_us/variables/household/expense/person/deductible_mortgage_interest.py policyengine_us/variables/household/expense/person/non_deductible_mortgage_interest.py policyengine_us/variables/household/expense/person/home_mortgage_interest_share.py policyengine_us/variables/household/expense/tax_unit/mortgage_interest_structure.pyuv run ruff check policyengine_us/variables/household/expense/person/deductible_mortgage_interest.py policyengine_us/variables/household/expense/person/non_deductible_mortgage_interest.py policyengine_us/variables/household/expense/person/home_mortgage_interest_share.py policyengine_us/variables/household/expense/tax_unit/mortgage_interest_structure.pyuv run python -m py_compile policyengine_us/variables/household/expense/person/deductible_mortgage_interest.py policyengine_us/variables/household/expense/person/non_deductible_mortgage_interest.py policyengine_us/variables/household/expense/person/home_mortgage_interest_share.py policyengine_us/variables/household/expense/tax_unit/mortgage_interest_structure.pyuv run python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/deductions/deductible_mortgage_interest.yaml -c policyengine_usuv run python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/states/ms/tax/income/deductions/itemized/integration.yaml policyengine_us/tests/policy/baseline/gov/states/nc/tax/income/deductions/nc_itemized_deductions.yaml policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/taxable_income/deductions/pr_mortgage_deduction.yaml -c policyengine_usRelated