PolicyEngine / PolicyEngine/policyengine-core
Add safe return to `Microsimulation.calc`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 22
- Forks
- 30
- Avg merge
- 14h 33m
- Merged PRs (30d)
- 7
Description
Often we want to calculate a variable across both baseline and reform simulations, where it only exists in the reform, e.g. UBI. We could add a safe=bool keyword argument which would return an array of zeros. This would probably require that map_to is also passed, in order to know what shape array to return.
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 at the Microsimulation.calc entry point and inspect how variables that exist only in a reform are currently handled. Define the expected behavior for a safe calculation, including the required map_to shape, and add coverage showing that the reform-only variable returns zeros in the baseline simulation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100