-
Notifications
You must be signed in to change notification settings - Fork 201
Add select_filing_status_value utility function #7243
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
Open
MaxGhenis
wants to merge
1
commit into
main
Choose a base branch
from
filing-status-utility
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| - bump: minor | ||
| changes: | ||
| added: | ||
| - Added select_filing_status_value utility function for cleaner filing status selection with SINGLE as default. | ||
| changed: | ||
| - Refactored MD, CA, NY, AL, GA income tax calculations to use select_filing_status_value utility. |
55 changes: 55 additions & 0 deletions
55
policyengine_us/tests/tools/test_filing_status_utility.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Test that select_filing_status_value works correctly with MD income tax | ||
| - name: Test filing status utility with MD tax - single filer | ||
| period: 2024 | ||
| input: | ||
| people: | ||
| person: | ||
| age: 30 | ||
| tax_units: | ||
| tax_unit: | ||
| members: [person] | ||
| md_taxable_income: 50_000 | ||
| households: | ||
| household: | ||
| members: [person] | ||
| state_code: MD | ||
| output: | ||
| md_income_tax_before_credits: 2_322.50 | ||
|
|
||
| - name: Test filing status utility with MD tax - joint filers | ||
| period: 2024 | ||
| input: | ||
| people: | ||
| head: | ||
| age: 30 | ||
| spouse: | ||
| age: 28 | ||
| tax_units: | ||
| tax_unit: | ||
| members: [head, spouse] | ||
| md_taxable_income: 100_000 | ||
| households: | ||
| household: | ||
| members: [head, spouse] | ||
| state_code: MD | ||
| output: | ||
| md_income_tax_before_credits: 4_697.50 | ||
|
|
||
| - name: Test filing status utility with MD tax - head of household | ||
| period: 2024 | ||
| input: | ||
| people: | ||
| head: | ||
| age: 35 | ||
| child: | ||
| age: 10 | ||
| tax_units: | ||
| tax_unit: | ||
| members: [head, child] | ||
| md_taxable_income: 75_000 | ||
| households: | ||
| household: | ||
| members: [head, child] | ||
| state_code: MD | ||
| output: | ||
| md_income_tax_before_credits: 3_510.00 |
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
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
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
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
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
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
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.
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 like the simplification. Question: does this only work with scale parameters (single amounts, marginal rates)? If not, can we have an example of a select function without a scale parameter