Skip to content

Expose axes in household calculators#363

Merged
MaxGhenis merged 3 commits into
mainfrom
codex/household-axes-refresh
Jul 7, 2026
Merged

Expose axes in household calculators#363
MaxGhenis merged 3 commits into
mainfrom
codex/household-axes-refresh

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

  • add axes support to the US and UK calculate_household helpers
  • normalize flat or nested axis specs and default missing periods to the household calculation year
  • return per-axis series for person and group entity results

Why

The app and Python household calculators need the same axis-grid behavior for simple one-household charts. The previous draft PR for this work, #322, is conflict-stuck against current main; this branch refreshes the same useful change onto the current package surface.

Validation

  • bash .github/check-changelog.sh
  • ruff format --check .
  • ruff check .
  • uv run --extra dev python -m pytest tests/test_household_impact.py -q

MaxGhenis and others added 2 commits July 7, 2026 07:01
Assert the donations-reduce-tax relationship instead of exact
liabilities, so policyengine-us data updates don't re-break the test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Disposition after full merits review: rebase-and-revive — done. The branch was MERGEABLE and its own 90 lines of axes tests all passed in CI; the only red was tests/test_models.py's label assertion, which main fixed with a tolerant regex (ab38116) about four hours after this branch was cut. Rebased onto current main (no conflicts — the patch-target files were untouched since May) and hardened the one future-brittle assertion (exact income-tax liabilities → the donations-reduce-tax relationship). 68/68 tests pass locally against policyengine-us 1.752.2, including empirical confirmation that every model-version attribute normalize_axes reads exists on the current pin. Design reviewed against the repository public-surface rules: rides the wrapper Simulation (no core bypass), JSON-serialisable list values, kwarg allowlist + error message updated in lockstep. CI re-running now.

@MaxGhenis MaxGhenis force-pushed the codex/household-axes-refresh branch from 298feee to cb40864 Compare July 7, 2026 11:03
count must be a positive integer (count=0 previously crashed with
ZeroDivisionError deep in core), min/max must be numeric, and axes in
one group must share count (mismatches were silently coerced to the
first axis's count, mis-shaping the later axis's sweep).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis marked this pull request as ready for review July 7, 2026 14:34
@MaxGhenis MaxGhenis merged commit 3a01b8f into main Jul 7, 2026
13 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