TheCGO / fiscalsim-us

FiscalSim US is a microsimulation model of the US federal and state tax and benefit system relating to households and individuals.
https://thecgo.github.io/fiscalsim-us/
GNU Affero General Public License v3.0
9 stars 12 forks source link

Added MN income tax logic #32

Closed mitchellpound closed 10 months ago

mitchellpound commented 1 year ago

Added Minnesota income tax logic

mitchellpound commented 1 year ago

@rickecon, I vectorized all the functions so now they are passing tests on my local machine. So they should be set if you want to approve the workflows for this PR.

mitchellpound commented 1 year ago

@rickecon, I merged the formatting from the existing PolicyEngine files for Minnesota and my work. I checked for bugs, and it all works on my local computer and I'm getting similar results to before. So it should be good to go.

rickecon commented 1 year ago

@mitchellpound. This is great. Your MN AMT logic is different than the logic on which the current tests are based. The 14 tests failing in the GitHub Actions are the following:

=========================== short test summary info ============================
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_amt.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_amt.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_amt.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_amt.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_amt_taxable_income.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_amt_taxable_income.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_integration.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_itemized_deductions.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_itemized_deductions.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_itemized_deductions.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_standard_deduction.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_standard_deduction.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_standard_deduction.yaml::
FAILED fiscalsim_us/tests/policy/baseline/gov/states/mn/tax/income/mn_taxable_income.yaml::
================== 14 failed, 1813 passed in 94.93s (0:01:34) ==================

My recommendation is to go through each of those tests and adjust the amounts/values to match with what your code in the PR produces.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% :tada:

Comparison is base (99a6e9f) 97.34% compared to head (cd41b35) 97.36%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #32 +/- ## ========================================== + Coverage 97.34% 97.36% +0.01% ========================================== Files 1336 1354 +18 Lines 20880 21033 +153 Branches 162 161 -1 ========================================== + Hits 20325 20478 +153 Misses 534 534 Partials 21 21 ``` | [Files Changed](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO) | Coverage Δ | | |---|---|---| | [...ates/mn/tax/income/additions/mn\_other\_additions.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvYWRkaXRpb25zL21uX290aGVyX2FkZGl0aW9ucy5weQ==) | `100.00% <100.00%> (ø)` | | | [.../states/mn/tax/income/amt/mn\_adustments\_fed6251.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvYW10L21uX2FkdXN0bWVudHNfZmVkNjI1MS5weQ==) | `100.00% <100.00%> (ø)` | | | [...s/variables/gov/states/mn/tax/income/amt/mn\_amt.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvYW10L21uX2FtdC5weQ==) | `100.00% <100.00%> (ø)` | | | [.../states/mn/tax/income/amt/mn\_amt\_taxable\_income.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvYW10L21uX2FtdF90YXhhYmxlX2luY29tZS5weQ==) | `100.00% <100.00%> (ø)` | | | [...ables/gov/states/mn/tax/income/amt/mn\_depletion.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvYW10L21uX2RlcGxldGlvbi5weQ==) | `100.00% <100.00%> (ø)` | | | [.../mn/tax/income/amt/mn\_intangible\_drilling\_costs.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvYW10L21uX2ludGFuZ2libGVfZHJpbGxpbmdfY29zdHMucHk=) | `100.00% <100.00%> (ø)` | | | [...v/states/mn/tax/income/amt/non\_mn\_bond\_interest.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvYW10L25vbl9tbl9ib25kX2ludGVyZXN0LnB5) | `100.00% <100.00%> (ø)` | | | [.../mn/tax/income/credits/mn\_nonrefundable\_credits.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvY3JlZGl0cy9tbl9ub25yZWZ1bmRhYmxlX2NyZWRpdHMucHk=) | `100.00% <100.00%> (ø)` | | | [...x/income/credits/mn\_other\_nonrefundable\_credits.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvY3JlZGl0cy9tbl9vdGhlcl9ub25yZWZ1bmRhYmxlX2NyZWRpdHMucHk=) | `100.00% <100.00%> (ø)` | | | [.../tax/income/credits/mn\_other\_refundable\_credits.py](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO#diff-ZmlzY2Fsc2ltX3VzL3ZhcmlhYmxlcy9nb3Yvc3RhdGVzL21uL3RheC9pbmNvbWUvY3JlZGl0cy9tbl9vdGhlcl9yZWZ1bmRhYmxlX2NyZWRpdHMucHk=) | `100.00% <100.00%> (ø)` | | | ... and [19 more](https://app.codecov.io/gh/TheCGO/fiscalsim-us/pull/32?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheCGO) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rickecon commented 10 months ago

@mitchellpound. I am ready to merge this PR as soon as you update your branch to resolve the merge conflicts.

rickecon commented 10 months ago

Thanks @mitchellpound. This is great. Merging.