PolicyEngine / PolicyEngine/policyengine-core
Soft definition periods
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 22
- Forks
- 30
- Avg merge
- 14h 33m
- Merged PRs (30d)
- 7
Description
Definition periods in PolicyEngine Core are fixed: each variable must have exactly one time period for which it can have distinct values. Policy in country models often involves mid-year parameter changes or other ways that more flexible time period management might be useful.
Core has some shortcuts for this (e.g. set_input_divide, options=[ADD, DIVIDE]) but a more elegant solution to reduce the development burden on country models would just be to simplify all this into more autonomous Simulation behaviour: e.g. if I said my employment income was £30,000 per year, calculate my income tax in March, we really shouldn't need any country-specific logic describing how the time periods interact with each other here. The only thing we need to specify at the country level is whether each variable is a stock or a flow, because this implies different behaviour is correct:
- wealth in 2022 is 450k => wealth in 2022-01 is 450k
- income in 2022 is 30k => income in 2022-01 is 2.5k
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
The issue proposes more autonomous Simulation behavior for flexible definition periods, including stock-versus-flow handling, and mentions set_input_divide and options=[ADD, DIVIDE]. Start by reading those existing mechanisms and the Simulation behavior around time periods. The desired design and completion criteria are not specified, so clarify the scope before implementing.
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
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100