PolicyEngine / PolicyEngine/policyengine-core

Support scale parameter `.calc()` based on `threshold_variable` in parameter file

Open
#85 0 comments 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

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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.