Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Remove the unused economy comparison module

未关闭
#3,935 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@anth-volk 已经在做这个了。

开始于 2026年10月14日。

  • #3936 来自 @anth-volk —— 未关闭

评估

难度
3/5
预计耗时
半天
新手友好度
18/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
backend

调研方向

Start with policyengine_api/services/economy_comparison.py and grep the repo for imports of it, then review its unit and snapshot tests and the snapshot data. Check the api.routes.no-domain-logic-in-http rule so only the economy comparison node is dropped. Done means the module, its tests and snapshots are gone and the test suite still passes. Pull request #3936 is already open against this issue, so review it rather than starting a parallel change.

由索引模型根据 Issue 内容生成。

描述

Problem

policyengine_api/services/economy_comparison.py (915 lines) has had no caller in the package since #2569, which removed the Public API's own society-wide simulations. Only its own unit and snapshot tests use it: about 1,600 lines of tests, plus an 8,000-line snapshot file.

It still carries code that other work has to account for:

  • The enhanced FRS weight matrix. uk_constituency_breakdown and uk_local_authority_breakdown download it from Hugging Face. PolicyEngine/policyengine.py#553 lists that as a Public API dependency to resolve before the UK default moves to a Microcosm dataset.
  • The only microdf use in the package. The weighted-microdata rules (step 1.9) would otherwise guard and baseline code that never runs.
  • Rules for dead code. A route-boundary rule (api.routes.no-domain-logic-in-http) checks that the module stays out of the HTTP layer.

Proposal

Remove the module, its unit and snapshot tests, and the snapshot data.

  • api.routes.no-domain-logic-in-http keeps its calculation-route check and drops the economy comparison node.
  • microdf_python stays declared. Removing a dependency nothing imports is a separate cleanup, which the dependency check planned for step 2.7 would flag.
主要语言
Python
星标
18
派生
33
平均合并
1 天 18 小时
30 天内合并 PR
23

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PolicyEngine/policyengine-api 的其他 Issue

查看 PolicyEngine/policyengine-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。