Record each run of a v2 simulation and report, and key results by run

Đang mở
#4,161 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@anth-volk đang làm issue này rồi.

Từ ngày 3/11/2026.

  • #4162 của @anth-volk — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
12/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
postgresql, python, supabase
Lĩnh vực
database

Hướng nghiên cứu

The v2 simulation tables live in the Supabase database, so start with the schema migrations that create simulations, reports, report_runs and household_jobs, and the result tables they feed. The issue asks for a new simulation_runs table, a join record between report runs and simulation runs, and role grants for two new database roles, so the migration needs to apply cleanly before the roles exist. Done means the migration applies on a fresh database, existing rows are kept, and no foreign keys cross from the simulation API tables to the Public API tables.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

API v2's simulation tables in the v2 Supabase database (simulations, reports, report_runs, household_jobs and the result tables) were designed for an execution model where each simulation ran once. We now want every run of a simulation or a report saved, with the PolicyEngine.py and country package versions it used, so a re-run keeps the earlier results, and the simulation API and its Modal workers will write these rows themselves.

What needs to change in the v2 schema:

  • a simulation_runs table: one row per run of a simulation, with its versions, status, Modal call and output file, instead of execution columns on simulations;
  • a record of which simulation runs each report run combines, so a budget window's run can combine one pair per year;
  • result rows keyed by the run that produced them;
  • household_jobs shaped for one household, one year and one policy, with its versions and Modal call;
  • no foreign keys between the tables the simulation API writes and the tables the Public API writes: each service checks the rows it refers to;
  • table privileges for two new database roles, one for the simulation API and one for its Modal workers, declared so the deploy can apply them once an operator has created the roles, without failing before then.

No table is dropped.

Ngôn ngữ chính
Python
Star
18
Fork
33
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
88

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PolicyEngine/policyengine-api

Tất cả issue của PolicyEngine/policyengine-api

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.