How to update a ParameterScale? #793
-
I'd like to update a child allowance value. Child allowances are the 0th element in from openfisca_us.api import *
def modify_parameters(parameters):
parameters.contrib.ubi_center.basic_income.amount_by_age[0].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)
I also tried this but it produced the same error: parameters.contrib.ubi_center.basic_income.amount_by_age.update(
period=periods.period("year:2020:1"),
value=[100, 0, 0]
) |
Beta Was this translation helpful? Give feedback.
Answered by
nikhilwoodruff
May 18, 2022
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
MaxGhenis
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That cell works for me when modified to:
So, I think we need to use the
brackets
child before[0]
, and also importperiods
fromopenfisca_core
.