-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saver's Credit #4015
Saver's Credit #4015
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4015 +/- ##
========================================
Coverage 99.16% 99.17%
========================================
Files 2423 2408 -15
Lines 35074 34855 -219
Branches 171 163 -8
========================================
- Hits 34782 34566 -216
+ Misses 262 259 -3
Partials 30 30 ☔ View full report in Codecov by Sentry. |
policyengine_us/parameters/gov/irs/credits/retirement_saving/age.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/age.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/age.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/age.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/age.yaml
Outdated
Show resolved
Hide resolved
...yengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_eligible_person.py
Outdated
Show resolved
Hide resolved
...yengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_eligible_person.py
Outdated
Show resolved
Hide resolved
...yengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_eligible_person.py
Outdated
Show resolved
Hide resolved
...yengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_eligible_person.py
Outdated
Show resolved
Hide resolved
...yengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_eligible_person.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving.py
Outdated
Show resolved
Hide resolved
...yengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_eligible_person.py
Outdated
Show resolved
Hide resolved
...yengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_eligible_person.py
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/age.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/age.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/head_of_household.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/age_threshold.yaml
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/age_threshold.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/agi_threshold.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/contributions_cap.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/head_of_household.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/head_of_household.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_credit.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_credit.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_credit.py
Outdated
Show resolved
Hide resolved
...yengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_eligible_person.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_credit.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_agi_eligible.py
Outdated
Show resolved
Hide resolved
...yengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_eligible_person.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/retirement_saving_credit.py
Outdated
Show resolved
Hide resolved
...sts/policy/baseline/gov/irs/credits/retirement_saving/retirement_saving_eligible_person.yaml
Outdated
Show resolved
Hide resolved
...ine_us/tests/policy/baseline/gov/irs/credits/retirement_saving/retirement_saving_credit.yaml
Outdated
Show resolved
Hide resolved
...ine_us/tests/policy/baseline/gov/irs/credits/retirement_saving/retirement_saving_credit.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/threshold/agi.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/threshold/agi.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/states/ca/tax/income/credits/renter/amount.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to make some adjustments:
Create 2 match files
head of household (75%)
other (50%)
break the joint.yaml into 3 threshold and 3 rate files
upper
middle
lower
in the calculation when checking which rate is applied we will need to decrease the threshold based on filing status, if not joint
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/match/separate.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/match/single.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/match/widow.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint/threshold/higher.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint/rate/middle.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/savers_credit.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/savers_credit.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/savers_credit.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/savers_credit.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/savers_credit.py
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint/threshold/middle.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/match/separate.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint/rate/higher.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint/rate/lower.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/contributions_cap.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint/rate/middle.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint/rate/lower.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint/threshold/higher.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint/threshold/middle.yaml
Outdated
Show resolved
Hide resolved
@MaxGhenis Does Tax Simulator model all of the non-refundable credits or just the ones that are used in that formula? I don't think I see any other non-refundable credits. this makes me wonder whether the reduction of the tax liability by just the three credits here is accurate (we did not see that logic in the forms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace the rate/threshold file pairs with a single scale parameter. You can then look up the AGI by dividing by the threshold adjustment factors (0.5 for single, etc.)
policyengine_us/parameters/gov/irs/credits/retirement_saving/threshold/agi.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/match/head_of_household.yaml
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/savers_credit_eligible_person.py
Outdated
Show resolved
Hide resolved
policyengine_us/variables/gov/irs/credits/retirement_savings/savers_credit_agi_eligible.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this to tax unit level so it can be the defined_for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if changing this to the tax unit level would be the most accurate representation since we want to check each head and spouse individually (whether they are a student etc.) - e.g. I believe if both made contributions but the head was a student, then the contributions of the spouse would still be eligible for this credit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can make the main calculation person level to include this situation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i think i might have made that comment with respect to an older version of the code, doesn't seem relevant now
policyengine_us/parameters/gov/irs/credits/retirement_saving/rate/joint.yaml
Outdated
Show resolved
Hide resolved
qualified_contributions = add( | ||
person, | ||
period, | ||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this a list parameter and cite https://www.law.cornell.edu/uscode/text/26/25B#d_1 and the relevant sections it sub-cites. this will include other variables we have like 403b contributions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PavelMakarchuk Is this required parameter the same as this one?
This parameter doesn't seem to be used in any variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. We have other examples of list parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. We have other examples of list parameters
Should I overwrite it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make a new list parameter
"traditional_401k_contributions", | ||
], | ||
) | ||
capped_qualified_contributions = min_( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subtract distributions per https://www.law.cornell.edu/uscode/text/26/25B#d_2
], | ||
default=1, | ||
) | ||
# Credit rate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Credit rate | |
adjusted_agi = agi / threshold_adjustment | |
credit_rate = p.rate.joint.calc(adjusted_agi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i think i might have made that comment with respect to an older version of the code, doesn't seem relevant now
Duplicate of newly created #4506 |
Duplicate of #4506 |
Fixes #3841