PolicyEngine / PolicyEngine/policyengine.py

Preserve nullable SPM statuses in wrapper summaries and JSON

Open
#518 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.