Skip to content

Refactor NetInvIncTax function in calcfunctions.py module#3047

Merged
martinholmer merged 1 commit into
PSLmodels:masterfrom
martinholmer:NetInvIncTax-review
May 11, 2026
Merged

Refactor NetInvIncTax function in calcfunctions.py module#3047
martinholmer merged 1 commit into
PSLmodels:masterfrom
martinholmer:NetInvIncTax-review

Conversation

@martinholmer
Copy link
Copy Markdown
Collaborator

Sectional banner comments mirror Form 8960 (2025) Parts I and III;
Part II (investment expenses, lines 9-11) is flagged in a one-line
comment as unmodeled (effectively zero). The body is rewritten in
form-line locals (line1, line2, line4c, line5d, line8, line12, line15,
line16) preserving the original arithmetic exactly. The outer max(0.,
NII) is retained as Form 8960 line 12's "If zero or less, enter -0-"
semantics. The inline comment documenting the line 13 MAGI proxy (Form
2555 not modeled) is preserved.

The docstring is rewritten to cite Form 8960 (2025), map each input to
its form line (e00300 line 1, e00600 line 2, e02000 line 4a, -e26270
line 4b, c01000 line 5a, c00100 line 13 MAGI proxy, NIIT_thd[MARS-1]
line 14, NIIT_rt line 17), flag unmodeled items (line 3 annuities,
lines 5b/5c, lines 6/7, all of Part II), document NIIT_PT_taxed as the
line-4b reform knob, and trace niit downstream through C1040 to
Schedule 2 line 12. The e00300 parameter description is corrected from
"Tax-exempt interest income" to "Taxable interest income" to match
records_variables.json (the field was already correctly used in the
formula).

Function signature, parameter ordering, and return tuple unchanged;
no policy parameters or records variables touched.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (08347b0) to head (da5f4ca).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #3047   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines         2721      2721           
=========================================
  Hits          2721      2721           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@martinholmer martinholmer merged commit 8d30113 into PSLmodels:master May 11, 2026
9 checks passed
@martinholmer martinholmer deleted the NetInvIncTax-review branch May 11, 2026 13:53
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.

1 participant