-
Notifications
You must be signed in to change notification settings - Fork 186
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
Correct Income Exclusion Order and FBR Comparison for SSI Spousal Deeming #5615
base: master
Are you sure you want to change the base?
Conversation
…le income separately - 2. Compare it to the difference between couple and individual rates - 3. Only deem income if it exceeds that threshold - 4. Apply the correct deeming formula based on SSI regulations
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5615 +/- ##
==========================================
- Coverage 99.10% 99.07% -0.03%
==========================================
Files 2695 2695
Lines 39028 38989 -39
Branches 173 171 -2
==========================================
- Hits 38677 38630 -47
- Misses 316 326 +10
+ Partials 35 33 -2 ☔ View full report in Codecov by Sentry. |
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.
minor stylistic suggestions but adding pavel for a logic review
could you also link the issue?
age: 55 | ||
is_disabled: false | ||
is_tax_unit_head: true | ||
ssi_earned_income: 31080 |
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.
and elsewhere
ssi_earned_income: 31080 | |
ssi_earned_income: 31_080 |
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.
do this everywhere
) | ||
|
||
return spousal_deemed_income * (spousal_deemed_income > person_rate) | ||
return where( |
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.
return where( | |
return (is_eligible & has_ineligible_spouse) * deemed_income |
|
||
# Check if they're in a marital unit | ||
in_marital_unit = person.marital_unit.any( | ||
person("is_tax_unit_spouse", 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.
person("is_tax_unit_spouse", period) | |
person("is_tax_unit_head_or_spouse", period) |
Updated with the requested changes. Linking issue here. |
# Check if they're in a marital unit | ||
in_marital_unit = person.marital_unit.any( | ||
person("is_tax_unit_head_or_spouse", period) | ||
| person("is_tax_unit_head", 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.
| person("is_tax_unit_head", period) |
@@ -10,7 +10,24 @@ class is_ssi_ineligible_spouse(Variable): | |||
reference = "https://www.law.cornell.edu/uscode/text/42/1382c#b" | |||
|
|||
def formula(person, period, parameters): | |||
spouse = person("is_tax_unit_spouse", period) | |||
# Consider both tax unit spouse and tax unit head as potential spouses | |||
is_spouse = person("is_tax_unit_spouse", period) | person( |
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.
just use person("is_tax_unit_head_or_spouse", period)
Thanks! Should be linked now and pushed up an update. |
@@ -10,7 +10,21 @@ class is_ssi_ineligible_spouse(Variable): | |||
reference = "https://www.law.cornell.edu/uscode/text/42/1382c#b" | |||
|
|||
def formula(person, period, parameters): | |||
spouse = person("is_tax_unit_spouse", period) | |||
# Consider both tax unit spouse and tax unit head as potential spouses | |||
is_spouse = person("is_tax_unit_head_or_spouse", 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.
is_spouse = person("is_tax_unit_head_or_spouse", period) | |
is_head_or_spouse = person("is_tax_unit_head_or_spouse", period) |
|
||
# Check if they're in a marital unit | ||
in_marital_unit = person.marital_unit.any( | ||
person("is_tax_unit_head_or_spouse", 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.
person("is_tax_unit_head_or_spouse", period) | |
is_head_or_spouse |
# Consider both tax unit spouse and tax unit head as potential spouses | ||
is_spouse = person("is_tax_unit_head_or_spouse", period) | ||
|
||
# Check if they're in a marital unit |
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.
what's the purpose of this; won't it always be true? if they're themselves a head or spouse, their marital unit will have a head or spouse
…nt marital unit check.
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.
could you amend the corresponding test file to reflect the changes?
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.
There is no existing test file for this (this was an existing file). I created ssi_income_deemed_from_ineligible_spouse.yaml
instead to test the output.
Thanks I added @DTrim99 to review the logic. He's out of office tomorrow but will review next week. Could you resolve outstanding comments in the meantime? |
Thanks! I believe I've addressed all of the latest comments in the last update. Is there one I missed specifically? |
Fixes #5608
This resolves incorrect benefit calculations and ensures compliance with SSI regulations §416.1163 for spousal deeming cases.