Store every simulation result as rows in the simulation schema

Offen
#948 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
15/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python, sql
Bereich
backend, databases

Rechercherichtung

Start from the SingleYearMacroOutput result model, which defines every section and field that needs a column, and from the region catalog that supplies constituency and local-authority names by code. The issue names no file paths, so locate the Simulation Entrypoint and the current JSON-per-run storage first. Done means a round-trip test on the fixed sample reproduces each result exactly and every model field maps to a column.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

The Simulation Entrypoint will record every run's result itself. Results should be stored once, as rows, so they can be queried and kept across model and data versions, rather than as one JSON value per run:

  • one table per section of today's economy result model, SingleYearMacroOutput: a simulation's own figures (poverty rates, inequality, cliff exposure) on its simulation run, as each comparison computed them, and the comparison (budget, programs, income and wealth deciles, labour supply, congressional districts, constituencies, local authorities) on the report run;
  • a computed household as one JSON value on its simulation run;
  • links to each run's stored files, offered for 30 days while result rows stay for good;
  • a writer that validates a result and writes its rows in the transaction that marks the run succeeded, and a reader that rebuilds today's result format exactly, taking constituency and local-authority names and map positions from the region catalog by code;
  • tests: a round trip on a fixed sample (US national, state and congressional district; UK national, nation, constituency and local authority; a budget-window year; a household) reproduces each result exactly, and every field of the result model maps to a column.

No route writes results yet.

Vorherrschende Sprache
Python
Sterne
1
Forks
1
Ø Merge
1 T. 12 Std.
Gemergte PRs (30 T.)
71

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PolicyEngine/policyengine-sim-api

Alle Issues in PolicyEngine/policyengine-sim-api

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.