PolicyEngine / PolicyEngine/ccdf-calculator

Fix North Carolina monthly copay being divided by 12 twice

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

For one working adult earning $30,000/year with children ages 3 and 7, the default $1,500/month charge per child, and the default North Carolina provider/county, the app displays a $20.83/month copay (rounded to $21). The underlying model returns $250 for each month.

Reproduced against the committed grid (policyengine-us 1.824.8):

  • nc_scca_parent_fee requested for 2026: 250.
  • The same variable requested for each of the 12 months: 250 each, totaling 3,000.
  • monthly_copay() divides the annual-request value by 12, incorrectly producing 20.83.

An all-state check for this reference household found NC was the only copay whose annual request differed from the sum of its monthly requests. This is a period-aggregation issue, not a claim that the state's fee rate is wrong.

Calculate monthly values explicitly and average them, preserving daily/weekly conversion factors. Audit the live-result reader, which makes the same annual-sum assumption; regenerate the affected state and comparison data. Add a regression using the actual model's monthly versus annual response behavior.

Sources: scripts/precompute.py, src/lib/api.ts.

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 by reading scripts/precompute.py and src/lib/api.ts, then reproduce the North Carolina household case against policyengine-us 1.824.8. Trace both precomputed and live-result period aggregation, add the regression for the model's monthly versus annual responses, and confirm affected state and comparison data are regenerated with daily and weekly conversions preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
api, backend, data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.