Skip to content

Upgrade breakdown enum mismatch from WARNING to ERROR#449

Merged
MaxGhenis merged 1 commit intomasterfrom
fix-breakdown-mismatch-error
Mar 14, 2026
Merged

Upgrade breakdown enum mismatch from WARNING to ERROR#449
MaxGhenis merged 1 commit intomasterfrom
fix-breakdown-mismatch-error

Conversation

@MaxGhenis
Copy link
Contributor

Summary

  • Upgrades breakdown enum mismatch validation from a warning to a ValueError in homogenize_parameters.py
  • Extra parameter keys not in the breakdown enum now raise an error at load time, catching data bugs early
  • Partial enum coverage (missing values) is still allowed — only extra/invalid keys trigger the error

Test plan

  • Added test_breakdown_mismatch_raises_error — verifies ValueError for invalid keys
  • Added test_breakdown_partial_coverage_is_ok — verifies missing enum values don't error

Closes #444

🤖 Generated with Claude Code

Parameters with keys not in the breakdown variable's possible values
now raise ValueError instead of silently logging a warning. This
prevents data loss when parameter YAML files use keys that don't match
the breakdown enum (e.g., using snap_utility_region keys with a
state_code breakdown).

Partial coverage (enum values missing from YAML) remains allowed.

Closes #444

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MaxGhenis MaxGhenis merged commit 80db97d into master Mar 14, 2026
16 checks passed
@MaxGhenis MaxGhenis deleted the fix-breakdown-mismatch-error branch March 14, 2026 19:46
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.

Upgrade breakdown enum mismatch from WARNING to ERROR

1 participant