Skip to content

Commit

Permalink
Merge pull request #242 from openfisca/maj_dependances
Browse files Browse the repository at this point in the history
Maj dependances
  • Loading branch information
clallemand authored Nov 10, 2023
2 parents 502c9c7 + 2c21826 commit d5ba4ab
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 3.0.1 [#242](https://github.com/openfisca/openfisca-france-data/pull/242)
* Technical changes:
- Passage à Openfsca-France >= 155.0.0

### 3.0.0 [#241](https://github.com/openfisca/openfisca-france-data/pull/241)
- Breaking changes

Expand Down
2 changes: 1 addition & 1 deletion openfisca_france_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def apply(self):
'csg',
'crds',
'impot_revenu',
'irpp',
'impot_revenu_restant_a_payer',
'prelevement_forfaitaire_unique_ir',
'prelevement_forfaitaire_liberatoire',
'taxe_habitation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"source": "Comptes de la sécurité sociale, résultats 2019 et prévision 2020 (https://www.securite-sociale.fr/files/live/sites/SSFR/files/medias/CCSS/2020/RAPPORT%20CCSS%20JUIN%202020.pdf)"
},
{
"variable":"irpp",
"variable":"impot_revenu_restant_a_payer",
"actual_beneficiaries":39332000,
"actual_amount":76911000000,
"source": "Statistiques DGFIP, Impôt sur le revenu : répartition par région (https://www.impots.gouv.fr/statistiques-impots-des-particuliers)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"source": "Comptes de la sécurité sociale, résultats 2020, prévisions 2021 et 2022 (https://www.securite-sociale.fr/files/live/sites/SSFR/files/medias/CCSS/2021/Rapport%20CCSS-Septembre2021.pdf)"
},
{
"variable":"irpp",
"variable":"impot_revenu_restant_a_payer",
"actual_beneficiaries":39888000,
"actual_amount":73979000000,
"source": "Statistiques DGFIP, Impôt sur le revenu : répartition par région (https://www.impots.gouv.fr/statistiques-impots-des-particuliers)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"source":"Comptes de la sécurité sociale, résultats 2022 et prévisions 2023 (https://www.securite-sociale.fr/files/live/sites/SSFR/files/medias/DSS/2023/CCSS-Mai2023.pdf)"
},
{
"variable":"irpp",
"variable":"impot_revenu_restant_a_payer",
"actual_beneficiaries":40257000,
"actual_amount":80826000000,
"source": "Statistiques DGFIP, Impôt sur le revenu : répartition par région (https://www.impots.gouv.fr/statistiques-impots-des-particuliers)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"source":"Comptes de la sécurité sociale, résultats 2022 et prévisions 2023 (https://www.securite-sociale.fr/files/live/sites/SSFR/files/medias/DSS/2023/CCSS-Mai2023.pdf)"
},
{
"variable":"irpp",
"variable":"impot_revenu_restant_a_payer",
"actual_beneficiaries": 0,
"actual_amount": 0,
"source": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"source":"Comptes de la sécurité sociale, résultats 2022 et prévisions 2023 (https://www.securite-sociale.fr/files/live/sites/SSFR/files/medias/DSS/2023/CCSS-Mai2023.pdf)"
},
{
"variable":"irpp",
"variable":"impot_revenu_restant_a_payer",
"actual_beneficiaries": 0,
"actual_amount": 0,
"source": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"source": ""
},
{
"variable":"irpp",
"variable":"impot_revenu_restant_a_payer",
"actual_beneficiaries": 0,
"actual_amount": 0,
"source": ""
Expand Down
2 changes: 1 addition & 1 deletion openfisca_france_data/assets/aggregats/ines/ines_2019.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"actual_amount":17000000000
},
{
"variable":"irpp",
"variable":"impot_revenu_restant_a_payer",
"actual_beneficiaries":0,
"actual_amount":69400000000,
"notes":"Impot payé en 2019, en parti sur revenus 2019 et 2018"
Expand Down
2 changes: 1 addition & 1 deletion openfisca_france_data/assets/aggregats/ines/ines_2020.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"actual_amount":19000000000
},
{
"variable":"irpp",
"variable":"impot_revenu_restant_a_payer",
"actual_beneficiaries":0,
"actual_amount":73900000000,
"notes":"Impot payé en 2020, en parti sur revenus 2020 et 2019"
Expand Down
2 changes: 1 addition & 1 deletion openfisca_france_data/erfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def get_of2erf(year=None):
of2erf["csg"] = "csgim" # imposable, et "csgdm", déductible
#of2erf["csgd"] = "csgdm"
of2erf["crds"] = "crdsm"
of2erf["irpp"] = "zimpom"
of2erf["impot_revenu_restant_a_payer"] = "zimpom"
of2erf["ppe"] = "m_ppem"
of2erf["af"] = "m_afm"
#af_base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def formula(foyer_fiscal, period, parameters):
return foyer_fiscal.sum(cesthra_i)


class irpp(Variable):
class impot_revenu_restant_a_payer(Variable):
label = 'Impôt sur le revenu des personnes physiques (réformée pour intégrer la cesthra)'
definition_period = YEAR

Expand Down Expand Up @@ -62,5 +62,5 @@ class cesthra_invalidee(Reform):

def apply(self):
self.add_variable(cesthra)
self.update_variable(irpp)
self.update_variable(impot_revenu_restant_a_payer)
self.modify_parameters(modifier_function = modify_parameters)
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name = "OpenFisca-France-Data",
version = "3.0.0",
version = "3.0.1",
description = "OpenFisca-France-Data module to work with French survey data",
long_description = long_description,
long_description_content_type="text/markdown",
Expand Down Expand Up @@ -42,7 +42,7 @@
python_requires = ">=3.9",
install_requires = [
"multipledispatch >=0.6.0, <1.0.0",
"OpenFisca-France >=150.0.0, <155.0.0",
"OpenFisca-France >=155.0.0, <156.0.0",
"openFisca-survey-manager >=2.0.0, <2.1.0",
],
extras_require = {
Expand Down
6 changes: 3 additions & 3 deletions tests/erfs_fpr/integration/test_impot_revenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

data_frame_by_entity = survey_scenario.create_data_frame_by_entity(
variables = [
'irpp',
'impot_revenu_restant_a_payer',
'maries_ou_pacses',
'nbptr',
'rfr',
Expand All @@ -31,8 +31,8 @@

assert 25e6 < (foyer_fiscal.weight_foyers).sum()

print(foyer_fiscal.groupby('nbptr').apply(lambda x: (x.irpp.astype('float') * x.weight_foyers.astype('float')).sum()))
print((foyer_fiscal.irpp.astype('float') * foyer_fiscal.weight_foyers.astype('float')).sum() / 1e9)
print(foyer_fiscal.groupby('nbptr').apply(lambda x: (x.impot_revenu_restant_a_payer.astype('float') * x.weight_foyers.astype('float')).sum()))
print((foyer_fiscal.impot_revenu_restant_a_payer.astype('float') * foyer_fiscal.weight_foyers.astype('float')).sum() / 1e9)

# survey_scenario.summarize_variable('salaire_imposable')
# salaire_imposable: 1 periods * 127126 cells * item size 4 (float32, default = 0) = 496.6K
Expand Down
8 changes: 4 additions & 4 deletions tests/erfs_fpr/integration/test_pivot_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_pivot_table_1d_mean():
survey_scenario = get_survey_scenario(kind = 'erfs_fpr', year = year)
pivot_table = survey_scenario.compute_pivot_table(
columns = ['decile_rfr'],
values = ['irpp'],
values = ['impot_revenu_restant_a_payer'],
period = year,
)
return pivot_table
Expand All @@ -22,7 +22,7 @@ def test_pivot_table_1d_sum():
pivot_table = survey_scenario.compute_pivot_table(
aggfunc = 'sum',
columns = ['decile_rfr'],
values = ['irpp'],
values = ['impot_revenu_restant_a_payer'],
period = year,
)
return pivot_table
Expand All @@ -34,7 +34,7 @@ def test_pivot_table_1d_count():
pivot_table = survey_scenario.compute_pivot_table(
aggfunc = 'count',
columns = ['decile_rfr'],
values = ['irpp'],
values = ['impot_revenu_restant_a_payer'],
period = year,
)
return pivot_table
Expand All @@ -46,7 +46,7 @@ def test_pivot_table_2d_2values():
pivot_table = survey_scenario.compute_pivot_table(
columns = ['decile_rfr'],
index = ['nbptr'],
values = ['irpp', 'rfr'],
values = ['impot_revenu_restant_a_payer', 'rfr'],
period = year,
)
return pivot_table
Expand Down
4 changes: 2 additions & 2 deletions tests/test_fake_survey_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ def test_calculate_irpp_before_and_after_plf2015(

# IRPP avant la réforme
assert_near(
survey_scenario.calculate_variable("irpp", use_baseline = True, period = year),
survey_scenario.calculate_variable("impot_revenu_restant_a_payer", use_baseline = True, period = year),
[-10124, -869],
error_margin,
)

# IRPP après la réforme
# -911.4 + (1135 - 911.4) = -686.8
assert_near(
survey_scenario.calculate_variable("irpp", period = year),
survey_scenario.calculate_variable("impot_revenu_restant_a_payer", period = year),
[-10118, -911.4 + (1135 - 911.4)],
error_margin,
)

0 comments on commit d5ba4ab

Please sign in to comment.