Request UK constituency and local-authority impacts separately from the national economy result
维护者通常 3 天内回复
评估
调研方向
Read the annual economy route and its request validation, calculation options and cache key handling, then trace how it builds simulation API requests and handles upstream errors. Check the existing dataset and .py bundle configuration for the requested updates, including the Northern Ireland region mapping. Done means the supported UK requests produce separately cached local-area results and invalid combinations or upstream refusals return the specified errors; coordinate deployment with simulation API change #881 and the app change.
由索引模型根据 Issue 内容生成。
描述
What this is about
.py 6.10.0 runs UK national economy reports on a national dataset (microcosm_uk_2024_25) that has no area codes, so a national run no longer returns constituency or local-authority impacts. The simulation API (PolicyEngine/policyengine-sim-api#881) adds a separate run on the local-area dataset that returns only those impacts. The Public API needs a way to ask for that run.
What changes in the Public API
- The annual economy route,
GET /{country}/economy/{reform}/over/{baseline}, accepts a new optional query parameter,breakdown=local_areas. The budget-window route does not accept it. - The parameter is valid only for the UK, with
regionset toukor a UK country (country/*), and not withtarget=cliff. Any other combination, or any other value, returns HTTP 400. - When the parameter is set, it becomes part of the calculation options, so the request gets its own options hash and its own cached result. Requests without it keep their current options hash and cached results.
- The Public API sends
"breakdown": "local_areas"to the simulation API only when the parameter is set, and stores and returns the result the simulation API sends back (kind: "local_areas", withconstituency_impactandlocal_authority_impact). - If the simulation API refuses a breakdown request with HTTP 400 or 422 (for example, because the deployed .py release cannot run it), the Public API returns a 502 error that says so, instead of a generic 500.
- UK reports for Northern Ireland use
country/niin the Public API's metadata, but .py's region registry names that regioncountry/northern_ireland. The Public API translates the name when it builds the simulation request. - The .py bundle moves from 6.7.5 to 6.10.0 (this replaces #3991), and the reviewed UK default dataset becomes
microcosm_uk_2024_25.
Order of deployment
This change has to merge after the simulation API change (PolicyEngine/policyengine-sim-api#881) is deployed with .py 6.10.0, and after the app change that requests the breakdown is merged.
- 主要语言
- Python
- 星标
- 18
- 派生
- 33
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 36
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PolicyEngine/policyengine-api 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
PolicyEngine/policyengine-api#3911 ·
维护者通常 3 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
PolicyEngine/policyengine-api#3910 ·
维护者通常 3 天内回复
-
Stop serving economy results cached with ×100 decile relative changes可能已有人在做 @anth-volk 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 45/100
PolicyEngine/policyengine-api#4025 ·
维护者通常 3 天内回复
-
Store the metadata v3 reads in the v2 catalog, from PolicyEngine.py's public records可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
PolicyEngine/policyengine-api#4022 ·
维护者通常 3 天内回复
-
Publish v2 catalog regions from the Public API's own region reference files可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 5/5 一周以上 新手友好度 38/100
PolicyEngine/policyengine-api#4019 ·
维护者通常 3 天内回复
查看 PolicyEngine/policyengine-api 的全部 Issue
相似的 Issue
-
[oblt-aw][autodoc] Update workflow docs for gh-aw v0.92.5 and detector permission scope可能已有人在做 @github-actions 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
roadmap-100
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
comp/tools P2 tool/browser tool/file type/bug
难度 2/5 1-3 小时 新手友好度 75/100
NousResearch/hermes-agent#143418 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
python-hyper/uritemplate#164 ·