You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create economy simulations and reports through POST /simulations and POST /reports #1049
The detailed-save API's economy path needs the Simulation Entrypoint to create economy simulations and reports in the Public API's run tables and start their calculation on the v2 coordinator and workers, which write the results.
Needed:
POST /reports (economy kind) creates the report, its two simulations and their first runs, and its first report run, then starts the report run's coordinator with the report and its run IDs, with no Stage 12 evaluation record. A side whose simulation already succeeded on the same versions reuses that run, as long as its output file is in the output bucket.
POST /simulations creates a standalone economy simulation and its first run, and starts that run's simulation function by its run ID.
Each request checks every row it names before writing, so a refusal names what's missing; a foreign-key violation on insert is answered as the caller's error. The service records a Modal call's ID once Modal accepts it, or fails the run at once when Modal refuses it, only while the run is still pending with no call ID.
The answers match the Public API's client: 201 with the record's and its first run's IDs; 400 with unknown_region, unknown_dataset or unknown_dynamic for the caller's rows, or another code for the service's state; 422 for data that can't be calculated; 503 naming the created record when its run failed; 500 internal_error.
GET /reports/{report_id} and GET /simulations/{simulation_id} return each record's newest run.
Every staging deploy creates a small economy report and requires its run to succeed; a failure stops the production deploy.
This replaces the draft #974, which was built on tables that no longer exist.
Activity