Utilisation de Survey Scenario

# Activate multi-output in notebook
from IPython.core.interactiveshell import InteractiveShell

InteractiveShell.ast_node_interactivity = "all"
import numpy as np
import pandas as pd

# Not exported
from openfisca_france_data.model.common import decile_rfr
from openfisca_survey_manager.statshelpers import mark_weighted_percentiles
/tmp/ipykernel_10462/2049846552.py:2: DeprecationWarning: 
Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),
(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)
but was not found to be installed on your system.
If this would cause problems for you,
please provide us feedback at https://github.com/pandas-dev/pandas/issues/54466
        
  import pandas as pd
print(config)
config.get("SURVEY_MANAGER_CONFIG_PATH")
# cache.clear_cache()
Config loaded from /home/cgl/leximpact/leximpact-so/.env OR/AND environement variables
'/mnt/data-out/leximpact-socio-fiscal-simu-etat/integ'
# NB_FOYER = 40_290_476  # 39_818_220 dans POTE 2020, d'où vient le 40 millions ?
# 2_458_482_400_000.0 != 2_545_026_900_000
# RFR_SUM = 2_458_482_400_000  # 2_545_026_900_000  # 1 104 768 273,172 € de revenus 2020 d'après Bercy
# RFR_SUM = 1_104_768_273_172  # € de revenus 2020 d'après Bercy
# IRPP Brut PLF 2023 : 109_776_000_000 page 26 de PLF-2023.pdf
# IRPP_PLF_2023 = 86_887_586_871  # 86,8 Md€ page 134
# IRPP_AGG = aggregates_sum[1]
# CSG_AGG = aggregates_sum[0]
# tc.assertEqual(IRPP_AGG["2023"], IRPP_PLF_2023)

rounddown

 rounddown (number)

Met à 0 60% des chiffres pour ne pas remonter de valeurs personnelles

tc.assertEqual(rounddown(5124), 5100)
tc.assertEqual(rounddown(-8837.2373046875), -8800)

Création de la simulation

C’est là que se fait l’initialisation du Survey Scenario, c’est lui qui va charger les données et prendre en compte les TaxBenefitSystem.

# import os
# import pickle


# def lex_cache(cachefile):
#     """
#     A function that creates a decorator which will use "cachefile" for caching the results of the decorated function "fn".
#     """

#     def decorator(fn):  # define a decorator for a function "fn"
#         def wrapped(
#             *args, **kwargs
#         ):  # define a wrapper that will finally call "fn" with all arguments
#             # if cache exists -> load it and return its content
#             if os.path.exists(cachefile):
#                 with open(cachefile, "rb") as cachehandle:
#                     logger.debug("using cached result from '%s'" % cachefile)
#                     return pickle.load(cachehandle)

#             # execute the function with all arguments passed
#             res = fn(*args, **kwargs)

#             # write to cache file
#             with open(cachefile, "wb") as cachehandle:
#                 print("saving result to cache '%s'" % cachefile)
#                 pickle.dump(res, cachehandle)

#             return res

#         return wrapped

#     return decorator  # return this "customized" decorator that uses "cachefile"
# !rm /tmp/create_survey_scenario.tmp

get_tax_benefit_systems


get_amendement_tax_benefit_system

 get_amendement_tax_benefit_system (reformParameters, scenario)

get_tax_benefit_systems

 get_tax_benefit_systems (reformParameters)

Création du Survey Scenario


delete_survey_scenario

 delete_survey_scenario ()

get_survey_scenario

 get_survey_scenario
                      (request:leximpact_socio_fisca_simu_etat.schema.Refo
                      rmeSocioFiscale, dump_suffix:str='')

Met à jour le survey_scenario s’il existe déjà pour cette période.


create_survey_scenario

 create_survey_scenario (period:str, baseline_tax_benefit_system:openfisca
                         _core.taxbenefitsystems.tax_benefit_system.TaxBen
                         efitSystem, amendement_tax_benefit_system:Optiona
                         l[openfisca_core.taxbenefitsystems.tax_benefit_sy
                         stem.TaxBenefitSystem], plf_tax_benefit_system:Op
                         tional[openfisca_core.taxbenefitsystems.tax_benef
                         it_system.TaxBenefitSystem], dump_suffix:str='')

Create OpenFisca simulation from data.

Calcul une réforme

Ici on combine les méthodes ci-dessus pour obtenir le résultat. Le montant de la réforme est extrapolé à la France entière en utilisant le “poids” de l’individu dans la population française pour obtenir le montant global pour l’Etat.

Sans Survey Scenario nous faisions: - Calcul de la base => Renvoie du résultat - Calcul du PLF => Renvoie du résultat - Calcul de l’amendement => Renvoie du résultat

Avec Survey Scenario, il faut : - Calcul de la base et du PLF et de l’amendement => Renvoie des 3 résultats

add_default_to_quantiles


add_default_to_quantiles

 add_default_to_quantiles (quantiles:List, variable)

For compatibility issue we add a default variable equal to the max value.

return: - Modified quantiles Warning : the input quantiles is also modified !

quantiles = [{"rfr_max": -1234.56778}, {"rfr_max": 30}]
_ = await add_default_to_quantiles(quantiles, "rfr")
tc.assertEqual(quantiles[0]["rfr_max"], -1200)
tc.assertEqual(quantiles[1]["rfr_max"], 1e15)

winners_loosers


winners_loosers

 winners_loosers (scenario:leximpact_survey_scenario.leximpact_survey_scen
                  ario.LeximpactErfsSurveyScenario, variable:str,
                  mode:str, annee_de_calcul:int)

Compute winners and loosers for a given variable. mode: “base” or “plf” or “amendement_base” or “amendement_plf”

Calcul des quantiles


compute_quantile

 compute_quantile (scenario, variables, by, plf_exist, amendement_exist,
                   annee_de_calcul)

Compute quantiles for a given scenario. Return a tuple (quantiles_baseline, quantiles_plf, quantiles_amendement)

### compute_reform


compute_reform

 compute_reform (reformParameters:leximpact_socio_fisca_simu_etat.schema.R
                 eformeSocioFiscale, use_cache=True, debug=False,
                 dump_suffix:str='')

Utilise OpenFisca pour effectuer les différentes simulations: - baseline : Le contre-factuel - PLF : Le Projet de Loi de Finances à venir - amendement : L’amendement proposé par le député

Args: ::reformParameters:: ReformeSocioFiscale ::use_cache:: Si on souhaite utiliser le cache ::debug:: Si on souhaite avoir des logs détaillées

Returns: ::simu_baseline:: OneSimulationResult ::simu_plf:: OneSimulationResult ::simu_amendement:: OneSimulationResult ::errors:: List[str]

# annee_de_calcul = 2023
# variables = ["impot_revenu_restant_a_payer"]
# reform_base = ReformeSocioFiscale(
#     base=annee_de_calcul,
#     amendement={},
#     output_variables=variables,
#     quantile_base_variable=["decile_rfr"],
#     quantile_nb=10,
#     quantile_compare_variables=["impot_revenu_restant_a_payer"],
# )
# compute_reform(
#     reformParameters=reform_base,
#     annee_de_calcul=annee_de_calcul,
#     ignore_recalage=True,
#     baseline_tax_benefit_system=leximpact_tbs,
#     only_above_zero=False,
#     use_cache=False,
#     debug=True,
# )

Interprète la requête API

### Gestion du cache

# cache.clear_cache()
# # Entrée
# reform = ReformeSocioFiscale(base=2023, amendement={}, output_variables=["impot_revenu_restant_a_payer"])
# # Sorties

# simu_result = OneSimulationResult(state_budget={"base": 50_000_000}, quantiles=[{"fraction":1},{"fraction":2}])
# all_result= AllSimulationResult(result={"base":simu_result}, compare_before_after=None,errors=["Ca marche pas"])

# save_result_to_cache(reform, all_result)
# get_cached_result(reform)

Gestion des nom de variables


fix_variable_name_result

 fix_variable_name_result (all_simulation_result:leximpact_socio_fisca_sim
                           u_etat.schema.AllSimulationResult,
                           remove_suffix:bool=True)

fix_variable_name_input

 fix_variable_name_input
                          (reform:leximpact_socio_fisca_simu_etat.schema.R
                          eformeSocioFiscale, remove_suffix:bool=False)

fix_variable_name_dict

 fix_variable_name_dict (variables:Dict, remove_suffix:bool=False)

Renomme variable OpenFisca si en individu


fix_variable_name_list

 fix_variable_name_list (variables:List, remove_suffix:bool=False)

Renomme variable OpenFisca si en individu


fix_variable_name_string

 fix_variable_name_string (variable:str, remove_suffix:bool=False)

Renomme variable OpenFisca si en individu

compute_all_simulation


compute_all_simulation

 compute_all_simulation
                         (reform:leximpact_socio_fisca_simu_etat.schema.Re
                         formeSocioFiscale, ignore_recalage=False,
                         use_cache=True, dump_suffix:str='')

::reform:: ReformeSocioFiscale ::annee_de_calcul:: str

TESTS

# Delete all survey scenarii
survey_scenarios = {}

Prestations familiales

annee_de_calcul = 2024
variables = ["revenus_menage_par_uc", "af_menage"]
reform = ReformeSocioFiscale(
    base=annee_de_calcul,
    plf=2024,
    amendement={
        "prelevements_sociaux.contributions_sociales.csg.remplacement.pensions_retraite_invalidite.imposable.taux_plein": {
            "start": "2023-01-01",
            "type": "parameter",
            "value": 0.1,
        }
    },
    output_variables=variables,
    quantile_base_variable=["revenus_menage_par_uc"],
    quantile_nb=10,
    quantile_compare_variables=["af_menage", "revenus_menage"],
    winners_loosers_variable="af_menage",
)
result = await compute_all_simulation(reform)
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:29:30] Il faut créer un nouveau survey_scenario ☹
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:29:31] create_survey_scenario - start
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:29:31] create_survey_scenario - dump_directory exists
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:29:35] create_survey_scenario - done
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:29:35] Calcul de variable='revenus_menage_par_uc'
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:29:36] Calcul de variable='af_menage'
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_france/model/prelevements_obligatoires/prelevements_sociaux/cotisations_sociales/travail_non_salarie.py:199: RuntimeWarning: divide by zero encountered in divide
  - (0.007 * (assiette_pss > 5) * ((assiette_pss - 5) / assiette_pss))
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_france/model/prelevements_obligatoires/prelevements_sociaux/cotisations_sociales/travail_non_salarie.py:199: RuntimeWarning: invalid value encountered in multiply
  - (0.007 * (assiette_pss > 5) * ((assiette_pss - 5) / assiette_pss))
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:486: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
/home/cgl/leximpact/leximpact-socio-fiscal-simu-etat/.venv/lib/python3.10/site-packages/openfisca_survey_manager/simulations.py:472: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method.
The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy.

For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object.


  data_frame[value].fillna(missing_variable_default_value, inplace = True)
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:29:58] compute_reform - Temps de traitement pour une simulation 28.678424868000093 secondes.
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:29:58] Temps de traitement total pour la simulation 28.679307769999923 secondes. Annee TBS 2024
WARNING: no data for 2024, will took 2021
Données du scénario : 
 {'input_data_table_by_entity_by_period': {2024: {'individu': 'individu_2021', 'famille': 'famille_2021', 'foyer_fiscal': 'foyer_fiscal_2021', 'menage': 'menage_2021'}}, 'survey': 'leximpact_2021', 'config_files_directory': '/mnt/data-out/leximpact-socio-fiscal-simu-etat/integ'}
test = result.result["base"].quantiles

CSG

Sans réforme

reform = ReformeSocioFiscale(
    base=2024,
    output_variables=["csg_imposable_salaire"],
)
resultat = await compute_all_simulation(reform)


csg_imposable_salaire = resultat.result["base"].state_budget["csg_imposable_salaire"]
# assert -70 * 1e9 > csg_imposable_salaire > -80 * 1e9
print(f"{csg_imposable_salaire=:,.0}")
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:31:16] Calcul de variable='csg_imposable_salaire_foyer_fiscal'
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:31:16] compute_reform - Temps de traitement pour une simulation 0.5025315759999103 secondes.
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:31:16] Temps de traitement total pour la simulation 0.5033850670001812 secondes. Annee TBS 2024
csg_imposable_salaire=-2e+10
survey_scenarios[2024].tax_benefit_systems["amendement"]
<leximpact_socio_fisca_simu_etat.prepare_reform.CustomReform at 0x7f9b983742e0>

#### Test AsyncIO Cancel

# reform = ReformeSocioFiscale(
#     base=2023,
#     output_variables=["csg_imposable_salaire"],
# )
# task = asyncio.Task(compute_all_simulation(reform))
# await asyncio.sleep(3)
# task.cancel()
# resultat = await task

# csg_imposable_salaire = resultat.result["base"].state_budget["csg_imposable_salaire"]
# # assert -70 * 1e9 > csg_imposable_salaire > -80 * 1e9
# print(f"{csg_imposable_salaire=:,.0}")

Avec réforme et quantiles

annee_de_calcul = 2024
variables = [
    "rfr",
    "csg_deductible_retraite_foyer_fiscal",
    "csg_imposable_retraite_foyer_fiscal",
]
reform = ReformeSocioFiscale(
    base=annee_de_calcul,
    plf=2024,
    amendement={
        "prelevements_sociaux.contributions_sociales.csg.remplacement.pensions_retraite_invalidite.imposable.taux_plein": {
            "start": "2023-01-01",
            "type": "parameter",
            "value": 0.1,
        }
    },
    output_variables=variables,
    quantile_base_variable=["rfr_par_part"],
    quantile_nb=10,
    quantile_compare_variables=[
        "csg_deductible_retraite_foyer_fiscal",
        "csg_imposable_retraite_foyer_fiscal",
        "rfr",
    ],
    winners_loosers_variable="csg_retraite_foyer_fiscal",
)
result = await compute_all_simulation(reform)
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:31:53] Pas de création de survey_scenario, on le récupère dans la mémoire 👍
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:32:20] Calcul de variable='rfr'
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:32:21] Calcul de variable='csg_deductible_retraite_foyer_fiscal'
[leximpact-socio-fiscal-simu-etat DEBUG @ 20:32:21] Calcul de variable='csg_imposable_retraite_foyer_fiscal'
result.errors
result.result["base"].state_budget
result.result["plf"].state_budget
result.result["amendement"].state_budget
[]
{'rfr': 1157143184927.2537,
 'csg_deductible_retraite': -17510267271.987976,
 'csg_imposable_retraite': -7268176422.030207}
{'rfr': 1155359220747.6218,
 'csg_deductible_retraite': -17510267271.987976,
 'csg_imposable_retraite': -7268176422.030207}
{'rfr': 1155359220747.6218,
 'csg_deductible_retraite': -17510267271.987976,
 'csg_imposable_retraite': -21070718090.210606}
annee_de_calcul = 2024
variables = [
    "rfr",
    "csg_deductible_retraite_foyer_fiscal",
    "csg_imposable_retraite_foyer_fiscal",
]
reform = ReformeSocioFiscale(
    base=annee_de_calcul,
    amendement={
        "prelevements_sociaux.contributions_sociales.csg.remplacement.pensions_retraite_invalidite.imposable.taux_plein": {
            "start": "2023-01-01",
            "type": "parameter",
            "value": 0.1,
        }
    },
    output_variables=variables,
    quantile_base_variable=["rfr_par_part"],
    quantile_nb=10,
    quantile_compare_variables=[
        "csg_deductible_retraite_foyer_fiscal",
        "csg_imposable_retraite_foyer_fiscal",
        "rfr",
    ],
    winners_loosers_variable="csg_retraite_foyer_fiscal",
)
result = await compute_all_simulation(reform)
result.result["plf"].compare_before_after
result.result["amendement"].compare_before_after

tc.assertGreater(
    result.result["amendement"].compare_before_after["amendement_plf"].lower_after,
    result.result["plf"].compare_before_after["plf"].lower_after,
)
{'plf': CompareBeforeAfter(total=32417039, non_zero_before=30964374, non_zero_after=30958403, above_after=0, lower_after=683663, neutral=31733376, tolerance_factor_used=0.05, weight_factor=1.0)}
{'amendement_plf': CompareBeforeAfter(total=32417039, non_zero_before=30958403, non_zero_after=30958403, above_after=0, lower_after=0, neutral=32417039, tolerance_factor_used=0.05, weight_factor=1.0),
 'amendement_base': CompareBeforeAfter(total=32417039, non_zero_before=30964374, non_zero_after=30958403, above_after=0, lower_after=683663, neutral=31733376, tolerance_factor_used=0.05, weight_factor=1.0)}
AssertionError: 0 not greater than 683663
result.result["plf"].quantiles[5]
{'csg_deductible_retraite_max': 0.0,
 'csg_deductible_retraite_mean': -690.0,
 'csg_deductible_retraite_min': -6600.0,
 'csg_deductible_retraite_sum': -2260000000.0,
 'csg_deductible_retraite_count': 3240000.0,
 'csg_deductible_retraite_sum_abs': 2260000000.0,
 'csg_imposable_retraite_max': 0.0,
 'csg_imposable_retraite_mean': -360.0,
 'csg_imposable_retraite_min': -2600.0,
 'csg_imposable_retraite_sum': -1170000000.0,
 'csg_imposable_retraite_count': 3240000.0,
 'csg_imposable_retraite_sum_abs': 1170000000.0,
 'rfr_max': 100000.0,
 'rfr_mean': 31000.0,
 'rfr_min': 17000.0,
 'rfr_sum': 101500000000.0,
 'rfr_count': 3240000.0,
 'rfr_sum_abs': 101500000000.0,
 'rfr_par_part_max': 20000.0,
 'rfr_par_part_mean': 18000.0,
 'rfr_par_part_min': 16000.0,
 'rfr_par_part_sum': 60220000000.0,
 'rfr_par_part_count': 3240000.0,
 'rfr_par_part_sum_abs': 60220000000.0,
 'count': 3240000.0,
 'quantile_num': 6.0,
 'fraction': 0.0}

Impôt

annee_de_calcul = 2024
variables = ["rfr_par_part", "impot_revenu_restant_a_payer"]

reform = ReformeSocioFiscale(
    base=annee_de_calcul,
    plf=2024,
    amendement={
        "impot_revenu.bareme_ir_depuis_1945.bareme": {
            "scale": [
                {"rate": {"value": 0}, "threshold": {"value": 0}},
                {"rate": {"value": 0.11}, "threshold": {"value": 11294}},
                {"rate": {"value": 0.3}, "threshold": {"value": 28797}},
                {"rate": {"value": 0.41}, "threshold": {"value": 82341}},
                {"rate": {"value": 0.45}, "threshold": {"value": 177106}},
            ],
            "start": "2024-01-01",
            "type": "scale",
            "variable": "irpp_economique",
        }
    },
    output_variables=variables,
    quantile_base_variable=["rfr_par_part"],
    quantile_nb=10,
    quantile_compare_variables=["impot_revenu_restant_a_payer"],
)
result = await compute_all_simulation(reform)
[leximpact-socio-fiscal-simu-etat DEBUG @ 11:48:10] Pas de création de survey_scenario, on le récupère dans la mémoire 👍
[leximpact-socio-fiscal-simu-etat DEBUG @ 11:48:16] Calcul de variable='rfr_par_part'
[leximpact-socio-fiscal-simu-etat DEBUG @ 11:48:17] Calcul de variable='impot_revenu_restant_a_payer'
[leximpact-socio-fiscal-simu-etat DEBUG @ 11:48:23] compute_reform - Temps de traitement pour une simulation 12.605092303000106 secondes.
[leximpact-socio-fiscal-simu-etat DEBUG @ 11:48:23] Temps de traitement total pour la simulation 12.606172310000034 secondes. Annee TBS 2024
result
result.result["amendement"].compare_before_after
AllSimulationResult(result={'base': OneSimulationResult(state_budget={'rfr_par_part': 706279997369.7501, 'impot_revenu_restant_a_payer': -104809340200.57452}, quantiles=[{'impot_revenu_restant_a_payer_max': 13000.0, 'impot_revenu_restant_a_payer_mean': 100.0, 'impot_revenu_restant_a_payer_min': 0.0, 'impot_revenu_restant_a_payer_sum': 350000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 350000000.0, 'rfr_par_part_max': 3900.0, 'rfr_par_part_mean': 1000.0, 'rfr_par_part_min': 0.0, 'rfr_par_part_sum': 3400000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 3400000000.0, 'count': 3240000.0, 'quantile_num': 1.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 10000.0, 'impot_revenu_restant_a_payer_mean': 150.0, 'impot_revenu_restant_a_payer_min': -950.0, 'impot_revenu_restant_a_payer_sum': 501000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 503000000.0, 'rfr_par_part_max': 8200.0, 'rfr_par_part_mean': 6300.0, 'rfr_par_part_min': 3900.0, 'rfr_par_part_sum': 20500000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 20500000000.0, 'count': 3240000.0, 'quantile_num': 2.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 9500.0, 'impot_revenu_restant_a_payer_mean': 170.0, 'impot_revenu_restant_a_payer_min': -110.0, 'impot_revenu_restant_a_payer_sum': 569000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 569000000.0, 'rfr_par_part_max': 11000.0, 'rfr_par_part_mean': 9800.0, 'rfr_par_part_min': 8200.0, 'rfr_par_part_sum': 31850000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 31850000000.0, 'count': 3240000.0, 'quantile_num': 3.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 11000.0, 'impot_revenu_restant_a_payer_mean': 180.0, 'impot_revenu_restant_a_payer_min': -2000.0, 'impot_revenu_restant_a_payer_sum': 614000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 748000000.0, 'rfr_par_part_max': 14000.0, 'rfr_par_part_mean': 12000.0, 'rfr_par_part_min': 11000.0, 'rfr_par_part_sum': 41390000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 41390000000.0, 'count': 3240000.0, 'quantile_num': 4.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 9000.0, 'impot_revenu_restant_a_payer_mean': -160.0, 'impot_revenu_restant_a_payer_min': -4400.0, 'impot_revenu_restant_a_payer_sum': -522000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 1640000000.0, 'rfr_par_part_max': 17000.0, 'rfr_par_part_mean': 15000.0, 'rfr_par_part_min': 14000.0, 'rfr_par_part_sum': 50900000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 50900000000.0, 'count': 3240000.0, 'quantile_num': 5.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 9800.0, 'impot_revenu_restant_a_payer_mean': -880.0, 'impot_revenu_restant_a_payer_min': -10000.0, 'impot_revenu_restant_a_payer_sum': -2860000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 3630000000.0, 'rfr_par_part_max': 20000.0, 'rfr_par_part_mean': 18000.0, 'rfr_par_part_min': 17000.0, 'rfr_par_part_sum': 60310000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 60310000000.0, 'count': 3240000.0, 'quantile_num': 6.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 10000.0, 'impot_revenu_restant_a_payer_mean': -1700.0, 'impot_revenu_restant_a_payer_min': -15000.0, 'impot_revenu_restant_a_payer_sum': -5720000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 6370000000.0, 'rfr_par_part_max': 23000.0, 'rfr_par_part_mean': 21000.0, 'rfr_par_part_min': 20000.0, 'rfr_par_part_sum': 71120000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 71120000000.0, 'count': 3240000.0, 'quantile_num': 7.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 9200.0, 'impot_revenu_restant_a_payer_mean': -3300.0, 'impot_revenu_restant_a_payer_min': -28000.0, 'impot_revenu_restant_a_payer_sum': -10700000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 11220000000.0, 'rfr_par_part_max': 29000.0, 'rfr_par_part_mean': 26000.0, 'rfr_par_part_min': 23000.0, 'rfr_par_part_sum': 86220000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 86220000000.0, 'count': 3240000.0, 'quantile_num': 8.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 12000.0, 'impot_revenu_restant_a_payer_mean': -6400.0, 'impot_revenu_restant_a_payer_min': -47000.0, 'impot_revenu_restant_a_payer_sum': -20860000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 21220000000.0, 'rfr_par_part_max': 40000.0, 'rfr_par_part_mean': 34000.0, 'rfr_par_part_min': 29000.0, 'rfr_par_part_sum': 111400000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 111400000000.0, 'count': 3240000.0, 'quantile_num': 9.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 150000.0, 'impot_revenu_restant_a_payer_mean': -20000.0, 'impot_revenu_restant_a_payer_min': -1370000.0, 'impot_revenu_restant_a_payer_sum': -66150000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 67460000000.0, 'rfr_par_part_max': 3680000.0, 'rfr_par_part_mean': 70000.0, 'rfr_par_part_min': 40000.0, 'rfr_par_part_sum': 229000000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 229000000000.0, 'count': 3240000.0, 'quantile_num': 10.0, 'fraction': 1.0, 'rfr_max': 1000000000000000.0}], compare_before_after={'base': CompareBeforeAfter(total=32417039, non_zero_before=20655079, non_zero_after=20655079, above_after=0, lower_after=0, neutral=32417039, tolerance_factor_used=0.05, weight_factor=1.0)}), 'plf': OneSimulationResult(state_budget={'rfr_par_part': 705043993433.5272, 'impot_revenu_restant_a_payer': -88021274501.8159}, quantiles=[{'impot_revenu_restant_a_payer_max': 12000.0, 'impot_revenu_restant_a_payer_mean': 97.0, 'impot_revenu_restant_a_payer_min': 0.0, 'impot_revenu_restant_a_payer_sum': 314000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 314000000.0, 'rfr_par_part_max': 3900.0, 'rfr_par_part_mean': 1000.0, 'rfr_par_part_min': 0.0, 'rfr_par_part_sum': 3350000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 3350000000.0, 'count': 3240000.0, 'quantile_num': 1.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 9300.0, 'impot_revenu_restant_a_payer_mean': 130.0, 'impot_revenu_restant_a_payer_min': -850.0, 'impot_revenu_restant_a_payer_sum': 450000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 451000000.0, 'rfr_par_part_max': 8200.0, 'rfr_par_part_mean': 6200.0, 'rfr_par_part_min': 3800.0, 'rfr_par_part_sum': 20340000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 20340000000.0, 'count': 3240000.0, 'quantile_num': 2.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 8600.0, 'impot_revenu_restant_a_payer_mean': 150.0, 'impot_revenu_restant_a_payer_min': -100.0, 'impot_revenu_restant_a_payer_sum': 510000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 511000000.0, 'rfr_par_part_max': 11000.0, 'rfr_par_part_mean': 9700.0, 'rfr_par_part_min': 7500.0, 'rfr_par_part_sum': 31670000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 31670000000.0, 'count': 3240000.0, 'quantile_num': 3.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 10000.0, 'impot_revenu_restant_a_payer_mean': 180.0, 'impot_revenu_restant_a_payer_min': -1300.0, 'impot_revenu_restant_a_payer_sum': 601000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 635000000.0, 'rfr_par_part_max': 14000.0, 'rfr_par_part_mean': 12000.0, 'rfr_par_part_min': 11000.0, 'rfr_par_part_sum': 41230000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 41230000000.0, 'count': 3240000.0, 'quantile_num': 4.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 8300.0, 'impot_revenu_restant_a_payer_mean': -13.0, 'impot_revenu_restant_a_payer_min': -3200.0, 'impot_revenu_restant_a_payer_sum': -44900000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 1120000000.0, 'rfr_par_part_max': 17000.0, 'rfr_par_part_mean': 15000.0, 'rfr_par_part_min': 13000.0, 'rfr_par_part_sum': 50680000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 50680000000.0, 'count': 3240000.0, 'quantile_num': 5.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 8800.0, 'impot_revenu_restant_a_payer_mean': -590.0, 'impot_revenu_restant_a_payer_min': -8100.0, 'impot_revenu_restant_a_payer_sum': -1940000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 2720000000.0, 'rfr_par_part_max': 20000.0, 'rfr_par_part_mean': 18000.0, 'rfr_par_part_min': 16000.0, 'rfr_par_part_sum': 60220000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 60220000000.0, 'count': 3240000.0, 'quantile_num': 6.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 9200.0, 'impot_revenu_restant_a_payer_mean': -1300.0, 'impot_revenu_restant_a_payer_min': -12000.0, 'impot_revenu_restant_a_payer_sum': -4440000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 5090000000.0, 'rfr_par_part_max': 23000.0, 'rfr_par_part_mean': 21000.0, 'rfr_par_part_min': 20000.0, 'rfr_par_part_sum': 71060000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 71060000000.0, 'count': 3240000.0, 'quantile_num': 7.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 8300.0, 'impot_revenu_restant_a_payer_mean': -2600.0, 'impot_revenu_restant_a_payer_min': -23000.0, 'impot_revenu_restant_a_payer_sum': -8620000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 9130000000.0, 'rfr_par_part_max': 29000.0, 'rfr_par_part_mean': 26000.0, 'rfr_par_part_min': 23000.0, 'rfr_par_part_sum': 86050000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 86050000000.0, 'count': 3240000.0, 'quantile_num': 8.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 11000.0, 'impot_revenu_restant_a_payer_mean': -5300.0, 'impot_revenu_restant_a_payer_min': -40000.0, 'impot_revenu_restant_a_payer_sum': -17280000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 17640000000.0, 'rfr_par_part_max': 40000.0, 'rfr_par_part_mean': 34000.0, 'rfr_par_part_min': 29000.0, 'rfr_par_part_sum': 111400000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 111400000000.0, 'count': 3240000.0, 'quantile_num': 9.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 140000.0, 'impot_revenu_restant_a_payer_mean': -17000.0, 'impot_revenu_restant_a_payer_min': -1230000.0, 'impot_revenu_restant_a_payer_sum': -57550000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 58770000000.0, 'rfr_par_part_max': 3680000.0, 'rfr_par_part_mean': 70000.0, 'rfr_par_part_min': 40000.0, 'rfr_par_part_sum': 228900000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 228900000000.0, 'count': 3240000.0, 'quantile_num': 10.0, 'fraction': 1.0, 'rfr_max': 1000000000000000.0}], compare_before_after={'plf': CompareBeforeAfter(total=32417039, non_zero_before=20655079, non_zero_after=19944667, above_after=17488305, lower_after=2948051, neutral=11980682, tolerance_factor_used=0.05, weight_factor=1.0)}), 'amendement': OneSimulationResult(state_budget={'rfr_par_part': 705043993433.5272, 'impot_revenu_restant_a_payer': -94099999988.76035}, quantiles=[{'impot_revenu_restant_a_payer_max': 12000.0, 'impot_revenu_restant_a_payer_mean': 100.0, 'impot_revenu_restant_a_payer_min': 0.0, 'impot_revenu_restant_a_payer_sum': 336000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 336000000.0, 'rfr_par_part_max': 3900.0, 'rfr_par_part_mean': 1000.0, 'rfr_par_part_min': 0.0, 'rfr_par_part_sum': 3350000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 3350000000.0, 'count': 3240000.0, 'quantile_num': 1.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 10000.0, 'impot_revenu_restant_a_payer_mean': 140.0, 'impot_revenu_restant_a_payer_min': -910.0, 'impot_revenu_restant_a_payer_sum': 481000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 482000000.0, 'rfr_par_part_max': 8200.0, 'rfr_par_part_mean': 6200.0, 'rfr_par_part_min': 3800.0, 'rfr_par_part_sum': 20340000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 20340000000.0, 'count': 3240000.0, 'quantile_num': 2.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 9200.0, 'impot_revenu_restant_a_payer_mean': 160.0, 'impot_revenu_restant_a_payer_min': -100.0, 'impot_revenu_restant_a_payer_sum': 546000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 546000000.0, 'rfr_par_part_max': 11000.0, 'rfr_par_part_mean': 9700.0, 'rfr_par_part_min': 7500.0, 'rfr_par_part_sum': 31670000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 31670000000.0, 'count': 3240000.0, 'quantile_num': 3.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 11000.0, 'impot_revenu_restant_a_payer_mean': 190.0, 'impot_revenu_restant_a_payer_min': -1400.0, 'impot_revenu_restant_a_payer_sum': 643000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 679000000.0, 'rfr_par_part_max': 14000.0, 'rfr_par_part_mean': 12000.0, 'rfr_par_part_min': 11000.0, 'rfr_par_part_sum': 41230000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 41230000000.0, 'count': 3240000.0, 'quantile_num': 4.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 8900.0, 'impot_revenu_restant_a_payer_mean': -14.0, 'impot_revenu_restant_a_payer_min': -3400.0, 'impot_revenu_restant_a_payer_sum': -48000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 1200000000.0, 'rfr_par_part_max': 17000.0, 'rfr_par_part_mean': 15000.0, 'rfr_par_part_min': 13000.0, 'rfr_par_part_sum': 50680000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 50680000000.0, 'count': 3240000.0, 'quantile_num': 5.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 9400.0, 'impot_revenu_restant_a_payer_mean': -640.0, 'impot_revenu_restant_a_payer_min': -8700.0, 'impot_revenu_restant_a_payer_sum': -2070000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 2910000000.0, 'rfr_par_part_max': 20000.0, 'rfr_par_part_mean': 18000.0, 'rfr_par_part_min': 16000.0, 'rfr_par_part_sum': 60220000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 60220000000.0, 'count': 3240000.0, 'quantile_num': 6.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 9900.0, 'impot_revenu_restant_a_payer_mean': -1400.0, 'impot_revenu_restant_a_payer_min': -13000.0, 'impot_revenu_restant_a_payer_sum': -4740000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 5440000000.0, 'rfr_par_part_max': 23000.0, 'rfr_par_part_mean': 21000.0, 'rfr_par_part_min': 20000.0, 'rfr_par_part_sum': 71060000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 71060000000.0, 'count': 3240000.0, 'quantile_num': 7.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 8900.0, 'impot_revenu_restant_a_payer_mean': -2800.0, 'impot_revenu_restant_a_payer_min': -24000.0, 'impot_revenu_restant_a_payer_sum': -9210000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 9760000000.0, 'rfr_par_part_max': 29000.0, 'rfr_par_part_mean': 26000.0, 'rfr_par_part_min': 23000.0, 'rfr_par_part_sum': 86050000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 86050000000.0, 'count': 3240000.0, 'quantile_num': 8.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 12000.0, 'impot_revenu_restant_a_payer_mean': -5700.0, 'impot_revenu_restant_a_payer_min': -43000.0, 'impot_revenu_restant_a_payer_sum': -18470000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 18860000000.0, 'rfr_par_part_max': 40000.0, 'rfr_par_part_mean': 34000.0, 'rfr_par_part_min': 29000.0, 'rfr_par_part_sum': 111400000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 111400000000.0, 'count': 3240000.0, 'quantile_num': 9.0, 'fraction': 0.0}, {'impot_revenu_restant_a_payer_max': 150000.0, 'impot_revenu_restant_a_payer_mean': -18000.0, 'impot_revenu_restant_a_payer_min': -1310000.0, 'impot_revenu_restant_a_payer_sum': -61530000000.0, 'impot_revenu_restant_a_payer_count': 3240000.0, 'impot_revenu_restant_a_payer_sum_abs': 62830000000.0, 'rfr_par_part_max': 3680000.0, 'rfr_par_part_mean': 70000.0, 'rfr_par_part_min': 40000.0, 'rfr_par_part_sum': 228900000000.0, 'rfr_par_part_count': 3240000.0, 'rfr_par_part_sum_abs': 228900000000.0, 'count': 3240000.0, 'quantile_num': 10.0, 'fraction': 1.0, 'rfr_max': 1000000000000000.0}], compare_before_after={'amendement_plf': CompareBeforeAfter(total=32417039, non_zero_before=19944667, non_zero_after=19944667, above_after=3947847, lower_after=15996820, neutral=12472371, tolerance_factor_used=0.05, weight_factor=1.0), 'amendement_base': CompareBeforeAfter(total=32417039, non_zero_before=20655079, non_zero_after=19944667, above_after=17565983, lower_after=0, neutral=14851056, tolerance_factor_used=0.05, weight_factor=1.0)})}, errors=[])
{'amendement_plf': CompareBeforeAfter(total=32417039, non_zero_before=19944667, non_zero_after=19944667, above_after=3947847, lower_after=15996820, neutral=12472371, tolerance_factor_used=0.05, weight_factor=1.0),
 'amendement_base': CompareBeforeAfter(total=32417039, non_zero_before=20655079, non_zero_after=19944667, above_after=17565983, lower_after=0, neutral=14851056, tolerance_factor_used=0.05, weight_factor=1.0)}
result.result["base"].state_budget
result.result["amendement"].state_budget
result.result["plf"].quantiles[5]
{'rfr_par_part': 706279997369.7501,
 'impot_revenu_restant_a_payer': -104809340200.57452}
{'rfr_par_part': 705043993433.5272,
 'impot_revenu_restant_a_payer': -94099999988.76035}
{'impot_revenu_restant_a_payer_max': 8800.0,
 'impot_revenu_restant_a_payer_mean': -590.0,
 'impot_revenu_restant_a_payer_min': -8100.0,
 'impot_revenu_restant_a_payer_sum': -1940000000.0,
 'impot_revenu_restant_a_payer_count': 3240000.0,
 'impot_revenu_restant_a_payer_sum_abs': 2720000000.0,
 'rfr_par_part_max': 20000.0,
 'rfr_par_part_mean': 18000.0,
 'rfr_par_part_min': 16000.0,
 'rfr_par_part_sum': 60220000000.0,
 'rfr_par_part_count': 3240000.0,
 'rfr_par_part_sum_abs': 60220000000.0,
 'count': 3240000.0,
 'quantile_num': 6.0,
 'fraction': 0.0}
result.result["base"].compare_before_after
result.result["plf"].compare_before_after
result.result["amendement"].compare_before_after

tc.assertGreater(
    result.result["plf"].compare_before_after["plf"].above_after,
    result.result["amendement"].compare_before_after["amendement_plf"].above_after,
)
{'base': CompareBeforeAfter(total=32417039, non_zero_before=20655079, non_zero_after=20655079, above_after=0, lower_after=0, neutral=32417039, tolerance_factor_used=0.05, weight_factor=1.0)}
{'plf': CompareBeforeAfter(total=32417039, non_zero_before=20655079, non_zero_after=19944667, above_after=17488305, lower_after=2948051, neutral=11980682, tolerance_factor_used=0.05, weight_factor=1.0)}
{'amendement_plf': CompareBeforeAfter(total=32417039, non_zero_before=19944667, non_zero_after=19944667, above_after=3947847, lower_after=15996820, neutral=12472371, tolerance_factor_used=0.05, weight_factor=1.0),
 'amendement_base': CompareBeforeAfter(total=32417039, non_zero_before=20655079, non_zero_after=19944667, above_after=17565983, lower_after=0, neutral=14851056, tolerance_factor_used=0.05, weight_factor=1.0)}

Debug

Tests fix variable name

# Tests fix variable name
tc.assertEqual(
    fix_variable_name_string("csg_imposable_salaire"),
    "csg_imposable_salaire_foyer_fiscal",
)
tc.assertEqual(
    fix_variable_name_string("csg_imposable_salaire_foyer_fiscal", remove_suffix=True),
    "csg_imposable_salaire",
)
tc.assertEqual(
    fix_variable_name_list(["csg_imposable_salaire"]),
    ["csg_imposable_salaire_foyer_fiscal"],
)
tc.assertEqual(
    next(
        iter(
            fix_variable_name_dict(
                {"csg_imposable_salaire_foyer_fiscal": -15739672162.12939},
                remove_suffix=True,
            )
        )
    ),
    "csg_imposable_salaire",
)

reform = ReformeSocioFiscale(
    base=2023,
    output_variables=["csg_imposable_salaire_foyer_fiscal"],
)
reform_out = fix_variable_name_input(reform)
tc.assertEqual(reform_out.output_variables, ["csg_imposable_salaire_foyer_fiscal"])
all_simulation_result = AllSimulationResult(
    result={
        "base": OneSimulationResult(
            state_budget={"csg_imposable_salaire": -15739672162.12939},
            quantiles=None,
            compare_before_after=None,
        )
    },
    errors=[],
)
tc.assertEqual(
    next(
        iter(
            fix_variable_name_result(all_simulation_result, remove_suffix=True)
            .result["base"]
            .state_budget
        )
    ),
    "csg_imposable_salaire",
)

quantile = [
    {
        "csg_deductible_salaire_foyer_fiscal_max": 0.0,
        "csg_deductible_salaire_foyer_fiscal_mean": -66.58313135453727,
        "csg_imposable_salaire_foyer_fiscal_sum": -78481215.12131548,
        "count": 333963,
        "fraction": 0.1,
    },
]
fix_variable_name_list(quantile, remove_suffix=True)
[{'csg_deductible_salaire_max': 0.0,
  'csg_deductible_salaire_mean': -66.58313135453727,
  'csg_imposable_salaire_sum': -78481215.12131548,
  'count': 333963,
  'fraction': 0.1}]

L’écart de calcul vient probablement des arrondis en fonction des float16 ou float32.

Le TBS de OF-France-data contient déjà une variable decile_rfr Cette variable a une formule qui va calculer pour chaque ménage dans quel décile il se trouve.

class decile_rfr(Variable):
    value_type = int
    entity = FoyerFiscal
    label = "Décile de rfr"
    definition_period = YEAR

    def formula(foyer, period):
        rfr = foyer('rfr', period)
        labels = np.arange(1, 11)
        #weights = 1.0 * np.ones(shape = len(rfr))
        weights = foyer("weight_foyer", period)
        decile, _ = mark_weighted_percentiles(
            rfr,  # + np.random.uniform(size = len(salaire)) - 0.5,
            labels,
            weights,
            method = 2,
            return_quantiles = True,
            )
        return decile 

Cf France-data décile de revenu des ménages ordinaires, voir mark_weighted_percentile

L’erreur AssertionError: Some variables used as input variables are not part of the tax benefit system: {'quifoy', 'idfam', 'wprm', 'weight_foyers', 'idfoy', 'weight_familles', 'idmen', 'weight_menages', 'weight_individus', 'quimen', 'idmen_original', 'noindiv', 'quifam'} n’est pas normale car dans LeximpactErfsSurveyScenario on commence par appeler self._set_used_as_input_variables() dont le but est justement de supprimer ces variables !

=> Elle a été réglé par la mise en commentaire de certaines lignes dans _set_used_as_input_variables de LeximpactErfsSurveyScenario mais cela posait d’autres problèmes par la suite, il fallait finalement utiliser le TBS de France-Data et pas celui d’OpenFisca.

### Comment aller plus vite

Utiliser dump_simulation (écrit sur le disque l’état de la simulation) et restore_simulation (relit depuis le dump)