US year-file cuts can pair one cut's tables with another's stamp, and the stamp lacks the year
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 8
- Fork
- 10
- Merge trung bình
- 21 giờ 4 phút
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PolicyEngine/policyengine.py
-
The Budget reform contract's household route errors in the qualification gate: policyengine.uk is NoneCó thể đã có người làm @MaxGhenis đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
PolicyEngine/policyengine.py#650 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Raise the simulation cache memory warning to 16 GiBCó thể đã có người làm @anth-volk đã nhận 17 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
PolicyEngine/policyengine.py#549 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PolicyEngine/policyengine.py#473 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
PolicyEngine/policyengine.py#436 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Certify populace-uk as the UK certified defaultCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
PolicyEngine/policyengine.py#408 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của PolicyEngine/policyengine.py
Issue tương tự
-
`lvm_compact` has no self-hosted twin, and `docs/158` §5 says every language-face component mustĐang mởbug sev-3 vm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
sierra-research/tau2-bench#635 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The add-ssm-model skill requires a Cython simulator; the contributing guide allows Python onesCó thể đã có người làm @fmuia đã nhận hôm nay. Đang mởdocumentation skill
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
lnccbrown/ssm-simulators#406 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
btclib-org/btclib-ecc#309 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
autowarefoundation/autoware_carla_scenario#281 ·
Maintainer thường phản hồi trong vòng 1 ngày