Skip to content

How to update a ParameterScale? #793

Answered by nikhilwoodruff
MaxGhenis asked this question in Q&A
Discussion options

You must be logged in to vote

That cell works for me when modified to:

from openfisca_us.api import *
from openfisca_core import periods

def modify_parameters(parameters):
    parameters.contrib.ubi_center.basic_income.amount_by_age.brackets[0].amount.update(
        period=periods.period("year:2020:1"),
        value=100
    )
    return parameters


class add_child_allowance(Reform):
    def apply(self):
        self.modify_parameters(modify_parameters)

mreformed = Microsimulation(add_child_allowance, year=2020)

So, I think we need to use the brackets child before [0], and also import periods from openfisca_core.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MaxGhenis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants