Check the UK nation filters against policyengine-uk's country formula
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the nation mapping in countries/uk/regions.py (ENGLISH_REGIONS and the Scotland, Wales and Northern Ireland entries), then compare it with the country formula in policyengine-uk's variables/household/demographic/country.py. Done means a test computes policyengine-uk's country for every Region value, including UNKNOWN, and each nation filter keeps exactly the matching regions. Linked PR #568 is already open, so check it before starting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What is missing
Since #565 (6.2.3), the UK nation regions filter the stored household region column, and countries/uk/regions.py lists which regions make up each nation (ENGLISH_REGIONS; one region each for Scotland, Wales and Northern Ireland). policyengine-uk keeps its own copy of that mapping in the country formula (variables/household/demographic/country.py), which derives country from region.
No test checks that the two agree. If policyengine-uk changed its Region enum or its country formula, the nation filters would keep households that policyengine-uk places in another nation, and nothing would fail.
Check on the certified data (2026-10-08, main at 07bae75, policyengine-uk 2.102.3)
On enhanced_frs_2024_25_year_2026.h5 (52,846 households), each nation filter keeps exactly the households that policyengine-uk's country assigns to that nation:
| region | households | weighted households |
|---|---|---|
| country/england | 37,961 | 26,354,698.47 |
| country/scotland | 5,405 | 2,729,247.77 |
| country/wales | 3,821 | 1,590,754.53 |
| country/northern_ireland | 5,659 | 783,847.56 |
The four sets are disjoint and cover the file (31,458,548.32 weighted households). Simulation(..., scoping_strategy=country/scotland).run() returns the same 5,405 households and leaves the caller's tables unchanged. #565 noted that the certified artifact was unvalidated, so this closes that gap.
Proposed
Tests that compute policyengine-uk's country for every value of its Region enum (UNKNOWN included) and require each registry nation filter to keep exactly the regions policyengine-uk places in that nation. Add a property over random region-only datasets and an end-to-end Simulation.run() for each nation. Scoping itself stays as #565 made it: stored region, no model calculation.
- Lingua principale
- Python
- Stelle
- 8
- Fork
- 10
- Merge medio
- 18h 24m
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policyengine.py
-
Raise the simulation cache memory warning to 16 GiBForse già presa @anth-volk l’ha presa 10 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
PolicyEngine/policyengine.py#549 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PolicyEngine/policyengine.py#473 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
PolicyEngine/policyengine.py#436 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Certify populace-uk as the UK certified defaultForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PolicyEngine/policyengine.py#408 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
PolicyEngine/policyengine.py#567 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PolicyEngine/policyengine.py
Issue simili
-
feedback simulation workshop
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
githubnext/gh-aw-workshop#4455 ·
I maintainer di solito rispondono entro 1 giorno
-
Triage 🩺
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Container scenario crashes without expected_recovery_time, kube DNS example uses retry_waitApertaneeds-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
krkn-chaos/krkn#1627 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NousResearch/hermes-agent#136483 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno