PSLmodels / Tax-Calculator

USA Federal Individual Income and Payroll Tax Microsimulation Model
https://taxcalc.pslmodels.org
Other
262 stars 157 forks source link

Parameterize the limitation on capital losses #2707

Closed jdebacker closed 9 months ago

jdebacker commented 11 months ago

This PR addresses Issue #2632 by parameterizing the capital loss limitation.

codecov[bot] commented 11 months ago

Codecov Report

Merging #2707 (bf6332a) into master (6798fba) will not change coverage. Report is 1 commits behind head on master. The diff coverage is n/a.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2707/graphs/tree.svg?width=650&height=150&src=pr&token=KqtTvRSNjQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2707?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) ```diff @@ Coverage Diff @@ ## master #2707 +/- ## ======================================= Coverage 98.54% 98.54% ======================================= Files 14 14 Lines 2609 2609 ======================================= Hits 2571 2571 Misses 38 38 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2707/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2707/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `98.54% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2707?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [taxcalc/utils.py](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2707?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-dGF4Y2FsYy91dGlscy5weQ==) | `97.79% <ø> (ø)` | |
jdebacker commented 11 months ago

@MattHJensen This PR is ready for your review. Thanks!

MattHJensen commented 11 months ago

@jdebacker, do you think we should protect puf and cps users from setting this parameter outside of the ranges supported by their data? Or say this param isn't compatible with those data?

jdebacker commented 11 months ago

@MattHJensen Good point about data limitations affecting this parameter's usefulness. To address this concern, I've added a note about this in the "notes" metadata field for the capital_loss_limitation parameter.

Note that I am reluctant to set "puf": false in the compatible_data field because the parameter will work with the PUF as expected, so long as the values is less than or equal to the current law value (as the PUF does not provide information on capital losses beyond the current law limit).

Do you think this is satisfactory?

jdebacker commented 9 months ago

@MattHJensen I think this PR is ready to merge. Let me know if you have further thoughts. Will merge if I don't hear back in about 24hrs. Thanks!