Skip to content

Fix climate_action_incentive_category enum crash#550

Merged
PavelMakarchuk merged 3 commits intoPolicyEngine:masterfrom
PavelMakarchuk:fix-climate-action-category-enum
Mar 18, 2026
Merged

Fix climate_action_incentive_category enum crash#550
PavelMakarchuk merged 3 commits intoPolicyEngine:masterfrom
PavelMakarchuk:fix-climate-action-category-enum

Conversation

@PavelMakarchuk
Copy link
Collaborator

Summary

  • select() in climate_action_incentive_category returns 0 (int) when no condition matches, which fails enum encoding
  • This happens for children in two-parent households who don't satisfy any of the four boolean conditions
  • Adds default=ClimateActionIncentiveCategory.OTHER_CHILD so unmatched persons get a valid enum value
  • Unblocks household_net_income and marginal_tax_rate which were completely broken

Test plan

  • household_net_income now works for single earners and families with children
  • marginal_tax_rate now works
  • Existing tests still pass

🤖 Generated with Claude Code

PavelMakarchuk and others added 3 commits March 18, 2026 13:48
select() with no default returns 0 (int) when no condition matches,
which fails enum encoding. This happens for children in two-parent
households who don't match any of the four conditions.

Add default=OTHER_CHILD so unmatched persons get a valid enum value.
This unblocks household_net_income and marginal_tax_rate calculations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test category assignment for two-parent household with child (the crash case)
- Test single-parent household eldest child gets special category
- Test single person gets HEAD
- Integration test for two-parent and married-couple households

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PavelMakarchuk PavelMakarchuk merged commit b7677d4 into PolicyEngine:master Mar 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant