Skip to content

Commit

Permalink
Merge pull request #243 from openfisca/other_tax_benefit_system
Browse files Browse the repository at this point in the history
Permet de modifier tax and benefit system dans utils
  • Loading branch information
sylvainipp authored Nov 29, 2023
2 parents d5ba4ab + 148b0a9 commit d158593
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 3.0.2 [#243](https://github.com/openfisca/openfisca-france-data/pull/243)
* Technical changes:
- Ajoute la possibilité d'utiliser un tax and benefit system plus en aval dans les fonctions de utils.py

### 3.0.1 [#242](https://github.com/openfisca/openfisca-france-data/pull/242)
* Technical changes:
- Passage à Openfsca-France >= 155.0.0
Expand Down
9 changes: 3 additions & 6 deletions openfisca_france_data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ def check_structure(dataframe):
return False, erroneous_ids_by_entity


def build_cerfa_fields_by_column_name(year, sections_cerfa):
tax_benefit_system = openfisca_france_tax_benefit_system
def build_cerfa_fields_by_column_name(year, sections_cerfa, tax_benefit_system = openfisca_france_tax_benefit_system):
cerfa_fields_by_column_name = dict()
for name, column in tax_benefit_system.variables.items():
for section_cerfa in sections_cerfa:
Expand All @@ -248,8 +247,7 @@ def build_cerfa_fields_by_column_name(year, sections_cerfa):
return cerfa_fields_by_column_name


def build_cerfa_fields_by_variable(year):
tax_benefit_system = openfisca_france_tax_benefit_system
def build_cerfa_fields_by_variable(year, tax_benefit_system = openfisca_france_tax_benefit_system):
cerfa_fields_by_variable = dict()
for name, variable in sorted(tax_benefit_system.variables.items()):
if variable.cerfa_field is None:
Expand Down Expand Up @@ -318,8 +316,7 @@ def normalizes_roles_in_entity(dataframe, entity_id_name, entity_role_name):
dataframe[entity_role_name] = dataframe[entity_role_name].astype('int')


def set_variables_default_value(dataframe, year):
tax_benefit_system = openfisca_france_tax_benefit_system
def set_variables_default_value(dataframe, year, tax_benefit_system = openfisca_france_tax_benefit_system):

for column_name, column in tax_benefit_system.variables.items():
if column_name in dataframe.columns:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name = "OpenFisca-France-Data",
version = "3.0.1",
version = "3.0.2",
description = "OpenFisca-France-Data module to work with French survey data",
long_description = long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit d158593

Please sign in to comment.