From ad0d2abc9102c5da22eca84c12333590d5947ed5 Mon Sep 17 00:00:00 2001 From: samantharudra <98905595+samantharudra@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:00:40 +0000 Subject: [PATCH 1/4] change is_widowed to is_surviving_spouse --- policyengine_us/data/datasets/cps/cps.py | 2 +- .../income/exemptions/personal/la_widow_exemption.yaml | 8 ++++---- .../demographic/tax_unit/surviving_spouse_eligible.yaml | 4 ++-- .../family_security_act/remove_head_of_household.yaml | 2 +- .../tax/income/exemptions/personal/la_widow_exemption.py | 4 ++-- .../household/demographic/marital_unit/is_widowed.py | 2 +- .../demographic/tax_unit/surviving_spouse_eligible.py | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/policyengine_us/data/datasets/cps/cps.py b/policyengine_us/data/datasets/cps/cps.py index a42169ceb0a..f70a7a89e05 100644 --- a/policyengine_us/data/datasets/cps/cps.py +++ b/policyengine_us/data/datasets/cps/cps.py @@ -203,7 +203,7 @@ def children_per_parent(col: str) -> pd.DataFrame: cps["cps_race"] = person.PRDTRACE cps["is_hispanic"] = person.PRDTHSP != 0 - cps["is_widowed"] = person.A_MARITL == 4 + cps["is_surviving_spouse"] = person.A_MARITL == 4 cps["is_separated"] = person.A_MARITL == 6 # High school or college/university enrollment status. cps["is_full_time_college_student"] = person.A_HSCOL == 2 diff --git a/policyengine_us/tests/policy/baseline/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.yaml b/policyengine_us/tests/policy/baseline/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.yaml index 76bc426374e..df64d019a17 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.yaml @@ -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] @@ -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] diff --git a/policyengine_us/tests/policy/baseline/household/demographic/tax_unit/surviving_spouse_eligible.yaml b/policyengine_us/tests/policy/baseline/household/demographic/tax_unit/surviving_spouse_eligible.yaml index ffef67fbfb9..8949528fb5e 100644 --- a/policyengine_us/tests/policy/baseline/household/demographic/tax_unit/surviving_spouse_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/household/demographic/tax_unit/surviving_spouse_eligible.yaml @@ -3,7 +3,7 @@ input: people: head: - is_widowed: true + is_surviving_spouse: true tax_units: tax_unit: members: [head] @@ -16,7 +16,7 @@ people: head: is_tax_unit_head: true - is_widowed: true + is_surviving_spouse: true child: {} tax_units: tax_unit: diff --git a/policyengine_us/tests/policy/contrib/congress/romney/family_security_act/remove_head_of_household.yaml b/policyengine_us/tests/policy/contrib/congress/romney/family_security_act/remove_head_of_household.yaml index 2dd100bd620..7bc440b3b3f 100644 --- a/policyengine_us/tests/policy/contrib/congress/romney/family_security_act/remove_head_of_household.yaml +++ b/policyengine_us/tests/policy/contrib/congress/romney/family_security_act/remove_head_of_household.yaml @@ -21,7 +21,7 @@ people: head: is_tax_unit_head: true - is_widowed: true + is_surviving_spouse: true tax_units: tax_unit: members: [head] diff --git a/policyengine_us/variables/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.py b/policyengine_us/variables/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.py index c4bc041e5c0..d7941d199cc 100644 --- a/policyengine_us/variables/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.py +++ b/policyengine_us/variables/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.py @@ -14,6 +14,6 @@ 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 diff --git a/policyengine_us/variables/household/demographic/marital_unit/is_widowed.py b/policyengine_us/variables/household/demographic/marital_unit/is_widowed.py index 1178b0cc690..6ec91228b38 100644 --- a/policyengine_us/variables/household/demographic/marital_unit/is_widowed.py +++ b/policyengine_us/variables/household/demographic/marital_unit/is_widowed.py @@ -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" diff --git a/policyengine_us/variables/household/demographic/tax_unit/surviving_spouse_eligible.py b/policyengine_us/variables/household/demographic/tax_unit/surviving_spouse_eligible.py index 7ca529ff31e..1ca48248de7 100644 --- a/policyengine_us/variables/household/demographic/tax_unit/surviving_spouse_eligible.py +++ b/policyengine_us/variables/household/demographic/tax_unit/surviving_spouse_eligible.py @@ -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 ) From 23f6582e5dea2df63f58ae252f9be671d366d8e5 Mon Sep 17 00:00:00 2001 From: samantharudra <98905595+samantharudra@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:29:51 +0000 Subject: [PATCH 2/4] changelog entry --- changelog_entry.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb2d..dab5707ebae 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Change is_widowed to is_surviving_spouse. From 493c05e8e21d57eb3ef40578339cc37f4d63307c Mon Sep 17 00:00:00 2001 From: samantharudra <98905595+samantharudra@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:31:29 +0000 Subject: [PATCH 3/4] make format --- .../la/tax/income/exemptions/personal/la_widow_exemption.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/policyengine_us/variables/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.py b/policyengine_us/variables/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.py index d7941d199cc..683e0d57a46 100644 --- a/policyengine_us/variables/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.py +++ b/policyengine_us/variables/gov/states/la/tax/income/exemptions/personal/la_widow_exemption.py @@ -14,6 +14,8 @@ class la_widow_exemption(Variable): def formula(tax_unit, period, parameters): person = tax_unit.members - is_surviving_spouse = tax_unit.any(person("is_surviving_spouse", period)) + is_surviving_spouse = tax_unit.any( + person("is_surviving_spouse", period) + ) p = parameters(period).gov.states.la.tax.income.exemptions return is_surviving_spouse * p.widow From 59ccb98be937feff9992186a5d1ff2d87024e4ff Mon Sep 17 00:00:00 2001 From: samantharudra <98905595+samantharudra@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:11:05 +0000 Subject: [PATCH 4/4] Update label, documentation, comments and surviving_spouse_head --- .../demographic/tax_unit/surviving_spouse_eligible.yaml | 4 ++-- .../family_security_act/remove_head_of_household.yaml | 2 +- .../tax/income/credits/personal/ar_personal_credits_base.py | 6 +++--- .../household/demographic/marital_unit/is_widowed.py | 4 ++-- .../demographic/tax_unit/surviving_spouse_eligible.py | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/household/demographic/tax_unit/surviving_spouse_eligible.yaml b/policyengine_us/tests/policy/baseline/household/demographic/tax_unit/surviving_spouse_eligible.yaml index 8949528fb5e..981cffb2c70 100644 --- a/policyengine_us/tests/policy/baseline/household/demographic/tax_unit/surviving_spouse_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/household/demographic/tax_unit/surviving_spouse_eligible.yaml @@ -1,4 +1,4 @@ -- 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: @@ -10,7 +10,7 @@ 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: diff --git a/policyengine_us/tests/policy/contrib/congress/romney/family_security_act/remove_head_of_household.yaml b/policyengine_us/tests/policy/contrib/congress/romney/family_security_act/remove_head_of_household.yaml index 7bc440b3b3f..eaa48bc257c 100644 --- a/policyengine_us/tests/policy/contrib/congress/romney/family_security_act/remove_head_of_household.yaml +++ b/policyengine_us/tests/policy/contrib/congress/romney/family_security_act/remove_head_of_household.yaml @@ -13,7 +13,7 @@ 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: diff --git a/policyengine_us/variables/gov/states/ar/tax/income/credits/personal/ar_personal_credits_base.py b/policyengine_us/variables/gov/states/ar/tax/income/credits/personal/ar_personal_credits_base.py index 1ad696c3261..2b259aa4e92 100644 --- a/policyengine_us/variables/gov/states/ar/tax/income/credits/personal/ar_personal_credits_base.py +++ b/policyengine_us/variables/gov/states/ar/tax/income/credits/personal/ar_personal_credits_base.py @@ -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 diff --git a/policyengine_us/variables/household/demographic/marital_unit/is_widowed.py b/policyengine_us/variables/household/demographic/marital_unit/is_widowed.py index 6ec91228b38..baa5f31269e 100644 --- a/policyengine_us/variables/household/demographic/marital_unit/is_widowed.py +++ b/policyengine_us/variables/household/demographic/marital_unit/is_widowed.py @@ -4,6 +4,6 @@ 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 diff --git a/policyengine_us/variables/household/demographic/tax_unit/surviving_spouse_eligible.py b/policyengine_us/variables/household/demographic/tax_unit/surviving_spouse_eligible.py index 1ca48248de7..1b61cca9699 100644 --- a/policyengine_us/variables/household/demographic/tax_unit/surviving_spouse_eligible.py +++ b/policyengine_us/variables/household/demographic/tax_unit/surviving_spouse_eligible.py @@ -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_surviving_spouse = person("is_surviving_spouse", period) - widowed_head = tax_unit.any(is_head & is_surviving_spouse) + 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