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/fixed/fix-climate-action-category.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed climate_action_incentive_category enum crash that broke household_net_income and marginal_tax_rate for all household types.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
- name: Two-parent household with child — category defaults without crash
period: 2026
input:
people:
parent1:
age: 35
is_head: true
is_spouse: false
employment_income: 50_000
parent2:
age: 33
is_head: false
is_spouse: true
child:
age: 5
is_head: false
is_spouse: false
households:
household:
members: [parent1, parent2, child]
province_code: ONT
is_married: true
output:
climate_action_incentive_category:
- HEAD
- SPOUSE
- OTHER_CHILD

- name: Single parent household — eldest child gets special category
period: 2026
input:
people:
parent:
age: 35
is_head: true
is_spouse: false
employment_income: 45_000
child1:
age: 10
is_head: false
is_spouse: false
is_dependant: true
child2:
age: 7
is_head: false
is_spouse: false
is_dependant: true
households:
household:
members: [parent, child1, child2]
province_code: ONT
is_married: false
output:
climate_action_incentive_category:
- HEAD
- ELDEST_CHILD_IN_SINGLE_PARENT_HOUSEHOLD
- OTHER_CHILD

- name: Single person — head only
period: 2026
input:
people:
person:
age: 40
is_head: true
is_spouse: false
employment_income: 90_000
households:
household:
members: [person]
province_code: ONT
output:
climate_action_incentive_category:
- HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
- name: Two-parent household with child — household_net_income does not crash
period: 2026
absolute_error_margin: 1
input:
people:
parent1:
age: 35
is_head: true
is_spouse: false
employment_income: 50_000
parent2:
age: 33
is_head: false
is_spouse: true
employment_income: 30_000
child:
age: 5
is_head: false
is_spouse: false
households:
household:
members: [parent1, parent2, child]
province_code: ONT
is_married: true
output:
climate_action_incentive_category:
- HEAD
- SPOUSE
- OTHER_CHILD

- name: Married couple no children — climate action does not crash
period: 2026
absolute_error_margin: 1
input:
people:
head:
age: 40
is_head: true
is_spouse: false
employment_income: 90_000
spouse:
age: 38
is_head: false
is_spouse: true
households:
household:
members: [head, spouse]
province_code: ONT
is_married: true
output:
climate_action_incentive_category:
- HEAD
- SPOUSE
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ def formula(person, period, parameters):
ClimateActionIncentiveCategory.ELDEST_CHILD_IN_SINGLE_PARENT_HOUSEHOLD,
ClimateActionIncentiveCategory.OTHER_CHILD,
],
default=ClimateActionIncentiveCategory.OTHER_CHILD,
)
Loading