Stamp US year files with the register of renamed stored inputs they were cut under
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Trace create_datasets(), ensure_datasets(), and load_datasets(), then inspect policyengine_legacy_input_renames and the RENAMES_H5_DATASET handling described in #531. Implement the year-file stamp and validation paths, preserving the stated error propagation behavior. Done means files with mismatched or invalid metadata are regenerated or refused as specified, without inspecting tables or source data.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Follow-up to #530 / #531.
Problem
ensure_datasets() reuses every US year file ({data_folder}/{stem}_year_{year}.h5) that already exists and passes its staleness check. load_datasets() loads them. A year file that lost a renamed stored input gives wrong results without any error:
- policyengine.py 6.1.1 and earlier.
create_datasets()exported onlysim.input_variables. policyengine-us 2.x renamedwould_claim_wictotakes_up_wic_if_eligible, so these files store neither name. Every WIC-eligible person then takes WIC up: about $11.5B instead of $6.6B in 2024 (PolicyEngine/microcosm#1026). - #531 (unreleased draft). Year files record the renames that were applied (
policyengine_legacy_input_renames).ensure_datasets()regenerates, andload_datasets()refuses, a file with no record. The record shows that a file was cut with the mapping, not under which register. #531's own body and the comment onRENAMES_H5_DATASETsay so. When policyengine-us next renames an input andLEGACY_INPUT_RENAMESgains an entry, year files cut before that entry will still carry a record and be reused, and they can lose the newly renamed input the same way.
A subset check ("the file's register covers today's") would not close this either. A file cut by a newer release under a larger register stores the new live name. An older release whose engine does not define that name would skip it (_build_simulation_from_dataset sets only columns in system.variables). A removed or retargeted entry fails the same way.
Proposal
create_datasets()stamps each year file last withpolicyengine_year_file_stamp, stored as UTF-8 JSON{"register": <the whole LEGACY_INPUT_RENAMES>, "revision": <year-file format revision>}.ensure_datasets()regenerates, andload_datasets()refuses, any year file whose stamp does not equal this release's stamp exactly, or whose renames record is missing, malformed or not covered by its stamped register. The error names the renames the file may lack, generated from the register with no WIC special case.- The check reads only the stamp and the record, never the tables or the source dataset.
- Permission, directory and file-lock errors propagate instead of starting a full regeneration.
Saved simulation outputs (Simulation.load()) still gate only on the record's presence. That is left to a separate issue.
- Lenguaje dominante
- Python
- Estrellas
- 8
- Forks
- 10
- Merge medio
- 17 h 33 min
- PR fusionados (30 d)
- 30
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PolicyEngine/policyengine.py
-
Raise the simulation cache memory warning to 16 GiBPosiblemente ocupada @anth-volk la tomó hace 15 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
PolicyEngine/policyengine.py#549 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PolicyEngine/policyengine.py#473 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
PolicyEngine/policyengine.py#436 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Certify populace-uk as the UK certified defaultQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PolicyEngine/policyengine.py#408 ·
Los mantenedores suelen responder en 1 día
-
Budget reform contract rows: carry the reform's receipt identityPosiblemente ocupada @MaxGhenis la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
PolicyEngine/policyengine.py#629 ·
Los mantenedores suelen responder en 1 día
Todos los issues de PolicyEngine/policyengine.py
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
jbacalso24/mimry#291 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 Menos de una hora Aptitud para principiantes 82/100
eli-alvarado/us-watchlist-alerts#14 ·
Los mantenedores suelen responder en 1 día
-
from-review-extraction python severity:nit
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
LearningCircuit/local-deep-research#7462 ·
Los mantenedores suelen responder en 2 días
-
mermaid_extract.py silently discards single-line state-diagram notes; sequence notes are keptAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
cathrynlavery/diagram-design#441 ·
Los mantenedores suelen responder en 2 días
-
[Cleanup] Include the public header in work_split.cppPosiblemente ocupada @blozano-tt la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tenstorrent/tt-metal#60850 ·
Los mantenedores suelen responder en 1 día