Skip to content

Commit

Permalink
Merge pull request #215 from openfisca/4613-nouvelle-aide-meurthe-et-…
Browse files Browse the repository at this point in the history
…moselle-pass-jeunes-54

Modélisation "Pass Jeune 54" - département Meurthe-et-Moselle
  • Loading branch information
Shamzic authored Sep 25, 2024
2 parents e88b396 + b3ab5d8 commit facab9f
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [6.13.0] - 2024-09-24

_Pour les changements détaillés et les discussions associées, référencez la pull request [#215](https://github.com/openfisca/openfisca-france-local/pull/215)_

### Added

- Ajoute la variable `pass_jeune_54` (aide du département `meurthe_et_moselle`)

## [6.12.4] - 2024-07-30

_Pour les changements détaillés et les discussions associées, référencez la pull request [#213](https://github.com/openfisca/openfisca-france-local/pull/213)_
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from openfisca_france.model.base import Variable, Menage, MONTH
from numpy.core.defchararray import startswith


class meurthe_et_moselle_eligibilite_residence(Variable):
value_type = bool
entity = Menage
definition_period = MONTH
label = "Éligibilité résidentielle d'un ménage aux dipositifs de Meurthe-et-Moselle"

def formula(menage, period):
return startswith(menage('depcom', period), b'54')
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from openfisca_france.model.base import Variable, Individu, MONTH


class eligibilite_age_pass_jeune_54(Variable):
value_type = float
entity = Individu
definition_period = MONTH
label = "Éligibilité d'âge pour le Pass Jeune 54 du département Meurthe-et-Moselle"

def formula(individu, period, parameters):
age = individu('age', period)
age_minimum = parameters(period).departements.meurthe_et_moselle.pass_jeune_54.age.minimum_inclusif
age_maximum = parameters(period).departements.meurthe_et_moselle.pass_jeune_54.age.maximum_inclusif
return (age_minimum <= age) * (age <= age_maximum)

class quotient_familial_pass_jeune_54(Variable):
value_type = float
entity = Individu
definition_period = MONTH
label = "Quotient familial pour le Pass Jeune 54 du département Meurthe-et-Moselle"

def formula(individu, period):
rfr = individu.foyer_fiscal('rfr', period.n_2)
nbptr = individu.foyer_fiscal('nbptr', period.n_2)
return rfr / nbptr / 12

class pass_jeune_54(Variable):
value_type = float
entity = Individu
definition_period = MONTH
label = "Montant pour le Pass Jeune 54 du département Meurthe-et-Moselle"
reference = [
"https://meurthe-et-moselle.fr/actions/education-populaire-jeunesse-sports/sport/pass-jeunes-54"
]

def formula(individu, period, parameters):

params = parameters(period).departements.meurthe_et_moselle.pass_jeune_54

eligibilite_residentielle = individu.menage('meurthe_et_moselle_eligibilite_residence', period)
eligibilite_age = individu('eligibilite_age_pass_jeune_54', period)
quotient_familial = individu('quotient_familial_pass_jeune_54', period)

montant = params.montant_en_fonction_du_quotient_familial.calc(quotient_familial)

return montant * eligibilite_residentielle * eligibilite_age
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
age:
minimum_inclusif:
reference:
- https://meurthe-et-moselle.fr/actions/education-populaire-jeunesse-sports/sport/pass-jeunes-54
description: Éligibilité d'âge minimum pour l'aide Pass Jeunes 54 dans le département de la Meurthe-et-Moselle.
values:
2024-01-01:
value: 6
maximum_inclusif:
reference:
- https://meurthe-et-moselle.fr/actions/education-populaire-jeunesse-sports/sport/pass-jeunes-54
description: Éligibilité d'âge maximum pour l'aide Pass Jeunes 54 dans le département de la Meurthe-et-Moselle.
values:
2024-01-01:
value: 16

montant_en_fonction_du_quotient_familial:
reference:
- https://meurthe-et-moselle.fr/actions/education-populaire-jeunesse-sports/sport/pass-jeunes-54
description: Montant obtenu pour l'aide Pass Jeunes 54 en région Auvergne-Rhône-Alpes.
metadata:
type: single_amount
brackets:
- threshold:
2024-01-01:
value: 0
amount:
2024-01-01:
value: 100
- threshold:
2024-01-01:
value: 451
amount:
2024-01-01:
value: 70
- threshold:
2024-01-01:
value: 551
amount:
2024-01-01:
value: 50
- threshold:
2024-01-01:
value: 651
amount:
2024-01-01:
value: 0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='OpenFisca-France-Local',
version='6.12.4',
version='6.13.0',
author='OpenFisca Team',
author_email='[email protected]',
classifiers=[
Expand Down
23 changes: 23 additions & 0 deletions tests/departements/meurthe_et_moselle/pass_jeune_54.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- period: 2024-01
name: "Éligibilité d'âge et de résidence"
input:
age: [5, 6, 8, 16, 17]
depcom: [54000, 54000, 68400, 54000, 54000]
rfr:
2022: [80, 80, 80, 80, 80]
nbptr:
2022: [1, 1, 1, 1, 1]
output:
pass_jeune_54: [0, 100, 0, 100, 0]

- period: 2024-01
name: Montant en fonction du quotient familial
input:
age: [14, 14, 14, 14]
depcom: [54000, 54000, 54000, 54000]
rfr:
2022: [7850, 13300, 5600, 5200]
nbptr:
2022: [1, 2, 1, 1]
output:
pass_jeune_54: [0, 50, 70, 100]

0 comments on commit facab9f

Please sign in to comment.