Expose axes in household calculators#363
Conversation
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>
|
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. |
298feee to
cb40864
Compare
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>
Summary
axessupport to the US and UKcalculate_householdhelpersWhy
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.shruff format --check .ruff check .uv run --extra dev python -m pytest tests/test_household_impact.py -q