Store every simulation result as rows in the simulation schema

未關閉
#948 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
15/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python, sql
領域
backend, databases

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
Python
星號
1
分支
1
平均合併
1 天 12 小時
30 天內合併 PR
71

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

PolicyEngine/policyengine-sim-api 的其他 Issue

查看 PolicyEngine/policyengine-sim-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。