Program statistics count every unchanged tax unit as both a winner and a loser
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 82/100
Direção de pesquisa
Leia src/policyengine/outputs/program_statistics.py, especialmente os limites de ChangeAggregate em ProgramStatistics.run(). Adicione ou atualize um teste que cubra um imposto inalterado e verifique se ele resulta em zero vencedores e zero perdedores. A issue estará concluída quando os limites de vencedores e perdedores de impostos corresponderem às direções sugeridas e o teste de regressão passar.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Filed by Claude Code for Max.
ProgramStatistics.run() inverts the winners and losers thresholds for taxes, so every unit whose tax doesn't change counts as both a winner and a loser.
src/policyengine/outputs/program_statistics.py on main (lines 85–103; the same in 6.20.3):
winners = ChangeAggregate(..., change_geq=0.01 if not self.is_tax else -0.01)
losers = ChangeAggregate(..., change_leq=-0.01 if not self.is_tax else 0.01)
For a tax, change >= -0.01 keeps every unit whose tax stayed the same or rose, and change <= 0.01 keeps every unit whose tax stayed the same or fell.
What it prints. With 6.20.3 and the default US dataset, pe.us.economic_impact_analysis for a single filer standard deduction of $30,950 in 2026 gives these rows:
| program_name | change | winners | losers |
|---|---|---|---|
| income_tax | -9.149107e+10 | 1.159564e+08 | 1.644485e+08 |
| employee_payroll_tax | 0 | 1.653825e+08 | 1.653825e+08 |
The payroll tax doesn't change, yet every unit counts as both a winner and a loser. Income tax falls, yet more units count as losers than winners. The UK example on policyengine.org/uk/python shows the same pattern for national_insurance: 7.120972e+07 winners and 7.120972e+07 losers at zero change.
Suggested fix. For a tax, count winners as change <= -0.01 and losers as change >= 0.01. Add a test in which an unchanged tax yields zero winners and zero losers.
PolicyEngine/household-api-docs#28 stops showing these two columns in the US examples on /us/python until a fix ships.
🤖 Generated with Claude Code
- Linguagem predominante
- Python
- Estrelas
- 10
- Forks
- 10
- Merge médio
- 2d 2h
- PRs com merge (30d)
- 16
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PolicyEngine/policyengine.py
-
Model version publishes the new UK firm entity as a personTalvez já em andamento @vahid-ahmadi assumiu há 4 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
PolicyEngine/policyengine.py#764 ·
Mantenedores costumam responder em até 1 dia
-
Raise the simulation cache memory warning to 16 GiBTalvez já em andamento @anth-volk assumiu há 57 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
PolicyEngine/policyengine.py#549 ·
Mantenedores costumam responder em até 1 dia
-
README population quickstart still teaches enhanced_frs_2023_24Talvez já em andamento @vahid-ahmadi assumiu há 35 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
PolicyEngine/policyengine.py#473 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
PolicyEngine/policyengine.py#436 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Certify populace-uk as the UK certified defaultTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
PolicyEngine/policyengine.py#408 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de PolicyEngine/policyengine.py
Issues semelhantes
-
claude-subscription-directsdk: tool calls with raw control characters in string values are droppedAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
NousResearch/hermes-official-plugins#538 ·
Mantenedores costumam responder em até 3 dias
-
bug(qdiffusion): EnergyModel.score_visible_logits computes biased visible/hidden on-ratios when solver returns variable solution counts per candidateTalvez já em andamento @houzhongyu assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
qboson/kaiwu-pytorch-plugin#2133 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
MakazhanAlpamys/Soup#3415 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 2 dias