Represents the legislation.
It stores parameters (values defined for everyone) and variables (values defined for some given entity e.g. a person).
Directory containing the YAML parameter files.
Adds a list of OpenFisca Variables to the TaxBenefitSystem.
See also add_variable
Recursively explores a directory, and adds all OpenFisca variables found there to the tax and benefit system.
Adds all OpenFisca variables contained in a given file to the tax and benefit system.
Generates a new tax and benefit system applying a reform to the tax and benefit system.
The current tax and benefit system is not mutated.
reform_path (str
) – The reform to apply. Must respect the format installed_package.sub_module.reform
TaxBenefitSystem – A reformed tax and benefit system.
Example
>>> self.apply_reform("openfisca_france.reforms.inversion_revenus")
Gets metadata relative to the country package.
Example
>>> tax_benefit_system.get_package_metadata()
>>> {
>>> 'location': '/path/to/dir/containing/package',
>>> 'name': 'openfisca-france',
>>> 'repository_url': 'https://github.com/openfisca/openfisca-france',
>>> 'version': '17.2.0'
>>> }
Get the parameters of the legislation at a given instant.
Get a variable from the tax and benefit system.
Loads the legislation parameter for a directory containing YAML parameters files.
path_to_yaml_dir – Absolute path towards the YAML parameter directory.
Example: >>> self.load_parameters(“/path/to/yaml/parameters/dir”)
Neutralizes an OpenFisca variable existing in the tax and benefit system.
A neutralized variable always returns its default value when computed.
Trying to set inputs for a neutralized variable has no effect except raising a warning.
Replaces an existing variable by a new one.
The new variable must have the same name than the replaced one.
If no variable with the given name exists in the Tax-Benefit system, no error will be raised and the new variable will be simply added.
Update an existing variable in the Tax-Benefit system.
All attributes of the updated variable that are not explicitly
overridden by the new variable
will stay unchanged.
The new variable must have the same name than the updated one.
If no variable with the given name exists in the tax and benefit system, no error will be raised and the new variable will be simply added.