-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ajout de l'aide au permis des yvelines
- Loading branch information
1 parent
06be123
commit 83491e9
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
openfisca_france_local/departements/yvelines/aide_permis.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from openfisca_france.model.base import Variable, Individu, MONTH | ||
|
||
|
||
class yvelines_aide_permis(Variable): | ||
value_type = float | ||
entity = Individu | ||
definition_period = MONTH | ||
label = "Montant de l'aide au permis de conduire pour le département des Yvelines" | ||
reference = 'https://www.78-92.fr/annuaire/aides-et-services/detail/laide-au-financement-du-permis-de-conduire' | ||
|
||
def formula(individu, period, parameters): | ||
params = parameters(period).departements.yvelines.aide_permis | ||
|
||
individus_age = individu('age', period) | ||
|
||
age_maximum = params.age.maximum_inclusif | ||
age_minimum = params.age.minimum_inclusif | ||
eligibilites_age = (individus_age >= age_minimum) * (individus_age <= age_maximum) | ||
|
||
eligibilite_residentielle = individu.menage('yvelines_eligibilite_residence', period) | ||
|
||
rbg = individu.foyer_fiscal('rbg', period.last_year) | ||
nb_pac = individu.foyer_fiscal('nb_pac', period.last_year) | ||
|
||
eligibilite_revenu = ( | ||
(rbg - params.revenu_global_brut.deduction_fixe) / nb_pac | ||
) <= params.revenu_global_brut.marginal_par_personne | ||
|
||
montant = params.montant | ||
|
||
return eligibilites_age * eligibilite_residentielle * eligibilite_revenu * montant |
13 changes: 13 additions & 0 deletions
13
openfisca_france_local/departements/yvelines/eligibilite.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from openfisca_france.model.base import Variable, Menage, MONTH | ||
|
||
from numpy.core.defchararray import startswith | ||
|
||
|
||
class yvelines_eligibilite_residence(Variable): | ||
value_type = bool | ||
entity = Menage | ||
definition_period = MONTH | ||
label = "Éligibilité résidentielle d'un ménage aux dipositifs dans les Yvelines" | ||
|
||
def formula(menage, period): | ||
return startswith(menage('depcom', period), str.encode('78')) |
24 changes: 24 additions & 0 deletions
24
openfisca_france_local/parameters/departements/yvelines/aide_permis.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
age: | ||
maximum_inclusif: | ||
values: | ||
2010-01-01: | ||
value: 25 | ||
minimum_inclusif: | ||
values: | ||
2010-01-01: | ||
value: 18 | ||
|
||
revenu_global_brut: | ||
deduction_fixe: | ||
values: | ||
2010-01-01: | ||
value: 6400 | ||
marginal_par_personne: | ||
values: | ||
2010-01-01: | ||
value: 3200 | ||
|
||
montant: | ||
values: | ||
2010-01-01: | ||
value: 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
- period: 2023-02 | ||
name: Éligibilité d'age et de résidence | ||
input: | ||
age: [17, 18, 25, 32, 22] | ||
depcom: ['78000', '78000', '78000', '78000', '13000'] | ||
rbg: | ||
2022: ['9000','9000','9000','9000', '9000'] | ||
nb_pac: | ||
2022: ['1', '1','1','1', '1'] | ||
output: | ||
yvelines_aide_permis: [0, 500, 500, 0, 0] | ||
|
||
- period: 2023-02 | ||
name: Montant en fonction du quotient familial | ||
input: | ||
age: [18, 18, 18, 18, 18, 18] | ||
depcom: ['78000','78000','78000','78000','78000', '78000'] | ||
rbg: | ||
2022: ['9600', '12800', '16000', '19200', '22400', '12800'] | ||
nb_pac: | ||
2022: ['1', '2', '3', '4', '3', '1'] | ||
output: | ||
yvelines_aide_permis: [500, 500, 500, 500, 0, 0] |