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 4 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
Expand Up @@ -3,7 +3,7 @@
input:
people:
head:
is_widowed: true
is_surviving_spouse: true
tax_units:
tax_unit:
members: [head]
Expand All @@ -16,7 +16,7 @@
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 @@ -21,7 +21,7 @@
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 @@ -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,7 +1,7 @@
from policyengine_us.model_api import *


class is_widowed(Variable):
class is_surviving_spouse(Variable):
value_type = bool
entity = Person
label = "Widowed"
Expand Down
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

Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def formula(tax_unit, period, parameters):
# 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)
widowed_head = tax_unit.any(is_head & is_surviving_spouse)
has_child_dependents = (
tax_unit("tax_unit_child_dependents", period) > 0
)
Expand Down