PolicyEngine / PolicyEngine/policyengine-core

Proposal: preserve missing-input state instead of collapsing it to zero

Open
#513 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
22
Forks
30
Avg merge
14h 33m
Merged PRs (30d)
7

Description

I have been testing SNAP-style screener flows in policyengine-us, and I found that omitted monetary inputs behave the same as explicit zeros at the engine boundary.

Concrete examples (Texas SNAP household)
  • No employment_income / self_employment_income provided:
    • snap_gross_income = 0.0
    • snap_net_income = 0.0
    • snap = 291.0
  • No child_support_expense provided:
    • snap_child_support_deduction = 0.0
  • No housing_cost provided:
    • snap_excess_shelter_expense_deduction = 0.0

That is convenient for fully specified simulations, but it makes it impossible to tell the difference between:

  1. The user intentionally entered zero, and
  2. The user did not provide the field at all.

For screener-style and partially completed scenarios, that distinction matters. A missing income field should usually be represented as unknown or incomplete, not silently coerced to zero.

Questions for maintainers

Would any of these approaches be idiomatic?

  • A preserved missingness state on input holders
  • An explicit valueState-like annotation for inputs
  • A documented partial-input mode that propagates "cannot determine" rather than defaulting to zero

I am not proposing an engine-wide rewrite. I am asking whether there is an accepted way to distinguish missing from zero today. If not, I would be glad to follow up with a narrow proposal.

Runtime used for the cases: policyengine-core==3.28.0, policyengine-us==1.755.5.

Evidence packet (external): https://github.com/edithatogo/rulesandprocesses/blob/main/external/policyengine/MISSINGNESS_CASES.md

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

Reproduce the Texas SNAP examples using policyengine-core==3.28.0 and policyengine-us==1.755.5, comparing omitted inputs with explicit zeros. Read the existing input-handling behavior and the referenced MISSINGNESS_CASES.md evidence, then document whether an accepted distinction exists or produce a narrow proposal for preserving missingness.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.