OpenFisca-France 169.16.0__py3-none-any.whl → 169.16.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-169.16.0.dist-info → OpenFisca_France-169.16.1.dist-info}/METADATA +1 -1
- {OpenFisca_France-169.16.0.dist-info → OpenFisca_France-169.16.1.dist-info}/RECORD +6 -6
- openfisca_france/model/prestations/bail_reel_solidaire.py +60 -61
- {OpenFisca_France-169.16.0.dist-info → OpenFisca_France-169.16.1.dist-info}/LICENSE.AGPL.txt +0 -0
- {OpenFisca_France-169.16.0.dist-info → OpenFisca_France-169.16.1.dist-info}/WHEEL +0 -0
- {OpenFisca_France-169.16.0.dist-info → OpenFisca_France-169.16.1.dist-info}/top_level.txt +0 -0
|
@@ -83,7 +83,7 @@ openfisca_france/model/prestations/aide_permis_pro_btp.py,sha256=bzh9cDpJetqn72S
|
|
|
83
83
|
openfisca_france/model/prestations/aides_logement.py,sha256=YuZ3NE531fbBoom2zYZ_2oke8lPCztWP22mbVlcgkDw,90710
|
|
84
84
|
openfisca_france/model/prestations/alimentation.py,sha256=3gkbQrPdobAHmroJiG07ajxzWjLlyMhMh6kMvg4s4Hk,2350
|
|
85
85
|
openfisca_france/model/prestations/autonomie.py,sha256=7UpuhDO-LFjwbq3UWSDyOKJCsTw1rx8O-tS3dG-MBn8,19394
|
|
86
|
-
openfisca_france/model/prestations/bail_reel_solidaire.py,sha256=
|
|
86
|
+
openfisca_france/model/prestations/bail_reel_solidaire.py,sha256=uEDGxseBXC70v-otwXHOCTVUj7ZqIlc1za7rv8EE5Hg,3166
|
|
87
87
|
openfisca_france/model/prestations/cheque_energie.py,sha256=YsmPzfUhs4P7CW5ePrOkBG-2iqeMeuFmfDyR0zKMeLg,6037
|
|
88
88
|
openfisca_france/model/prestations/complement_are.py,sha256=A3w76QuTfglsUmErWLpRbrFHqPECnZT3uDE1KgJWcTc,16530
|
|
89
89
|
openfisca_france/model/prestations/depart1825.py,sha256=2TJYxttcBJbSqpqs-3Wh6yB1-zARnnR396kkgQx_Quw,2528
|
|
@@ -4043,8 +4043,8 @@ openfisca_france/scripts/performance/measure_spiral_performances.py,sha256=cQIxE
|
|
|
4043
4043
|
openfisca_france/scripts/performance/measure_tests_performance.py,sha256=HYgSJy-OMZay2AZt6ztntgdUbW_RL2xMr-iHcK-zoVY,1869
|
|
4044
4044
|
openfisca_france/situation_examples/__init__.py,sha256=BTRmrqk9lsjfhtPXsYcsWqXFEYyFpgLcxNs6oJsy8zk,262
|
|
4045
4045
|
openfisca_france/situation_examples/couple.json,sha256=Ot1x4wl3IS-2-10X3V7ZUokkOMXi96s-xK7A0gNvRF4,862
|
|
4046
|
-
OpenFisca_France-169.16.
|
|
4047
|
-
OpenFisca_France-169.16.
|
|
4048
|
-
OpenFisca_France-169.16.
|
|
4049
|
-
OpenFisca_France-169.16.
|
|
4050
|
-
OpenFisca_France-169.16.
|
|
4046
|
+
OpenFisca_France-169.16.1.dist-info/LICENSE.AGPL.txt,sha256=2N5ReRelkdqkR9a-KP-y-shmcD5P62XoYiG-miLTAzo,34519
|
|
4047
|
+
OpenFisca_France-169.16.1.dist-info/METADATA,sha256=54Zy9lAGUpsrF-ejZcFiV9nfn1i7tSdnKidUzOt--oQ,20831
|
|
4048
|
+
OpenFisca_France-169.16.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
4049
|
+
OpenFisca_France-169.16.1.dist-info/top_level.txt,sha256=1LbD6QJWehKGIcjtaJ45tbQOSDiFEXOlIdgWRI_jaHU,17
|
|
4050
|
+
OpenFisca_France-169.16.1.dist-info/RECORD,,
|
|
@@ -1,81 +1,80 @@
|
|
|
1
1
|
from openfisca_france.model.base import *
|
|
2
|
-
import
|
|
2
|
+
import openfisca_france
|
|
3
3
|
import csv
|
|
4
|
+
import codecs
|
|
5
|
+
import pkg_resources
|
|
4
6
|
import numpy as np
|
|
5
7
|
|
|
6
8
|
|
|
7
|
-
def
|
|
8
|
-
|
|
9
|
+
def bail_reel_solidaire_zones_elligibles():
|
|
10
|
+
with pkg_resources.resource_stream(openfisca_france.__name__, 'assets/zonage-communes/zonage-abc-juillet-2024.csv') as csv_file:
|
|
11
|
+
utf8_reader = codecs.getreader('utf-8')
|
|
12
|
+
csv_reader = csv.DictReader(utf8_reader(csv_file), delimiter=';')
|
|
13
|
+
return {
|
|
14
|
+
row['CODGEO']: row['Zone en vigueur depuis le 5 juillet 2024']
|
|
15
|
+
for row in csv_reader
|
|
16
|
+
}
|
|
9
17
|
|
|
10
|
-
if not os.path.exists(chemin_fichier_zonage_abc):
|
|
11
|
-
return None
|
|
12
|
-
|
|
13
|
-
with open(chemin_fichier_zonage_abc, 'r', encoding='utf-8') as csvfile:
|
|
14
|
-
csv_reader = csv.DictReader(csvfile, delimiter=';')
|
|
15
|
-
return {row['CODGEO']: row['Zone en vigueur depuis le 5 juillet 2024'] for row in csv_reader}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def plafond_par_zone_et_composition(nb_personnes, plafonds_par_zones, zone):
|
|
19
|
-
plafond_zone = plafonds_par_zones[f'zone_{zone}']
|
|
20
|
-
|
|
21
|
-
tranches_composition = range(1, 7)
|
|
22
|
-
conditions_nb_personnes = [
|
|
23
|
-
nb_personnes == i if i < 6 else nb_personnes >= i
|
|
24
|
-
for i in tranches_composition
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
plafonds_revenus = [
|
|
28
|
-
plafond_zone[f'nb_personnes_{i}']
|
|
29
|
-
for i in tranches_composition
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
return select(conditions_nb_personnes, plafonds_revenus)
|
|
33
18
|
|
|
19
|
+
class bail_reel_solidaire_zones_menage(Variable):
|
|
20
|
+
value_type = str
|
|
21
|
+
label = 'Zone du ménage pour le Bail Réel Solidaire'
|
|
22
|
+
entity = Menage
|
|
23
|
+
definition_period = MONTH
|
|
34
24
|
|
|
35
|
-
def
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
def formula(menage, period):
|
|
26
|
+
depcom = menage('depcom', period)
|
|
27
|
+
return np.fromiter(
|
|
28
|
+
(bail_reel_solidaire_zones_elligibles().get(depcom_cell.decode('utf-8')) for depcom_cell in depcom),
|
|
29
|
+
dtype='<U4' # String length max for zones (A, Abis, B1, B2, C)
|
|
30
|
+
)
|
|
41
31
|
|
|
42
32
|
|
|
43
|
-
class
|
|
33
|
+
class bail_reel_solidaire_plafond_total(Variable):
|
|
34
|
+
value_type = float
|
|
35
|
+
label = 'Plafond de ressources total du Bail Réel Solidaire'
|
|
44
36
|
entity = Menage
|
|
45
|
-
value_type = bool
|
|
46
|
-
reference = [
|
|
47
|
-
'https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000032918488',
|
|
48
|
-
'https://www.legifrance.gouv.fr/loda/id/JORFTEXT000000437021'
|
|
49
|
-
]
|
|
50
|
-
label = 'Bail réel solidaire'
|
|
51
37
|
definition_period = MONTH
|
|
52
38
|
|
|
53
39
|
def formula(menage, period, parameters):
|
|
54
|
-
|
|
55
|
-
zones_abc_eligibles =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
zones_par_depcom = load_zonage_file(period, parameters)
|
|
59
|
-
if not zones_par_depcom:
|
|
60
|
-
return False
|
|
61
|
-
|
|
40
|
+
params = parameters(period).prestations_sociales.bail_reel_solidaire
|
|
41
|
+
zones_abc_eligibles = params.parametres_generaux.zones_abc_eligibles
|
|
42
|
+
plafonds_par_zones = params.plafonds_par_zones
|
|
43
|
+
zones_menage = menage('bail_reel_solidaire_zones_menage', period)
|
|
62
44
|
nb_personnes = menage.nb_persons()
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
45
|
+
nb_personnes_max = params.parametres_generaux.nombre_personnes_maximum
|
|
46
|
+
|
|
47
|
+
def calcul_plafonds_zone(zone):
|
|
48
|
+
plafond_zone = plafonds_par_zones[f'zone_{zone}']
|
|
49
|
+
plafond_base = select(
|
|
50
|
+
[nb_personnes == i if i < 6 else nb_personnes >= i for i in range(1, 7)],
|
|
51
|
+
[plafond_zone[f'nb_personnes_{i}'] for i in range(1, 7)]
|
|
52
|
+
)
|
|
53
|
+
plafond_supp = where(
|
|
54
|
+
nb_personnes > nb_personnes_max,
|
|
55
|
+
(nb_personnes - nb_personnes_max) * plafond_zone.nb_personnes_supplementaires,
|
|
56
|
+
0
|
|
57
|
+
)
|
|
58
|
+
return plafond_base + plafond_supp
|
|
59
|
+
|
|
60
|
+
return select(
|
|
69
61
|
[zones_menage == zone for zone in zones_abc_eligibles],
|
|
70
|
-
[
|
|
62
|
+
[calcul_plafonds_zone(zone) for zone in zones_abc_eligibles]
|
|
71
63
|
)
|
|
72
64
|
|
|
73
|
-
plafond_revenu_supplementaire = select(
|
|
74
|
-
[zones_menage == zone for zone in zones_abc_eligibles],
|
|
75
|
-
[plafond_supplementaire_par_zone(nb_personnes, plafonds_par_zones, zone, nb_personnes_max) for zone in zones_abc_eligibles]
|
|
76
|
-
)
|
|
77
65
|
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
class bail_reel_solidaire(Variable):
|
|
67
|
+
value_type = bool
|
|
68
|
+
label = 'Éligibilité au Bail Réel Solidaire'
|
|
69
|
+
entity = Menage
|
|
70
|
+
definition_period = MONTH
|
|
71
|
+
reference = [
|
|
72
|
+
'https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000032918488',
|
|
73
|
+
'https://www.legifrance.gouv.fr/loda/id/JORFTEXT000000437021'
|
|
74
|
+
]
|
|
80
75
|
|
|
81
|
-
|
|
76
|
+
def formula(menage, period):
|
|
77
|
+
plafond_total = menage('bail_reel_solidaire_plafond_total', period)
|
|
78
|
+
zones_menage = menage('bail_reel_solidaire_zones_menage', period)
|
|
79
|
+
rfr = menage.sum(menage.members.foyer_fiscal('rfr', period.n_2), role=FoyerFiscal.DECLARANT_PRINCIPAL)
|
|
80
|
+
return where(zones_menage is not None, rfr <= plafond_total, False)
|
{OpenFisca_France-169.16.0.dist-info → OpenFisca_France-169.16.1.dist-info}/LICENSE.AGPL.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|