Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Remove the unused economy comparison module

Aberta
#3,935 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@anth-volk já está trabalhando nisso.

Desde 14/10/2026.

  • #3936 de @anth-volk — aberto

Avaliação

Dificuldade
3/5
Tempo estimado
Meio dia
Facilidade para iniciantes
18/100
Tipo de issue
Refatoração
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
python
Domínio
backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.
Linguagem predominante
Python
Estrelas
18
Forks
33
Merge médio
1d 18h
PRs com merge (30d)
23

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de PolicyEngine/policyengine-api

Todas as issues de PolicyEngine/policyengine-api

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.