Skip to content

Commit

Permalink
Permet autre tax and benefit system dans utils
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainipp committed Nov 29, 2023
1 parent d5ba4ab commit 6f08986
Showing 1 changed file with 3 additions and 6 deletions.
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

0 comments on commit 6f08986

Please sign in to comment.