Skip to content

Bring the growth factors page into line with the uprating map - #2779

Merged
juaristi22 merged 6 commits into
mainfrom
fix-growth-factors-page
Nov 4, 2026
Merged

juaristi22 merged 6 commits into
mainfrom
fix-growth-factors-page

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #2778

axiom: n/a: documentation only

This corrects docs/book/assumptions/growthfactors.md and changes no model code.

  • Moves the capital gains variables to a new section on their own index, and the two property values to a new house prices section.

  • Adds the 45 names the page omitted, so each of the 143 names in uprating_indices.yaml now sits under its own index.

  • Corrects the road fuel table for 2028 to 2031.

  • Rewrites the Rent section around what uprate_rent does: private rents by region, every other rent by obr.social_rent. The old table showed obr.rent, which projects no rent.

  • Adds sections for Northern Ireland domestic rates, water and sewerage charges, gambling duty bases and rail usage, with tables from yoy_growth.yaml.

  • States that the OBR stops forecasting mortgage interest after 2029, how council_tax_benefit_reported grows, how employee_pension_contributions_reported grows, and that the student loan routes apply only to new loans.

  • States where the water and rent routes stop: both run to the end of the dataset projection in 2032. From 2033 policyengine-core grows water charges in every country by the Ofwat index, which compounds to 2074, and holds rent at its 2032 value.

We checked the result with a script that reads each name in the map and looks for it in the section of its index (143 found, 0 missing), and compared every other table on the page with yoy_growth.yaml to one decimal place.

#2131 and #2638 edit the per capita GDP list too. The second to merge keeps the names from both.

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits October 31, 2026 19:46
Fixes #2778

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 1, 2026 00:14

@juaristi22 juaristi22 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed ac9e5c658c42559d71034b91042e689239764e55. One nonblocking documentation point remains.

A1 — Qualify the water/rent projection horizon. The new water paragraph at growthfactors.md:154 describes Scottish Water growth and flat supplied Northern Ireland charges without a horizon. Those country-specific dataset routes stop at 2032. From 2033 Core uses the water variable's Ofwat index in every country; rent has no class-level index and holds at its last materialized value. Please add a short horizon/fallback qualification to this paragraph and the rewritten Rent section.

All 127 mapped names are under their correct indices, and all 191 checked table cells match the parameter YAML to the displayed precision. Only documentation/changelog change. This is a documentation correction; no model defect or material evidence gap was found. Documentation, Lint, Fix evidence and Result checks passed at this head; skipped model jobs are not counted as executed tests.

@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

Picking this up for the UK hub. Reply here if you're mid-change and I'll stop.


Generated by Claude Code

The dataset projection carries the country water routes and the tenure
rent routes to 2032. From 2033 Core grows water charges by the Ofwat
index in every country until that index stops in 2039, and holds rent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6HXy8MjqHUMEtSD65y
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6HXy8MjqHUMEtSD65y
Main added seven gambling duty base series to uprating_indices.yaml, so
the page gains a section that lists each duty's names and rates. Main also
derives where the indices end, so the Ofwat index now grows to 2074.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6HXy8MjqHUMEtSD65y
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

PR_TITLE.txt

Bring the growth factors page into line with the uprating map

Generated by Claude Code

@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

PR_BODY.md

Fixes #2778

axiom: n/a: documentation only

This corrects `docs/book/assumptions/growthfactors.md` and changes no model code.

- Moves the capital gains variables to a new section on their own index, and the two property values to a new house prices section.
- Adds the 42 names the page omitted, so each of the 143 names in `uprating_indices.yaml` now sits under its own index.
- Corrects the road fuel table for 2028 to 2031.
- Rewrites the Rent section around what `uprate_rent` does: private rents by region, every other rent by `obr.social_rent`. The old table showed `obr.rent`, which projects no rent.
- Adds sections for Northern Ireland domestic rates, water and sewerage charges, gambling duty bases and rail usage, with tables from `yoy_growth.yaml`.

- States that the OBR stops forecasting mortgage interest after 2029, how `council_tax_benefit_reported` grows, how `employee_pension_contributions_reported` grows, and that the student loan routes apply only to new loans.
- States where the water and rent routes stop: the dataset projection carries them to 2032, then policyengine-core grows water charges in every country by the Ofwat index, which compounds to 2074, and holds `rent` at its 2032 value.

I checked the result with a script that reads each name in the map and looks for it in the section of its index (143 found, 0 missing), and compared every other table on the page with `yoy_growth.yaml` to one decimal place.

#2131 and #2638 edit the per capita GDP list too. The second to merge keeps the names from both.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Generated by Claude Code

@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

Ready for hub review

Head 529b5e9dae564892c606d9107e7d7f64d87ceb5d on branch claude/growth-routes-documentation-2kujsu (the session's harness pins pushes to this name), started from ac9e5c658c42559d71034b91042e689239764e55. Three commits: 2a361a00 horizon sentences, c29ca80a merge of origin/main at 52b30809, 529b5e9d page fixes after the merge. No PR opened; fix-growth-factors-page untouched.

Step 1: where each route stops (code read at 529b5e9d; policyengine-core 3.33.12 as uv.lock pins)

uv.lock pins no policyengine-uk-data, and every route lives in this repository or in Core.

Route Where its series ends Last year Later years
Water, England and Wales (ofwat.water_bills) extend_single_year_dataset stops at PROJECTION_END_YEAR = 2032 (policyengine_uk/data/economic_assumptions.py:172, applied at :355); uprate_water_and_sewerage_charges at :758 2032 (2029's 5.0% rate holds for 2030–2032) Core grows the stored 2032 value by indices.ofwat.water_bills (water_and_sewerage_charges.py:10; Core simulation.py:1832–1871)
Water, Scotland (scottish_water.water_bills) same, :758 2032 (4.1% held from 2029) the Ofwat index, as above (COUNTRY_UPRATED_INPUTS, :110, keeps the dataset step from also applying it before 2033)
Water, Northern Ireland (None, held flat) same, :104 2032 grows by the Ofwat index from 2033
Rent (uprate_rent, :792: ons.private_rental_prices.<region> for private renters, obr.social_rent otherwise) same PROJECTION_END_YEAR 2032 (2031 rates, 2.6% UK private and 3.0% social, hold for 2032) rent declares no uprating, so Core's auto-carry-over (Core simulation.py:1878) holds the 2032 value
Ofwat index itself create_economic_assumption_indices.py:75 compounds to growth_horizon (:21), the last year any yoy_growth series covers 2074 flat from 2075

The default capital gains projection (legacy_gdp_per_capita) sets no end_year, so the horizon falls to 2032. A finite CGT scenario can shorten it (:355).

Households. I built 8 hand-made households (London, Wales, Scotland and Northern Ireland, each one private and one council renter), with £500 water and £10,000 rent in 2031, and ran them through Microsimulation. The dataset materialised years [2031, 2032].

water 2031 2032 2033 2034 2073 2074 2075 rent 2031 2032 2033 2075
London / Wales, private 500.00 525.00 551.25 578.81 3,880.80 4,074.84 4,074.84 10,000 10,260 10,260 10,260
Scotland, private 500.00 520.50 546.52 573.85 3,847.53 4,039.91 4,039.91 10,000 10,260 10,260 10,260
Northern Ireland, private 500.00 500.00 525.00 551.25 3,696.00 3,880.80 3,880.80 10,000 10,260 10,260 10,260
Social rows (same water) 10,000 10,300 10,300 10,300

So in 2033 Scotland and Northern Ireland both switch to Ofwat's 5%, and rent stops moving.

Where the code differs from the review. On ac9e5c658 the review's account holds, plus one detail: the Ofwat index compounded only to 2039 (range(start_year + 1, 2040)), so water held from 2040. I measured this before the merge: water was 738.72 in 2039, 2040 and 2041. Main's #2756 (cb4ab7ba) now derives the horizon, so at the final head the index runs to 2074. The page states the final-head behaviour.

Step 2: page (docs/book/assumptions/growthfactors.md)

  • :154 (water) adds two sentences: the country routes run to 2032; from 2033 Core grows every household's charges by the Ofwat index, Scotland and Northern Ireland included; the index grows to 2074 and charges hold from 2075.
  • :197 (Rent) adds: both series run to 2032, which takes each series' 2031 rate; from 2033 rent holds at its 2032 value because the variable declares no uprating index.

Step 3: merge main

c29ca80a merges origin/main at 52b30809 with no conflicts. Since ac9e5c658, main changed:

Main did not change growthfactors.md. Fixes in 529b5e9d:

  • I added a ## Gambling duty bases section at :214, with a 2025–2031 table from yoy_growth.yaml and each duty's names in a list.
  • I changed the water sentence's 2039 to 2074.

Tests at 529b5e9d

  • Docs build (make documentation, as pr_docs_changes.yaml runs it): not run to completion. jupyter book build --html fails because the session's egress policy refuses api.mystmd.org:443 ("Problem with template link … 403 Forbidden"; proxy: connect_rejected). The Documentation check will need to run in CI.
  • Body's check (uncommitted script):
    names: 143 found, 0 missing, 143 in map, 22 indices
    read from the loaded parameters, not the YAML: ['obr.lagged_average_earnings', 'obr.private_pension_index']
    tables: 28 rows, 240 cells checked, 0 mismatches, 15 exact .x5 ties shown either way; rows mapped but absent: []
    
    At ac9e5c658 the same script gives 127 found, 0 missing, and 191 cells with 0 mismatches. Those counts match the review's.
  • check_fix_pr.py on the posted title and body, run as the workflow runs it: Fix evidence: PASS … Not a fix PR, exit 0.
  • uvx ruff@0.17.2 format --check .: 2174 files already formatted. ruff check . and --select F811,F821 policyengine_uk: all checks passed.
  • git diff --check ac9e5c658..HEAD: clean.
  • git merge-tree --write-tree --name-only HEAD origin/main (main 52b30809): tree 86ea893c…, no conflicts, exit 0.
  • uv run pytest policyengine_uk/tests/code_health -n 4: 3091 passed.
  • Mutation and revert checks: none apply, because this change touches documentation only.

Skipped

  • Survey-dataset tests (no private data).
  • The full suite, which CI covers.

Judgment calls

  1. Rounding ties in the check. Fifteen cells sit exactly on a .x5 value, and the page rounds them both ways (e.g. 1.2985 → 129.9%, 0.0065 → 0.6%). The check accepts a cell within half a unit of the exact decimal value. I left those pre-existing cells unchanged.

  2. Derived parameters. lagged_average_earnings and private_pension_index have no YAML values; the build derives them. The check reads them from the loaded parameters.

  3. PR body. Besides the new horizon line, I corrected three stale facts the merge created:

    • 29/127 names became 42/143;
    • "127 found" became "143 found";
    • the "Adds sections" line now names gambling duty bases.

    Without these, the body would misstate the head.

  4. Gambling Duty 2026 cell. It shows 0.0% for −0.000114, not −0.0%.

  5. Scope. The page describes dataset projection. Inputs given directly in a situation grow by the Ofwat index in every country from the first year (checked: Scotland and Northern Ireland £500 in 2030 → £525.00 in 2031), and their rent carries flat. I did not add this to the page, so the edit stays within two sentences per section.


Generated by Claude Code

The water paragraph's last sentence gave two facts in one; the rent and gambling duty sentences now name who applies each rate, in place of a dangling "which takes" and a be-verb definition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis requested a review from juaristi22 November 3, 2026 07:01

@juaristi22 juaristi22 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed exact head af3758c642827f2d5c22ab711799fc707e601ec0. Review COMPLETE, with no material evidence gaps. A1 is resolved: the adopted page now distinguishes the dataset projection through 2032 from later Core water/rent behavior, and the Ofwat horizon agrees with pinned Core 3.34.1.

S1 — Correct or omit the added-name count in the actual PR description. It says the page adds 42 names; the current base-to-head comparison adds 45 (29 other names plus 16 gambling bases). The page itself correctly contains all 143 mapped names.

Independent checks passed for 143 names and 240 table cells, plus the 2074/2075 index boundary. The separate branch and author hand-off were not substituted for the adopted head. No model test suite was rerun for this documentation-only change.

Approval is withheld while S1 remains; the rest of the documentation review is complete.

@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

The description now says 45: the page at the base names 98 of the 143, and the head names all 143.

🤖 Generated with Claude Code

@juaristi22 juaristi22 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed af3758c642827f2d5c22ab711799fc707e601ec0. COMPLETE; no open findings or material gaps.

S1 is resolved: the actual description now says 45 newly documented names, matching the retained independent check (143 total names, 98 previously documented). A1 remains resolved. The reviewed documentation and code dependencies are unchanged, so the prior 143-name/240-table-cell validation remains applicable; no model or documentation build was rerun for this description-only fix.

The PR is ready and current-head required checks pass. Approving this head.

@juaristi22
juaristi22 added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 709612f Nov 4, 2026
12 of 13 checks passed
@juaristi22
juaristi22 deleted the fix-growth-factors-page branch November 4, 2026 05:16
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.

Growth factors page names wrong indices and omits variables

3 participants