From 442ba973df9163e3d4416b4f54c651013389b095 Mon Sep 17 00:00:00 2001 From: Shamzic Date: Tue, 1 Oct 2024 18:05:26 +0200 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20mod=C3=A9lisation=20de=20la=20mutue?= =?UTF-8?q?lle=20communale=20de=20montpellier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communes/montpellier/eligibilite.py | 10 ++++++++++ .../montpellier/montpellier_mutuelle_communale.py | 15 +++++++++++++++ .../montpellier_mutuelle_communale.yml | 7 +++++++ 3 files changed, 32 insertions(+) create mode 100644 openfisca_france_local/communes/montpellier/eligibilite.py create mode 100644 openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py create mode 100644 tests/communes/montpellier/montpellier_mutuelle_communale.yml diff --git a/openfisca_france_local/communes/montpellier/eligibilite.py b/openfisca_france_local/communes/montpellier/eligibilite.py new file mode 100644 index 00000000..a28e4568 --- /dev/null +++ b/openfisca_france_local/communes/montpellier/eligibilite.py @@ -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' diff --git a/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py b/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py new file mode 100644 index 00000000..d097a278 --- /dev/null +++ b/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py @@ -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) diff --git a/tests/communes/montpellier/montpellier_mutuelle_communale.yml b/tests/communes/montpellier/montpellier_mutuelle_communale.yml new file mode 100644 index 00000000..dcd2d4d8 --- /dev/null +++ b/tests/communes/montpellier/montpellier_mutuelle_communale.yml @@ -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] From 86670aa46daac315334565c9f74eeac1d52de3ce Mon Sep 17 00:00:00 2001 From: Shamzic Date: Wed, 2 Oct 2024 17:22:53 +0200 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20m=C3=A0j=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 8 ++++++++ setup.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4350d2..8c7c5cf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [6.14.0] - 2024-10-02 + +_Pour les changements détaillés et les discussions associées, référencez la pull request [#216](https://github.com/openfisca/openfisca-france-local/pull/216)_ + +### Added + +- Ajoute la variable `montpellier_mutuelle_communale` + ## [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)_ diff --git a/setup.py b/setup.py index ae8e9e12..bf0f64e3 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='OpenFisca-France-Local', - version='6.13.0', + version='6.14.0', author='OpenFisca Team', author_email='contact@openfisca.fr', classifiers=[ From a7770dd72f48a5f50f1575245e65bbddbb7a4894 Mon Sep 17 00:00:00 2001 From: Shamzic Date: Wed, 2 Oct 2024 18:04:12 +0200 Subject: [PATCH 3/4] fix: mutuelle communale montpellier --- .../communes/montpellier/montpellier_mutuelle_communale.py | 3 ++- tests/communes/montpellier/montpellier_mutuelle_communale.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py b/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py index d097a278..a14facb4 100644 --- a/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py +++ b/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py @@ -11,5 +11,6 @@ class montpellier_mutuelle_communale(Variable): def formula(famille, period): eligibilite_residentielle = famille.demandeur.menage('montpellier_eligibilite_residence', period) - eligibilite_css = famille('css_cmu_acs_eligibilite', period) + css_participation_forfaitaire = famille('css_participation_forfaitaire_montant', period) + eligibilite_css = css_participation_forfaitaire > 0 return eligibilite_residentielle & not_(eligibilite_css) diff --git a/tests/communes/montpellier/montpellier_mutuelle_communale.yml b/tests/communes/montpellier/montpellier_mutuelle_communale.yml index dcd2d4d8..fe8034f8 100644 --- a/tests/communes/montpellier/montpellier_mutuelle_communale.yml +++ b/tests/communes/montpellier/montpellier_mutuelle_communale.yml @@ -2,6 +2,6 @@ period: 2024-10 input: depcom: ["34172", "34172", "68400", "68400"] - css_cmu_acs_eligibilite: [False, True, True, False] + css_participation_forfaitaire_montant: [0, 20, 25, 30] output: montpellier_mutuelle_communale: [True, False, False, False] From f68d71e62c5a1e88db552bb9ab28a779544d15d4 Mon Sep 17 00:00:00 2001 From: Shamzic Date: Thu, 3 Oct 2024 11:27:25 +0200 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20mod=C3=A9lisation=20montpellier=5Fmu?= =?UTF-8?q?tuelle=5Fcommunale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communes/montpellier/montpellier_mutuelle_communale.py | 7 ++++--- .../montpellier/montpellier_mutuelle_communale.yml | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py b/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py index a14facb4..09037bf9 100644 --- a/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py +++ b/openfisca_france_local/communes/montpellier/montpellier_mutuelle_communale.py @@ -11,6 +11,7 @@ class montpellier_mutuelle_communale(Variable): def formula(famille, period): eligibilite_residentielle = famille.demandeur.menage('montpellier_eligibilite_residence', period) - css_participation_forfaitaire = famille('css_participation_forfaitaire_montant', period) - eligibilite_css = css_participation_forfaitaire > 0 - return eligibilite_residentielle & not_(eligibilite_css) + 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) diff --git a/tests/communes/montpellier/montpellier_mutuelle_communale.yml b/tests/communes/montpellier/montpellier_mutuelle_communale.yml index fe8034f8..cffa2e55 100644 --- a/tests/communes/montpellier/montpellier_mutuelle_communale.yml +++ b/tests/communes/montpellier/montpellier_mutuelle_communale.yml @@ -1,7 +1,8 @@ - name: "Égibilité à la mutuelle communale de Montpellier" period: 2024-10 input: - depcom: ["34172", "34172", "68400", "68400"] - css_participation_forfaitaire_montant: [0, 20, 25, 30] + 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] + montpellier_mutuelle_communale: [True, False, False, False, False]