-
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.
Merge pull request #216 from openfisca/4636-ajouter-la-mutuelle-commu…
…nale-de-montpellier Modélisation de la mutuelle communale de la ville de Montpellier
- Loading branch information
Showing
5 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
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
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' |
17 changes: 17 additions & 0 deletions
17
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,17 @@ | ||
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) | ||
css_participation_forfaitaire = famille('css_participation_forfaitaire', period) | ||
cmu_c = famille('cmu_c', period) | ||
eligibilite_css_cmu_c = (css_participation_forfaitaire > 0) | cmu_c | ||
return eligibilite_residentielle * not_(eligibilite_css_cmu_c) |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
setup( | ||
name='OpenFisca-France-Local', | ||
version='6.13.0', | ||
version='6.14.0', | ||
author='OpenFisca Team', | ||
author_email='[email protected]', | ||
classifiers=[ | ||
|
8 changes: 8 additions & 0 deletions
8
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,8 @@ | ||
- name: "Égibilité à la mutuelle communale de Montpellier" | ||
period: 2024-10 | ||
input: | ||
depcom: ["34172","34172", "34172", "68400", "68400"] | ||
css_participation_forfaitaire_montant: [0, 0, 20, 25, 30] | ||
cmu_c: [False, True, False, False, False] | ||
output: | ||
montpellier_mutuelle_communale: [True, False, False, False, False] |