Skip to content

Fix self uprating growth and projection counts - #670

Draft
MaxGhenis wants to merge 6 commits into
masterfrom
uprate-self-growth
Draft

MaxGhenis wants to merge 6 commits into
masterfrom
uprate-self-growth

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Self uprating compounds growth per whole year, month, or day. An amount that rises from 1 to 4 over two years projects to 8 in the following year. For extreme ratios, the calculation takes the roots of the endpoints before dividing. Opposite signs are valid over an odd number of intervals. See policyengine_core/parameters/operations/uprate_parameters.py:1153, tests/core/parameters/operations/test_uprating.py:451 and :563.

number counts values after the last explicit date, defaults to ten, and rejects booleans. Tests cover annual, monthly, and daily projections, zero, and the default. The guide explains the cadence measurement window and floating-point rounding at exact boundaries. See policyengine_core/parameters/operations/uprate_parameters.py:353, tests/core/parameters/operations/test_uprating.py:513 and docs/usage/parameters.md:97.

The US parameter search found no self uprating. The three UK self-uprated spending series for DfE, DfT, and DHSC each gain a 2035 projection and have identical 2026 values in both runs. UK parameter sources

This change edits the same uprating module and tests as two companion PRs. The PR that lands later needs to merge the updated master first. #667 · #669

The parameter and period tests passed, including the chained comparison at tests/core/parameters/operations/test_base_uprating_property.py:799. The full suite finished with 4,356 passed, 4 skipped, and 3 expected failures. Ruff format and lint checks passed.

Tests

  • timeout 900 python -m pytest -q -p no:cacheprovider tests/core/parameters/operations/test_uprating.py — 61 passed.
  • timeout 900 python -m pytest -q -p no:cacheprovider tests/core/parameters/operations/test_base_uprating_property.py — 62 passed, including the chained reference. A direct run on tests/fixtures/chained_uprating_reference.py collected zero tests.
  • timeout 900 python -m pytest -q -p no:cacheprovider tests/core/parameters tests/core/test_parameters.py tests/core/test_periods.py — 739 passed.
  • timeout 900 make test-country-template — 39 passed.
  • timeout 900 python -m pytest -q -p no:cacheprovider tests/core/test_pandas3_compatibility.py — 7 passed and 1 skipped in the default environment. With PyArrow available through PYTHONPATH, all 8 passed.
  • timeout 1500 python -m pytest -q -p no:cacheprovider tests — 4,356 passed, 4 skipped, and 3 expected failures.
  • ruff format --check and ruff check passed on all four Python files changed by the PR. git diff --check passed. A Towncrier draft rendered the fragment under Fixed.
  • The country-package smoke tests skipped because the country packages were absent. The US microdata smoke test stayed disabled. The documentation site build was outside the test scope.

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits November 30, 2026 02:47
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
MaxGhenis and others added 4 commits November 30, 2026 17:22
Accept calendar clipping from either endpoint, diagnose a zero starting value, and count future cadence dates.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Compound annual amounts in the reference so valid zero-ending inputs produce a zero projection instead of sharing a synthetic-index division error.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>

This branch has not been deployed

No deployments
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