Base class for various types of parameters implementing the at instant protocol.
A parameter of the legislation.
Parameters can change over time.
List of the values, in reverse chronological order.
Instantiate a parameter without metadata:
>>> Parameter('rate', data = {
"2015-01-01": 550,
"2016-01-01": 600
})
Instantiate a parameter with metadata:
>>> Parameter('rate', data = {
'description': 'Income tax rate applied on salaries',
'values': {
"2015-01-01": {'value': 550, 'metadata': {'reference': 'http://taxes.gov/income_tax/2015'}},
"2016-01-01": {'value': 600, 'metadata': {'reference': 'http://taxes.gov/income_tax/2016'}}
}
})
Change the value for a given period.
period – Period where the value is modified. If set, start and stop should be None.
start – Start of the period. Instance of openfisca_core.periods.Instant. If set, period should be None.
stop – Stop of the period. Instance of openfisca_core.periods.Instant. If set, period should be None.
value – New value. If None, the parameter is removed from the legislation parameters for the given period.
A value of a parameter at a given instant.
A node in the legislation parameter tree.
Add a new child to the node.
name – Name of the child that must be used to access that child. Should not contain anything that could interfere with the operator . (dot).
child – The new child, an instance of ParameterScale
or Parameter
or ParameterNode
.
Parameter node of the legislation, at a given instant.
A parameter scale (for instance a marginal scale).
A parameter scale bracket.
Parameter node of the legislation at a given instant which has been vectorized. Vectorized parameters allow requests such as parameters.housing_benefit[zipcode], where zipcode is a vector.
Load parameters from a YAML file (or a directory containing YAML files).
An instance of ParameterNode
or ParameterScale
or Parameter
.