Skip to content
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

change is_widowed to is_surviving_spouse #5108

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
added:
- Change is_widowed to is_surviving_spouse.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
person1:
age: 64
is_tax_unit_head: 1
is_widowed: True
is_surviving_spouse: True
person2:
age: 64
is_tax_unit_spouse: 1
is_widowed: False
is_surviving_spouse: False
tax_units:
tax_unit:
members: [person1, person2]
Expand All @@ -27,11 +27,11 @@
person1:
age: 64
is_tax_unit_head: 1
is_widowed: False
is_surviving_spouse: False
person2:
age: 64
is_tax_unit_spouse: 1
is_widowed: False
is_surviving_spouse: False
tax_units:
tax_unit:
members: [person1, person2]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
- name: Widowed head without dependents is not eligible to file as surviving spouse.
- name: Surviving spouse head without dependents is not eligible to file as surviving spouse.
period: 2022
input:
people:
head:
is_widowed: true
is_surviving_spouse: true
tax_units:
tax_unit:
members: [head]
output:
surviving_spouse_eligible: false

- name: Widowed head with one dependent is eligible.
- name: Surviving spouse head with one dependent is eligible.
period: 2022
input:
people:
head:
is_tax_unit_head: true
is_widowed: true
is_surviving_spouse: true
child: {}
tax_units:
tax_unit:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
output:
filing_status: SINGLE

- name: Remove head of household filing status for widowed filers without children
- name: Remove head of household filing status for surviving spouse filers without children
period: 2023
reforms: policyengine_us.reforms.congress.romney.family_security_act.remove_head_of_household.remove_head_of_household
input:
gov.contrib.congress.romney.family_security_act.remove_head_of_household : true
people:
head:
is_tax_unit_head: true
is_widowed: true
is_surviving_spouse: true
tax_units:
tax_unit:
members: [head]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def formula(tax_unit, period, parameters):
blind = person("is_blind", period)
# Deaf filers get an additional personal tax credit amount
deaf = person("is_deaf", period)
# Widowed and head of household filers receive an additional credit amount
# Surviving spouse and head of household filers receive an additional credit amount
filing_status = tax_unit("filing_status", period)
statuses = filing_status.possible_values
widow = filing_status == statuses.SURVIVING_SPOUSE
surviving_spouse = filing_status == statuses.SURVIVING_SPOUSE
hoh = filing_status == statuses.HEAD_OF_HOUSEHOLD
filing_status_eligible = widow | hoh
filing_status_eligible = surviving_spouse | hoh

personal_credit_count = tax_unit.sum(
head_or_spouse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class la_widow_exemption(Variable):

def formula(tax_unit, period, parameters):
person = tax_unit.members
is_widowed = tax_unit.any(person("is_widowed", period))
is_surviving_spouse = tax_unit.any(
person("is_surviving_spouse", period)
)
p = parameters(period).gov.states.la.tax.income.exemptions
return is_widowed * p.widow
return is_surviving_spouse * p.widow
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from policyengine_us.model_api import *


class is_widowed(Variable):
class is_surviving_spouse(Variable):
value_type = bool
entity = Person
label = "Widowed"
documentation = "Whether the person is widowed."
label = "Surviving Spouse"
documentation = "Whether the person is a surviving spouse."
definition_period = YEAR
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also change the corresponding tests?
For example surviving_spouse_eligible.yaml still uses is_widowed as an input

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to search in the codespace

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also label and documentation

Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class surviving_spouse_eligible(Variable):
reference = "https://www.law.cornell.edu/uscode/text/26/2#a"

def formula(tax_unit, period, parameters):
# The widowed filing status should only apply to widowed heads
# The surviving spouse filing status should only apply to surviving spouse heads
# who maintain a household for at least one dependent
person = tax_unit.members
is_head = person("is_tax_unit_head", period)
is_widowed = person("is_widowed", period)
widowed_head = tax_unit.any(is_head & is_widowed)
is_surviving_spouse = person("is_surviving_spouse", period)
surviving_spouse_head = tax_unit.any(is_head & is_surviving_spouse)
has_child_dependents = (
tax_unit("tax_unit_child_dependents", period) > 0
)
married = tax_unit("tax_unit_married", period)
return widowed_head & has_child_dependents & ~married
return surviving_spouse_head & has_child_dependents & ~married