Skip to content
Merged
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
1 change: 1 addition & 0 deletions changelog.d/spm-childcare-cap-projection.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix SPM childcare earnings cap projection for datasets with multiple SPM units.
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,44 @@
members: [head, spouse]
output:
spm_unit_head_spouse_earned_cap: 4_000

- name: Multiple SPM units project reference spouse and partner flags to members
period: 2024
absolute_error_margin: 0.001
input:
people:
reference_person:
age: 35
employment_income: 40_000
is_household_head: true
is_tax_unit_head: true
partner:
age: 33
employment_income: 3_000
is_unmarried_partner_of_household_head: true
is_tax_unit_head: true
child:
age: 8
second_reference_person:
age: 45
employment_income: 50_000
is_household_head: true
is_tax_unit_head: true
second_spouse:
age: 44
employment_income: 7_000
is_tax_unit_spouse: true
tax_units:
reference_unit:
members: [reference_person, child]
partner_unit:
members: [partner]
second_unit:
members: [second_reference_person, second_spouse]
spm_units:
spm_unit:
members: [reference_person, partner, child]
second_spm_unit:
members: [second_reference_person, second_spouse]
output:
spm_unit_head_spouse_earned_cap: [3_000, 7_000]
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ def formula(spm_unit, period, parameters):
"is_unmarried_partner_of_household_head", period
)
has_spouse = spm_unit.any(is_reference_person_spouse)
has_spouse_person = spm_unit.project(has_spouse)
eligible_reference_person_or_partner = (
is_reference_person
| is_reference_person_spouse
| (~has_spouse & is_reference_person_partner)
| (~has_spouse_person & is_reference_person_partner)
)
has_reference_person = spm_unit.project(has_reference_person)
eligible_people = where(
has_reference_person,
eligible_reference_person_or_partner,
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading