From 374bb7de9891f07cdea3844f2fed91cdd40563ad Mon Sep 17 00:00:00 2001 From: Simon Hamery Date: Tue, 5 Nov 2024 12:07:55 +0100 Subject: [PATCH] =?UTF-8?q?Mod=C3=A9lisation=20de=20la=20tarification=20so?= =?UTF-8?q?lidaire=20du=20p=C3=A9riscolaire=20(Ville=20de=20Strasbourg)=20?= =?UTF-8?q?(#219)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modèlisation des tarifs périscolaire de strasbourg Ajout de la grille tarifaire de l'acceuil matin/soir pour les écoles maternelle de strasbourg. * chore: màj setup & changelog & refacto nom de variable openfisca * chore: complète la couverture pour les tests de la tarification solidaire du périscolaire pour ll'accueil du soir en maternelle sur l'année 2024 * Update openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py Co-authored-by: Jérémy PASTOURET * refactor: terme "accueil" periscolaire - Strasbourg --------- Co-authored-by: antoine-de Co-authored-by: Jérémy PASTOURET --- CHANGELOG.md | 8 + .../tarification_solidaire_periscolaire.py | 37 +++++ .../periscolaire/accueil_soir_maternelle.yaml | 151 ++++++++++++++++++ setup.py | 2 +- tests/metropoles/strasbourg/periscolaire.yaml | 11 ++ 5 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py create mode 100644 openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/accueil_soir_maternelle.yaml create mode 100644 tests/metropoles/strasbourg/periscolaire.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 058b507f..5056c48f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [6.16.0] - 2024-11-05 + +_Pour les changements détaillés et les discussions associées, référencez la pull request [#219](https://github.com/openfisca/openfisca-france-local/pull/219)_ + +### Added + +- Ajoute la tarification périscolaire de Strasbourg `strasbourg_metropole_tarification_solidaire_periscolaire` + ## [6.15.1] - 2024-10-24 _Pour les changements détaillés et les discussions associées, référencez la pull request [#218](https://github.com/openfisca/openfisca-france-local/pull/218)_ diff --git a/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py new file mode 100644 index 00000000..6679a72c --- /dev/null +++ b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py @@ -0,0 +1,37 @@ +from openfisca_france.model.base import Variable, Famille, MONTH, max_ + + +class strasbourg_metropole_quotient_familial(Variable): + value_type = float + entity = Famille + definition_period = MONTH + label = "Quotient familial de l'eurometropole de strasbourg" + + def formula(famille, period): + rfr = famille.demandeur.foyer_fiscal("rfr", period.n_2) + nbptr = famille.demandeur.foyer_fiscal("nbptr", period.n_2) + return rfr / 12 / nbptr + + +class strasbourg_metropole_tarification_solidaire_periscolaire( + Variable +): + value_type = float + entity = Famille + definition_period = MONTH + label = "Tarification de l'accueil periscolaire de l'Eurométropole de Strasbourg" + reference = [ + # tarifs pour 2021-2022 : + "https://www.strasbourg.eu/documents/976405/1280877/0/0cc414e4-c6b7-1709-7e1e-46b088d28805", + # tarifs 2202-2023 + "https://www.strasbourg.eu/documents/976405/1280877/0/c1917f09-97b2-2604-7d58-8b8cb5c0a849", + # tarifs 2024-2025 : + "https://www.strasbourg.eu/documents/976405/1280877/Tarifs-services-periscolaires-2024-2025.pdf/62fa6543-19ae-b69d-3313-13e881a6b866?version=1.0&t=1723127337051" + ] + + def formula(famille, period, parameters): + quotient_familial = famille("strasbourg_metropole_quotient_familial", period) + tarif = parameters( + period + ).metropoles.strasbourg.periscolaire.accueil_soir_maternelle + return tarif.calc(quotient_familial) diff --git a/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/accueil_soir_maternelle.yaml b/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/accueil_soir_maternelle.yaml new file mode 100644 index 00000000..73ec861c --- /dev/null +++ b/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/accueil_soir_maternelle.yaml @@ -0,0 +1,151 @@ +description: + Tarif mensuel du service d'accueil dans les écoles maternelles de la ville de Strasbourg +metadata: + type: single_amount + references: + - tarifs-2021-2022: "https://www.strasbourg.eu/documents/976405/1280877/0/0cc414e4-c6b7-1709-7e1e-46b088d28805" + - tarifs-2022-2023-2024: "https://www.strasbourg.eu/documents/976405/1280877/0/c1917f09-97b2-2604-7d58-8b8cb5c0a849" +brackets: +- threshold: + 2021-01-01: + value: -1 + amount: + 2021-01-01: + value: 11.95 + 2024-09-01: + value: 11.85 + +- threshold: + 2024-09-01: + value: 100 + amount: + 2024-09-01: + value: 16.16 + +- threshold: + 2024-09-01: + value: 300 + amount: + 2024-09-01: + value: 20.46 + +- threshold: + 2021-01-01: + value: 410 + amount: + 2021-01-01: + value: 16.70 + +- threshold: + 2024-09-01: + value: 500 + amount: + 2024-09-01: + value: 24.77 + +- threshold: + 2021-01-01: + value: 510 + amount: + 2021-01-01: + value: 21.50 + +- threshold: + 2021-01-01: + value: 620 + amount: + 2021-01-01: + value: 26.25 + +- threshold: + 2024-09-01: + value: 700 + amount: + 2024-09-01: + value: 29.07 + +- threshold: + 2021-01-01: + value: 720 + amount: + 2021-01-01: + value: 31.10 + +- threshold: + 2021-01-01: + value: 820 + amount: + 2021-01-01: + value: 35.85 + +- threshold: + 2024-09-01: + value: 900 + amount: + 2024-09-01: + value: 33.38 + +- threshold: + 2021-01-01: + value: 920 + amount: + 2021-01-01: + value: 40.60 + 2024-09-01: + value: 33.38 + +- threshold: + 2024-09-01: + value: 1100 + amount: + 2024-09-01: + value: 37.68 + +- threshold: + 2021-01-01: + value: 1030 + amount: + 2021-01-01: + value: 45.30 + +- threshold: + 2024-09-01: + value: 1300 + amount: + 2024-09-01: + value: 41.99 + +- threshold: + 2024-09-01: + value: 1500 + amount: + 2024-09-01: + value: 46.29 + +- threshold: + 2021-01-01: + value: 1540 + amount: + 2021-01-01: + value: 50.15 + +- threshold: + 2024-09-01: + value: 1700 + amount: + 2024-09-01: + value: 50.60 + +- threshold: + 2024-09-01: + value: 1900 + amount: + 2024-09-01: + value: 54.90 + +- threshold: + 2021-01-01: + value: 2050 + amount: + 2021-01-01: + value: 54.90 diff --git a/setup.py b/setup.py index e99546d5..c4dbd0eb 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='OpenFisca-France-Local', - version='6.15.1', + version='6.16.0', author='OpenFisca Team', author_email='contact@openfisca.fr', classifiers=[ diff --git a/tests/metropoles/strasbourg/periscolaire.yaml b/tests/metropoles/strasbourg/periscolaire.yaml new file mode 100644 index 00000000..8c7a8e7b --- /dev/null +++ b/tests/metropoles/strasbourg/periscolaire.yaml @@ -0,0 +1,11 @@ +- period: 2021-10 + input: + strasbourg_metropole_quotient_familial: [0, 101, 410, 510, 620, 720, 820, 920, 1030, 1540, 2050, 3000, 5000] + output: + strasbourg_metropole_tarification_solidaire_periscolaire: [11.95, 11.95, 16.70, 21.50, 26.25, 31.10, 35.85, 40.60, 45.30, 50.15, 54.90, 54.90, 54.90] + +- period: 2024-10 + input: + strasbourg_metropole_quotient_familial: [0, 101, 300, 500, 700, 900, 1100, 1300, 1500, 1700, 1900, 2050, 3000, 5000] + output: + strasbourg_metropole_tarification_solidaire_periscolaire: [11.85, 16.16, 20.46, 24.77, 29.07, 33.38, 37.68, 41.99, 46.29, 50.60, 54.90, 54.90, 54.90, 54.90]