PolicyEngine / PolicyEngine/policyengine-uk
Four more variables declare uprating but are missing from uprating_indices.yaml
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 50
- Forks
- 33
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 14
Description
Follow-up to #1859 / #1860, raised in review of that PR. Same root cause, different variables — filed separately to keep the fix there focused.
Root cause, stated for the record
The class-level uprating = "..." attribute on a Variable is dead metadata in this repo: nothing reads it, and policyengine-core only inspects it to refuse combining it with its own @uprated decorator. data/uprating_indices.yaml is the only mechanism that actually applies uprating (apply_single_year_uprating / reset_growthfactor_uprating in data/economic_assumptions.py).
So a variable can declare an index and silently never be uprated. That is what #1859 observed for electricity_consumption and gas_consumption.
Four more affected
Measured on enhanced_frs_2024_25, household means, 2024 → 2027, all flat:
| variable | declares | 2024 | 2027 |
|---|---|---|---|
water_and_sewerage_charges |
indices.ofwat.water_bills |
375.51 | 375.51 |
housing_service_charges |
indices.obr.lagged_average_earnings |
91.81 | 91.81 |
pension_contributions_via_salary_sacrifice |
indices.obr.average_earnings |
418.69 | 418.69 |
rail_usage |
gov.dft.rail.ridership_index |
515.59 | 515.59 |
Separately, savings_interest_income declares indices.ons.household_interest_income, but the YAML applies per_capita.gdp to it — a mismatch rather than an omission.
Two of the four point at indices that may have no yoy_growth parameter yet, so fixing them is likely more than a YAML addition.
Suggested durable fix
A code-health test (natural home policyengine_uk/tests/code_health/) asserting that every variable declaring uprating appears in uprating_indices.yaml under the matching index. That makes the gap visible instead of silent, and would have caught #1859 at the point it was introduced.
Credit to @juaristi22, who found these while reviewing #1860.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with data/uprating_indices.yaml and the variable declarations, then read apply_single_year_uprating and reset_growthfactor_uprating in data/economic_assumptions.py. Review policyengine_uk/tests/code_health/ for the proposed consistency check; done means the four declarations are accounted for with matching uprating configuration, including any required growth parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100