A supplied UC latent deduction rate can give deductions to a unit flagged as having none
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 57/100
Línea de trabajo
Read uc_deduction_rate, uc_latent_deduction_rate and _reduction_allocation.py to trace how a supplied rate and the protected floor affect deductions. Add the requested YAML case with a positive supplied rate, uc_has_deduction set to False and a floor, plus the property or documented exception described in the issue. Check that the example unit and the current law and protected floor cases behave as intended.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
A supplied uc_latent_deduction_rate can produce UC deductions for a benefit unit whose uc_has_deduction is False.
uc_latent_deduction_rate's formula returnswhere(has_deduction, rate, 0), so the formula path never gives an unflagged unit a positive rate.uc_deduction_ratereads the latent rate, not the flag. A rate supplied as an input, by a dataset or a user situation, therefore skips the flag.- Under current law this shows only when the unit has award left after the cap.
allocate_uc_reductionstakes deductions frommax(pre-cap award − gross cap − penny, 0). - Under a protected floor it also shows when the gross cap takes the whole award. The floor branch (
_reduction_allocation.py,floor_deductions = …) takes deductions from the pre-cap award. Meanwhileuc_has_deductionreads the award left after the gross cap, so it is False for that unit.
Example (from the independent review of #2647, with an 85% protected floor): EXAMPLE_UNITS[5] gets uc_deductions of £720.25 with uc_has_deduction False, and an applied cap of 0. Under current law the same unit has deductions of 0 and an applied cap of £1,000.
How often on the certified Microcosm file
None. The UK hub's #2647 runs on Microcosm build a6299504 (28–29 October) counted units with uc_deductions > 0 and uc_has_deduction False:
| Run | Benefit-unit records | Weighted units | Amount |
|---|---|---|---|
| Head, current law, each year 2025–2030 | 0 | 0 | £0 |
| Base and head, benefit cap at £5,000, 2025 | 0 | 0 | £0 |
| Base and head, 85% protected floor, 2025 | 0 | 0 | £0 |
So Microcosm's stored latent rates agree with the flag. The gap is reachable only through a supplied rate that disagrees with it.
Fix: pick one
- Make the deduction demand zero when
uc_has_deductionis False, for example inuc_deduction_rate, so that a supplied rate follows the same rule as the formula path. - Or document that a supplied
uc_latent_deduction_rateoverrides the flag, and say why.
Separately, decide what the flag should mean under a floor. It reads the award left after the gross cap. That is "no award left, so no deductions" under current law, but under a floor the family keeps an award that deductions can come from.
Either way, add:
- a YAML case with a supplied positive latent rate,
uc_has_deductionFalse and a floor; - a property that
uc_deductionsis 0 whenever the flag is False, or the documented exception.
Context
This came up as finding P3-6 in the independent review of #2647. That PR doesn't cause it: its awards and deductions equal the reference. But it shapes what benefit_cap_reduction reports under a floor.
axiom: n/a: uc_has_deduction and uc_latent_deduction_rate are imputations under gov.simulation, not law; the protected floor is JRF's proposal, zero under current law.
- Lenguaje dominante
- Python
- Estrellas
- 53
- Forks
- 34
- Merge medio
- 4 d 54 min
- PR fusionados (30 d)
- 381
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PolicyEngine/policyengine-uk
-
Correct the agency or coverage of six programmes in programs.yamlPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
PolicyEngine/policyengine-uk#2696 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Follow-ups from #2160: qualifying-age docstring, UC work-related groups property-file speed, changelog fragment examplePosiblemente ocupada @juaristi22 la tomó hace 14 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
PolicyEngine/policyengine-uk#2162 ·
Los mantenedores suelen responder en 2 días
-
UC taper cut from 55% to 50%: about 12,000 households lose despite higher Universal CreditPosiblemente ocupada @juaristi22 la tomó hace 1 día. Abierto
PolicyEngine/policyengine-uk#2753 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 57/100
PolicyEngine/policyengine-uk#2752 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
PolicyEngine/policyengine-uk#2748 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de PolicyEngine/policyengine-uk
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
vllm-project/vllm#64845 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
dekobon/big-code-analysis#1729 ·
Los mantenedores suelen responder en 1 día
-
Add `openai_safety_identifier`, the replacement for the `user` field that `openai_user` sendsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
pydantic/pydantic-ai#12091 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100