US year-file cuts can pair one cut's tables with another's stamp, and the stamp lacks the year
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start in tax_benefit_models.us.datasets.create_datasets and compare it with the UK path that #601 changed, which uses policyengine.provenance.year_file_stamp.temporary_year_file and publish_year_file. Port that write-to-temp, re-check, stamp, os.replace flow to the US create path, and add "year" to the stamp by raising legacy_inputs.YEAR_FILE_STAMP_REVISION to 3 and passing the year into year_file_stamp_problem. Update docs/microsim.md "Year files". The work is done when a failed or interleaved cut leaves existing year files intact and a copied year file fails the check.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
tax_benefit_models.us.datasets.create_datasets writes each US year file at its final path and stamps it afterwards (#593). Two problems follow.
Interleaved cuts mix one cut's tables with another's stamp. Two processes cutting the same year files in one data folder can interleave:
- P1 saves the tables of
pop_year_2026.h5. - P2 saves its own tables there, then stamps them.
- P1 stamps the file.
The file then holds P2's tables under P1's stamp. Every later ensure_datasets in P1's environment takes the file as current and reuses it. This happens, for example, when two sources share a name (two pop.h5 files) or when two environments with different package versions share a data folder.
A failed cut destroys good year files. When the source changes mid-cut (DatasetMaterializationError), or any later step fails, the year files already at those paths have been overwritten and left unstamped.
The stamp lacks the year. A year file copied or renamed to another year's name passes the check and is taken for that year.
The independent review of #601 found the first two problems for UK year files. #601 fixed them there with policyengine.provenance.year_file_stamp.temporary_year_file / publish_year_file, and added the year to the UK stamp.
Fix
Port #601's approach to the US create path:
- Write each year file, with its tables and renames record, to a hidden temporary file beside its path.
- Re-check the source, then stamp each temporary file and
os.replaceit onto its path. - Remove the temporaries in a
finally. - Record
"year"in the US stamp. This raiseslegacy_inputs.YEAR_FILE_STAMP_REVISIONto 3, andyear_file_stamp_problemtakes the year. - Saved outputs that record a year-file stamp (#594) follow the revision.
- Update docs/microsim.md "Year files", where the "takes no lock" limit changes.
- Vorherrschende Sprache
- Python
- Sterne
- 8
- Forks
- 10
- Ø Merge
- 1 T. 17 Std.
- Gemergte PRs (30 T.)
- 53
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PolicyEngine/policyengine.py
-
Raise the simulation cache memory warning to 16 GiBEvtl. vergeben @anth-volk hat das vor 36 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
PolicyEngine/policyengine.py#549 ·
Maintainer antworten meist innerhalb von 1 Tag
-
README population quickstart still teaches enhanced_frs_2023_24Evtl. vergeben @vahid-ahmadi hat das vor 13 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
PolicyEngine/policyengine.py#473 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
PolicyEngine/policyengine.py#436 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Certify populace-uk as the UK certified defaultEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
PolicyEngine/policyengine.py#408 ·
Maintainer antworten meist innerhalb von 1 Tag
-
US calculate_household puts every person in one marital unitEvtl. vergeben @MaxGhenis hat das heute übernommen. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 45/100
PolicyEngine/policyengine.py#738 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in PolicyEngine/policyengine.py
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
its-me-prash/vwgroup-connect-ha#2019 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
KonstantinStarovoytov/kitden#21 ·
Maintainer antworten meist innerhalb von 1 Tag
-
RefactorOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ehmatthes/gh-profiler#166 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
smart-on-fhir/smart-fetch#73 ·
-
good first issue help wanted
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 85/100
RizgarOzan/playcal#13 ·