-
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: modélisation de la mutuelle communale de montpellier
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
openfisca_france_local/communes/montpellier/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,10 @@ | ||
from openfisca_france.model.base import Menage, MONTH, Variable | ||
|
||
class montpellier_eligibilite_residence(Variable): | ||
value_type = bool | ||
entity = Menage | ||
definition_period = MONTH | ||
label = "Éligibilité résidentielle d'un ménage aux dipositifs de Montpellier" | ||
|
||
def formula(menage, period): | ||
return menage('depcom', period) == b'34172' |
15 changes: 15 additions & 0 deletions
15
openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.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,15 @@ | ||
from openfisca_france.model.base import Variable, MONTH, not_, Famille | ||
|
||
class montpellier_mutuelle_communale(Variable): | ||
value_type = bool | ||
entity = Famille | ||
definition_period = MONTH | ||
label = "Mutuelle communale de la ville de Montpellier" | ||
reference = [ | ||
"https://www.montpellier.fr/4884-mutuelle-communale.htm" | ||
] | ||
|
||
def formula(famille, period): | ||
eligibilite_residentielle = famille.demandeur.menage('montpellier_eligibilite_residence', period) | ||
eligibilite_css = famille('css_cmu_acs_eligibilite', period) | ||
return eligibilite_residentielle & not_(eligibilite_css) |
7 changes: 7 additions & 0 deletions
7
tests/communes/montpellier/montpellier_mutuelle_communale.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,7 @@ | ||
- name: "Égibilité à la mutuelle communale de Montpellier" | ||
period: 2024-10 | ||
input: | ||
depcom: ["34172", "34172", "68400", "68400"] | ||
css_cmu_acs_eligibilite: [False, True, True, False] | ||
output: | ||
montpellier_mutuelle_communale: [True, False, False, False] |