Skip to content

Remove household_options from the country metadata - #4210

Merged
anth-volk merged 2 commits into
masterfrom
remove-household-options
Nov 6, 2026
Merged

anth-volk merged 2 commits into
masterfrom
remove-household-options

Conversation

@anth-volk

@anth-volk anth-volk commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #4209

Summary

/{country}/metadata no longer has household_options. This reverts #4159 (merge commit a69c6e2), which added household_options.time_period: the years offered for household calculations, separate from economy_options.time_period. No client reads it.

Why: the maintainer decided on 4–5 November 2026 that US 2022 and 2023 are dropped everywhere, and that household and society-wide calculations share one list of years per country, starting in 2024 for the US. With one list, a separate household list has no purpose. The pull request stacked on this one defines each country's years once and uses them for economy_options.time_period.

  • policyengine_api/country.py: build_metadata no longer adds household_options, and build_household_options is removed. economy_options is unchanged.
  • policyengine_api/household_years.py: removed (us_household_years).
  • policyengine_api/spm.py: certified_spm_forecast_years is removed. Only build_household_options used it.
  • Tests: tests/unit/test_household_options.py and the three certified_spm_forecast_years tests in tests/unit/test_spm_settings.py are removed with the code they tested.
  • Dependency check baseline: household_years.py held the package's only static import of policyengine_us (spm.py loads it with importlib, which deptry doesn't read). Without it, the declared-dependencies quality guard failed with "baseline entry no longer applies: DEP003 policyengine_us". This removes that entry from rules/baselines/deptry.txt, lowers the count of api.dependencies.declared-and-used in rules/registry.toml from 16 to 15, and regenerates docs/generated/rules.md. These files are rule machinery, so a core developer other than the author needs to approve them (api.process.rule-machinery-code-owned).
  • Changelog: changelog.d/remove-household-options.removed.md. The 5.22.0 entry in CHANGELOG.md that announced household_options stays as history. Add household_options.time_period to the country metadata #4159's own fragment was already released, so the revert had no fragment to remove.

No other file mentions household_options, household_years, us_household_years, certified_spm_forecast_years or build_household_options, including rules/registry.toml, docs/generated/rules.md, and the import-linter and deptry settings in pyproject.toml. The only remaining match is the 5.22.0 entry in CHANGELOG.md.

Testing

This pull request adds and changes no test. It only removes the tests of the removed code: the nine tests in tests/unit/test_household_options.py, and tests/unit/test_spm_settings.py::test_certified_forecast_years_are_the_artifacts_years, ::test_certified_forecast_years_are_none_without_a_certified_forecast and ::test_certified_forecast_years_are_none_when_the_forecast_cannot_load. So no test was run locally; CI runs the suite.

  • uv run --frozen --extra dev ruff format --check and ruff check on policyengine_api/country.py, policyengine_api/spm.py and tests/unit/test_spm_settings.py: pass (ruff 0.15.12, the version uv.lock pins).
  • python scripts/run_quality_guards.py: every guard passes. Before the baseline change, declared-dependencies failed as described above.
  • BASE_SHA=origin/master bash .github/scripts/check_changelog_fragment.sh: "This pull request adds 1 changelog fragment".

Environment variables

No environment variables are added, removed or changed.

🤖 Generated with Claude Code

Revert the merge of #4159 (a69c6e2),
which added household_options.time_period to /{country}/metadata. No
client reads it, and household and society-wide calculations will offer
the same years per country, from economy_options.time_period.

This removes policyengine_api/household_years.py, build_household_options
in country.py, certified_spm_forecast_years in spm.py and their tests.
household_years.py held the package's only static import of
policyengine_us, so the declared-dependencies check found its DEP003
baseline entry unused: remove it, lower the rule's baseline count to 15
and regenerate docs/generated/rules.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.12%. Comparing base (e4b3848) to head (39a4de4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4210      +/-   ##
==========================================
- Coverage   92.14%   92.12%   -0.03%     
==========================================
  Files         297      296       -1     
  Lines       16673    16652      -21     
  Branches     2719     2712       -7     
==========================================
- Hits        15364    15341      -23     
- Misses        792      798       +6     
+ Partials      517      513       -4     
Flag Coverage Δ
integration 52.33% <ø> (+0.06%) ⬆️
unit 90.26% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Brings in the move to PolicyEngine .py 6.12.1 (#4163), so the bundle check matches the simulation API's latest again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk added a commit that referenced this pull request Nov 6, 2026
Brings in master, including the move to PolicyEngine .py 6.12.1 (#4163) and the diff-coverage check, through #4210's branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anth-volk
anth-volk marked this pull request as ready for review November 6, 2026 13:37
@anth-volk
anth-volk requested a review from a team as a code owner November 6, 2026 13:37
@anth-volk
anth-volk merged commit dc64d6e into master Nov 6, 2026
25 checks passed
@anth-volk
anth-volk deleted the remove-household-options branch November 6, 2026 13:37
anth-volk added a commit that referenced this pull request Nov 6, 2026
Brings in #4163, which moves the PolicyEngine bundle to 6.12.1 to match
the simulation API, and #4210. The merge has no conflicts; a fresh render
leaves the generated rules unchanged, uv lock --check (uv 0.13.4) passes,
and make quality passes on the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk added a commit that referenced this pull request Nov 6, 2026
Brings in master (#4163's PolicyEngine bundle 6.12.1, #4210) through
#4203's branch. No conflicts; a fresh render leaves the generated rules
unchanged, and make quality and the hook's tests pass on the merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was previously deployed

1 inactive deployment
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.

Remove household_options from the country metadata

1 participant