PolicyEngine / PolicyEngine/policyengine.py
Preserve nullable SPM statuses in wrapper summaries and JSON
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7
- Forks
- 9
- Avg merge
- 15h 51m
- Merged PRs (30d)
- 9
Description
Nullable Supplemental Poverty Measure (SPM) status outputs must retain the difference between an observed nonpoor population and an empty measurement universe.
The wrapper currently returns a zero poverty rate when eligible weighted population is zero. Its generic means can return NaN or raise for zero weights, household scalar conversion preserves nonfinite values, and generic upward entity mapping can turn missing status flags into measured zero.
The bounded fix should return null rates/means for empty eligible denominators, preserve nullable poverty DataFrame exports and strict household JSON, and reject undefined upward/group-to-group mapping of the five SPM status aliases in measured-variable and filter paths. Native summaries and projection to people remain supported.
Validate with synthetic weighted data and actual wrapper mapping. This issue does not change dependency pins, source/year/membership inference, outside-universe resource valuation, certified data, or managed-runtime qualification. Canonical bundle/loading/release work remains tracked in #515.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the wrapper summary and JSON paths described in the issue, then trace generic means, household scalar conversion, and upward entity mapping for the five SPM status aliases. Validate with synthetic weighted data and actual wrapper mapping; done means empty denominators produce nulls, nullable exports and strict household JSON are preserved, and undefined upward mappings are rejected while native summaries and projection to people still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100