From 6f0898616fe656731372c43e562d7c618df674e5 Mon Sep 17 00:00:00 2001 From: Duchesne Sylvain Date: Wed, 29 Nov 2023 13:40:29 +0100 Subject: [PATCH] Permet autre tax and benefit system dans utils --- openfisca_france_data/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/openfisca_france_data/utils.py b/openfisca_france_data/utils.py index 91cf6ce2..51d5c22b 100644 --- a/openfisca_france_data/utils.py +++ b/openfisca_france_data/utils.py @@ -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: @@ -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: @@ -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: