PolicyEngine / PolicyEngine/policyengine-core
Support scale parameter `.calc()` based on `threshold_variable` in parameter file
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 22
- Forks
- 30
- Avg merge
- 14h 33m
- Merged PRs (30d)
- 7
Description
If a scale parameter has a threshold_variable metadata field (#83), we could automatically calculate scale parameters.
For example, if the tax.mtr_schedule parameter had a threshold_variable: taxable_income metadata field, we could condense this formula:
taxable_income = tax_unit("taxable_income", period)
tax = parameters(period).tax.mtr_schedule.calc(taxable_income)
into this:
tax = parameters(period).tax.mtr_schedule.calc()
This further condenses the proposal in #84.
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 names no files or tests. Start by locating the scale-parameter .calc() implementation and the threshold_variable metadata handling, then determine how the example should work without an argument. Done means .calc() can derive the threshold variable for parameters declaring that metadata, with coverage for the shown tax.mtr_schedule case.
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
- Mostly clear
- Newbie friendliness
- 35/100