Openfisca-core

Latest version: v41.4.5

Safety actively analyzes 628903 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 44 of 60

20.0.0

Breaking changes

Change the way Variables are declared

- Replace `column` attribute by `value_type`
* Possible values of `value_type` are:
* `int`
* `float`
* `bool`
* `str`
* `date`
* `Enum`

Before:

py
class basic_income(Variable):
column = FloatCol
entity = Person
definition_period = MONTH
label = "Basic income provided to adults"


Now:

py
class basic_income(Variable):
value_type = float
entity = Person
definition_period = MONTH
label = "Basic income provided to adults"


- `default_value` is now a `Variable` attribute

Before:

py
class is_citizen(Variable):
column = BoolCol(default = True)
entity = Person
definition_period = MONTH
label = "Whether the person is a citizen"


Now:

py
class is_citizen(Variable):
value_type = bool
default_value = True
entity = Person
definition_period = MONTH
label = "Whether the person is a citizen"


- For `Variables` which `value_type` is `str`, `max_lentgh` is now an attribute

Before:

py
class zipcode(Variable):
column = FixedStrCol(max_length = 5)
entity = Menage
label = u"Code INSEE (depcom) du lieu de résidence"
definition_period = MONTH


After:

py
class zipcode(Variable):
value_type = str
max_length = 5
entity = Menage
label = u"Code INSEE (depcom) du lieu de résidence"
definition_period = MONTH


- For `Variables` which `value_type` is `Enum`, `possible_values` is now an attribute:

Before:

py
class housing_occupancy_status(Variable):
column = EnumCol(
enum = Enum([
u'Tenant',
u'Owner',
u'Free lodger',
u'Homeless'])
)
entity = Household
definition_period = MONTH
label = u"Legal housing situation of the household concerning their main residence"


After:

py
class housing_occupancy_status(Variable):
value_type = Enum
possible_values = Enum([
u'Tenant',
u'Owner',
u'Free lodger',
u'Homeless'
])
entity = Household
definition_period = MONTH
label = u"Legal housing situation of the household concerning their main residence"


- Remove `PeriodSizeIndependentIntCol`:
* Replaced by `Variable` attribute `is_period_size_independent`


Deprecate `Column`

`Column` are now considered deprecated. Preferably use `Variable` instead.

If you do need a column for retro-compatibility, you can use:

py
from openfisca_core.columns import make_column_from_variable

column = make_column_from_variable(variable)



- In `TaxBenefitSystem`:
* Remove `neutralize_column` (deprecated since `9.1.0`, replaced by `neutralize_variable`)
* Rename `column_by_name` to `variables`
* Rename `get_column` to `get_variable`
* Remove `update_column`
* Remove `add_column`
* Remove `automatically_loaded_variable` (irrelevant since conversion columns have been removed)
* Move `VariableNotFound` to `errors` module


- In `Holder`:
* Rename `holder.column` to `holder.variable`

- In `Column`:
* `Column` should only be instantiated using `make_column_from_variable`. Former constructors do not work anymore.
* Remove `column.start`, which was `None` since `14.0.0`
* Replace `column.formula_class` by `variable.formula`
* Replace `column.enum` by `variable.possible_values`
* Replace `column.default` by `variable.default_value`

- In `formulas`:
* Rename `get_neutralized_column` to `get_neutralized_variable`
* Remove `new_filled_column`

- In `Variable`:
* Remove `to_column`
* Variables can now directly be instanciated:

py
class salary(Variable):
entity = Person
...


salary_variable = salary()


You can learn more about `Variable` by checking its [reference documentation](https://openfisca.org/doc/openfisca-python-api/variables.html).

19.0.0

18.2.0

Breaking changes

- Change the way the API is started
* The previous command `COUNTRY_PACKAGE=openfisca_country gunicorn ...` does not work anymore
* The new command to serve the API is `openfisca serve`.
* Read more in the [doc](https://openfisca.readthedocs.io/en/latest/openfisca_serve.html)
* This command allows to serve reforms and extensions in the new API

- In `openfisca-run-test` and `openfisca-serve`, rename option `--country_package` to `--country-package`

18.1.0

New features

- Improve the representations of parameters when navigating the legislation in Python.

For instance:

tax_benefit_system.parameters.benefits

>>> basic_income:

18.0.2

- Track the real visitor IP in the web API
- Handle the nginx proxy

18.0.1

- Add a link in `openAPI.yml` to the OpenFisca documentation page explaining the web API inputs and outputs for the /calculate route.

Page 44 of 60

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.