Poverty gap docstrings overclaim FGT indices, and the poverty estimators have no tests
Les mainteneurs répondent en général sous 1 jour
@juaristi22 y travaille déjà.
Depuis le 22/9/2026.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
MicroDataFrame.squared_poverty_gap (microdataframe.py line 812) sums (threshold - income) ** 2 over people in poverty and returns that total. Its docstring says the result is "also known as the poverty severity index". It is not: the FGT severity index is the mean of the squared normalised gap, (1/N) Σ ((z - y) / z)^2, dimensionless and in [0, 1]. What the method returns is in currency squared.
poverty_gap and deep_poverty_gap are likewise unnormalised currency totals, not FGT(1). Only poverty_rate is an FGT index.
The test suite has no test of poverty_rate, deep_poverty_rate, poverty_gap, deep_poverty_gap or squared_poverty_gap (grep poverty microdf/tests/ finds only poverty_count).
Fix:
- Docstrings: state exactly what each returns (weighted headcount rate; weighted aggregate gap in currency units; weighted aggregate squared gap in currency squared) and drop "poverty severity index".
- Either add normalised FGT(1) and FGT(2) as
poverty_gap_index/poverty_severity_index, or state in the docs that they are out of scope. - Tests for all five methods with hand-computed expected values on a three-row frame with non-uniform weights, including a row exactly at the threshold and a zero-weight row.
- Langage dominant
- Python
- Étoiles
- 16
- Forks
- 10
- Merge moyen
- 5 j 3 h
- PR mergées (30 j)
- 21
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PolicyEngine/microdf
-
docs/examples.md still says MicroDataFrame.cov() and .corr() are unweightedPeut-être pris @juaristi22 l’a pris il y a 8 jours. Ouverte
PolicyEngine/microdf#335 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Fail closed: aggregation and construction paths that silently return unweighted resultsPeut-être pris @juaristi22 l’a pris il y a 8 jours. Ouvertebug
PolicyEngine/microdf#333 · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
PolicyEngine/microdf#314 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 65/100
PolicyEngine/microdf#264 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
PolicyEngine/microdf#223 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de PolicyEngine/microdf
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
letsencrypt/cp-cps#353 ·
-
Marble Madness II is missingOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
PedestrianDynamics/pyFDS-Evac#394 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
DOI-USGS/pywatershed#421 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
python-pillow/Pillow#10087 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour