OpenFisca-France 174.0.0__py3-none-any.whl → 174.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of OpenFisca-France might be problematic. Click here for more details.
- openfisca_france/model/prelevements_obligatoires/taxe_habitation/taxe_habitation_import_baremes_locaux.py +4 -4
- openfisca_france/model/prestations/aides_logement.py +10 -8
- openfisca_france/model/prestations/bail_reel_solidaire.py +11 -4
- openfisca_france/scripts/performance/measure_tests_performance.py +3 -3
- {openfisca_france-174.0.0.dist-info → openfisca_france-174.0.1.dist-info}/METADATA +1 -2
- {openfisca_france-174.0.0.dist-info → openfisca_france-174.0.1.dist-info}/RECORD +9 -9
- {openfisca_france-174.0.0.dist-info → openfisca_france-174.0.1.dist-info}/WHEEL +0 -0
- {openfisca_france-174.0.0.dist-info → openfisca_france-174.0.1.dist-info}/licenses/LICENSE.AGPL.txt +0 -0
- {openfisca_france-174.0.0.dist-info → openfisca_france-174.0.1.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import csv
|
|
3
3
|
import codecs
|
|
4
|
-
import
|
|
4
|
+
import importlib
|
|
5
5
|
import openfisca_france
|
|
6
6
|
from numpy import fromiter
|
|
7
7
|
from openfisca_france.model.base import *
|
|
@@ -14,10 +14,10 @@ def preload_parametres_locaux_taxe_habitation(year = None, variable_to_load = No
|
|
|
14
14
|
assert variable_to_load is not None
|
|
15
15
|
assert year is not None
|
|
16
16
|
if os.path.isfile('{}/assets/taxe_habitation/parametres_th_{}.csv'.format(openfisca_france.__name__, year)):
|
|
17
|
-
with
|
|
18
|
-
openfisca_france.__name__
|
|
17
|
+
with importlib.resources.files(
|
|
18
|
+
openfisca_france.__name__).joinpath(
|
|
19
19
|
'assets/taxe_habitation/parametres_th_{}.csv'.format(year),
|
|
20
|
-
) as csv_file:
|
|
20
|
+
).open('rb') as csv_file:
|
|
21
21
|
utf8_reader = codecs.getreader('utf-8')
|
|
22
22
|
csv_reader = csv.DictReader(utf8_reader(csv_file))
|
|
23
23
|
return {
|
|
@@ -2,7 +2,7 @@ import csv
|
|
|
2
2
|
import codecs
|
|
3
3
|
import json
|
|
4
4
|
import logging
|
|
5
|
-
import
|
|
5
|
+
import importlib
|
|
6
6
|
import sys
|
|
7
7
|
|
|
8
8
|
from numpy import ceil, datetime64, fromiter, int16, logical_or as or_, logical_and as and_, logical_not as not_
|
|
@@ -1469,10 +1469,11 @@ zone_apl_by_depcom = None
|
|
|
1469
1469
|
def preload_zone_apl():
|
|
1470
1470
|
global zone_apl_by_depcom
|
|
1471
1471
|
if zone_apl_by_depcom is None:
|
|
1472
|
-
with
|
|
1473
|
-
openfisca_france.__name__
|
|
1474
|
-
|
|
1475
|
-
|
|
1472
|
+
with importlib.resources.files(
|
|
1473
|
+
openfisca_france.__name__
|
|
1474
|
+
).joinpath(
|
|
1475
|
+
'assets/apl/20110914_zonage.csv'
|
|
1476
|
+
).open('rb') as csv_file:
|
|
1476
1477
|
if sys.version_info < (3, 0):
|
|
1477
1478
|
csv_reader = csv.DictReader(csv_file)
|
|
1478
1479
|
else:
|
|
@@ -1484,10 +1485,11 @@ def preload_zone_apl():
|
|
|
1484
1485
|
for row in csv_reader
|
|
1485
1486
|
}
|
|
1486
1487
|
# Add subcommunes (arrondissements and communes associées), use the same value as their parent commune.
|
|
1487
|
-
with
|
|
1488
|
-
openfisca_france.__name__
|
|
1488
|
+
with importlib.resources.files(
|
|
1489
|
+
openfisca_france.__name__
|
|
1490
|
+
).joinpath(
|
|
1489
1491
|
'assets/apl/commune_depcom_by_subcommune_depcom.json',
|
|
1490
|
-
) as json_file:
|
|
1492
|
+
).open('rb') as json_file:
|
|
1491
1493
|
commune_depcom_by_subcommune_depcom = json.load(json_file)
|
|
1492
1494
|
for subcommune_depcom, commune_depcom in commune_depcom_by_subcommune_depcom.items():
|
|
1493
1495
|
zone_apl_by_depcom[subcommune_depcom] = zone_apl_by_depcom[commune_depcom]
|
|
@@ -2,12 +2,17 @@ from openfisca_france.model.base import *
|
|
|
2
2
|
import openfisca_france
|
|
3
3
|
import csv
|
|
4
4
|
import codecs
|
|
5
|
-
import
|
|
5
|
+
import importlib
|
|
6
6
|
import numpy as np
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def bail_reel_solidaire_zones_elligibles():
|
|
10
|
-
with
|
|
10
|
+
with importlib.resources.files(
|
|
11
|
+
openfisca_france.__name__).joinpath(
|
|
12
|
+
'assets/zonage-communes/zonage-abc-juillet-2024.csv'
|
|
13
|
+
).open(
|
|
14
|
+
'rb'
|
|
15
|
+
) as csv_file:
|
|
11
16
|
utf8_reader = codecs.getreader('utf-8')
|
|
12
17
|
csv_reader = csv.DictReader(utf8_reader(csv_file), delimiter=';')
|
|
13
18
|
return {
|
|
@@ -25,7 +30,8 @@ class bail_reel_solidaire_zones_menage(Variable):
|
|
|
25
30
|
def formula(menage, period):
|
|
26
31
|
depcom = menage('depcom', period)
|
|
27
32
|
return np.fromiter(
|
|
28
|
-
(bail_reel_solidaire_zones_elligibles().get(
|
|
33
|
+
(bail_reel_solidaire_zones_elligibles().get(
|
|
34
|
+
depcom_cell.decode('utf-8')) for depcom_cell in depcom),
|
|
29
35
|
dtype='<U4' # String length max for zones (A, Abis, B1, B2, C)
|
|
30
36
|
)
|
|
31
37
|
|
|
@@ -76,5 +82,6 @@ class bail_reel_solidaire(Variable):
|
|
|
76
82
|
def formula(menage, period):
|
|
77
83
|
plafond_total = menage('bail_reel_solidaire_plafond_total', period)
|
|
78
84
|
zones_menage = menage('bail_reel_solidaire_zones_menage', period)
|
|
79
|
-
rfr = menage.sum(menage.members.foyer_fiscal(
|
|
85
|
+
rfr = menage.sum(menage.members.foyer_fiscal(
|
|
86
|
+
'rfr', period.n_2), role=FoyerFiscal.DECLARANT_PRINCIPAL)
|
|
80
87
|
return where(zones_menage is not None, rfr <= plafond_total, False)
|
|
@@ -10,7 +10,7 @@ Usage example:
|
|
|
10
10
|
import os
|
|
11
11
|
import time
|
|
12
12
|
import logging
|
|
13
|
-
import
|
|
13
|
+
import importlib
|
|
14
14
|
|
|
15
15
|
from openfisca_core.tools.test_runner import run_tests
|
|
16
16
|
from openfisca_france import CountryTaxBenefitSystem
|
|
@@ -30,8 +30,8 @@ tbs = CountryTaxBenefitSystem()
|
|
|
30
30
|
time_spent_tbs = time.time() - start_time_tbs
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
yaml_tests_dir =
|
|
33
|
+
folder = os.path.join('tests', 'mes-aides.gouv.fr')
|
|
34
|
+
yaml_tests_dir = importlib.resources.path('OpenFisca-France', folder)
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
# Time openfisca-run-test runner
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: OpenFisca-France
|
|
3
|
-
Version: 174.0.
|
|
3
|
+
Version: 174.0.1
|
|
4
4
|
Summary: OpenFisca Rules as Code model for France.
|
|
5
5
|
Author-email: OpenFisca Team <contact@openfisca.fr>
|
|
6
6
|
Project-URL: Homepage, https://github.com/openfisca/openfisca-france
|
|
@@ -22,7 +22,6 @@ Description-Content-Type: text/markdown
|
|
|
22
22
|
License-File: LICENSE.AGPL.txt
|
|
23
23
|
Requires-Dist: numpy<2,>=1.24.3
|
|
24
24
|
Requires-Dist: openfisca-core[web-api]<44,>=43
|
|
25
|
-
Requires-Dist: setuptools
|
|
26
25
|
Provides-Extra: inversion-revenus
|
|
27
26
|
Requires-Dist: scipy<2.0,>=1.10.1; extra == "inversion-revenus"
|
|
28
27
|
Provides-Extra: de-net-a-brut
|
|
@@ -74,17 +74,17 @@ openfisca_france/model/prelevements_obligatoires/prelevements_sociaux/cotisation
|
|
|
74
74
|
openfisca_france/model/prelevements_obligatoires/prelevements_sociaux/cotisations_sociales/travail_totaux.py,sha256=vHJWfH0s0BYqbup9pcZisAI3cKGXlmBTdLYzWJOxgNA,9967
|
|
75
75
|
openfisca_france/model/prelevements_obligatoires/taxe_habitation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
76
|
openfisca_france/model/prelevements_obligatoires/taxe_habitation/taxe_habitation.py,sha256=-VDWVv6weZqQhPov1SA35Xl8w09AHV9ZXYPBdKimk_U,29326
|
|
77
|
-
openfisca_france/model/prelevements_obligatoires/taxe_habitation/taxe_habitation_import_baremes_locaux.py,sha256=
|
|
77
|
+
openfisca_france/model/prelevements_obligatoires/taxe_habitation/taxe_habitation_import_baremes_locaux.py,sha256=OQRsRpfqP4djuwybokV9IEayDbDkn8GbFdhgTwRC7Xs,14915
|
|
78
78
|
openfisca_france/model/prestations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
79
|
openfisca_france/model/prestations/agepi.py,sha256=QRjafsxsObAjW2A31mzrOmXnzmKx0OWvlko7qpeRyj0,15841
|
|
80
80
|
openfisca_france/model/prestations/aide_alimentation_etudiants_eloignes.py,sha256=iO35OV8iDexv0yiQCbOpQ4sIZvfkRSAP5xuztGt-qa4,1779
|
|
81
81
|
openfisca_france/model/prestations/aide_mobilite.py,sha256=SqzPIkkEZAgKoEbc73d3bhsYhFxZaN1o2Ik4gTm7VWY,20560
|
|
82
82
|
openfisca_france/model/prestations/aide_permis_demandeur_emploi.py,sha256=7V8gVzI9Rgg60lxqddrrIqhjqe06J2GfMQoSXKrdY7I,3410
|
|
83
83
|
openfisca_france/model/prestations/aide_permis_pro_btp.py,sha256=bzh9cDpJetqn72S2ziQJlhZuJrtOw-tYSDBOYKIML48,2258
|
|
84
|
-
openfisca_france/model/prestations/aides_logement.py,sha256=
|
|
84
|
+
openfisca_france/model/prestations/aides_logement.py,sha256=YnvMnZD3ffC2nZWwLK0LCWKEHIdJ7s8pzUHldEr3Do4,92253
|
|
85
85
|
openfisca_france/model/prestations/alimentation.py,sha256=3gkbQrPdobAHmroJiG07ajxzWjLlyMhMh6kMvg4s4Hk,2350
|
|
86
86
|
openfisca_france/model/prestations/autonomie.py,sha256=7UpuhDO-LFjwbq3UWSDyOKJCsTw1rx8O-tS3dG-MBn8,19394
|
|
87
|
-
openfisca_france/model/prestations/bail_reel_solidaire.py,sha256=
|
|
87
|
+
openfisca_france/model/prestations/bail_reel_solidaire.py,sha256=7nSL3HhQdZ5VgPx_La3vCY4rMnhWqowxmaae1tVD3f4,3261
|
|
88
88
|
openfisca_france/model/prestations/cheque_energie.py,sha256=YsmPzfUhs4P7CW5ePrOkBG-2iqeMeuFmfDyR0zKMeLg,6037
|
|
89
89
|
openfisca_france/model/prestations/complement_are.py,sha256=A3w76QuTfglsUmErWLpRbrFHqPECnZT3uDE1KgJWcTc,16530
|
|
90
90
|
openfisca_france/model/prestations/depart1825.py,sha256=2TJYxttcBJbSqpqs-3Wh6yB1-zARnnR396kkgQx_Quw,2528
|
|
@@ -4120,11 +4120,11 @@ openfisca_france/scripts/performance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
|
|
|
4120
4120
|
openfisca_france/scripts/performance/measure_calculations_performance.py,sha256=SpD9strcHfajTabcIpr1XKtBJw71W4kNnFumeP8Xdw4,13721
|
|
4121
4121
|
openfisca_france/scripts/performance/measure_circleci_builds_diff.py,sha256=BFXbuQmIWL3Y9dtoVosYKX2rzrrLfVoelKXkBdOjCeY,4322
|
|
4122
4122
|
openfisca_france/scripts/performance/measure_spiral_performances.py,sha256=cQIxERPJJrihov-9245DFeC6p9MfNPJVYj8-86qcE-k,3232
|
|
4123
|
-
openfisca_france/scripts/performance/measure_tests_performance.py,sha256=
|
|
4123
|
+
openfisca_france/scripts/performance/measure_tests_performance.py,sha256=MKrNJont9a0KEgZMy-QSiOx6hC5HUPDi377UV71_rS8,1822
|
|
4124
4124
|
openfisca_france/situation_examples/__init__.py,sha256=BTRmrqk9lsjfhtPXsYcsWqXFEYyFpgLcxNs6oJsy8zk,262
|
|
4125
4125
|
openfisca_france/situation_examples/couple.json,sha256=Ot1x4wl3IS-2-10X3V7ZUokkOMXi96s-xK7A0gNvRF4,862
|
|
4126
|
-
openfisca_france-174.0.
|
|
4127
|
-
openfisca_france-174.0.
|
|
4128
|
-
openfisca_france-174.0.
|
|
4129
|
-
openfisca_france-174.0.
|
|
4130
|
-
openfisca_france-174.0.
|
|
4126
|
+
openfisca_france-174.0.1.dist-info/licenses/LICENSE.AGPL.txt,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
|
|
4127
|
+
openfisca_france-174.0.1.dist-info/METADATA,sha256=X1yTCro4Bjkjsv0uCXADC-r1zoRYj-Ersl16AFgGmc0,18374
|
|
4128
|
+
openfisca_france-174.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
4129
|
+
openfisca_france-174.0.1.dist-info/top_level.txt,sha256=1LbD6QJWehKGIcjtaJ45tbQOSDiFEXOlIdgWRI_jaHU,17
|
|
4130
|
+
openfisca_france-174.0.1.dist-info/RECORD,,
|
|
File without changes
|
{openfisca_france-174.0.0.dist-info → openfisca_france-174.0.1.dist-info}/licenses/LICENSE.AGPL.txt
RENAMED
|
File without changes
|
|
File without changes
|