From 99c3ced6ad78d56219af5903a62d147fdb487ef0 Mon Sep 17 00:00:00 2001 From: antoine-de Date: Mon, 10 Oct 2022 16:43:37 +0200 Subject: [PATCH 1/5] =?UTF-8?q?Mod=C3=A8lisation=20des=20tarifs=20p=C3=A9r?= =?UTF-8?q?iscolaire=20de=20strasbourg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajout de la grille tarifaire de l'acceuil matin/soir pour les écoles maternelle de strasbourg. --- .../tarification_acceuil_perisco_loisirs.py | 39 +++++++++++ .../acceuil_matin_soir_maternelle.yaml | 69 +++++++++++++++++++ tests/metropoles/strasbourg/periscolaire.yaml | 5 ++ 3 files changed, 113 insertions(+) create mode 100644 openfisca_france_local/metropoles/strasbourg/tarification_acceuil_perisco_loisirs.py create mode 100644 openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_matin_soir_maternelle.yaml create mode 100644 tests/metropoles/strasbourg/periscolaire.yaml diff --git a/openfisca_france_local/metropoles/strasbourg/tarification_acceuil_perisco_loisirs.py b/openfisca_france_local/metropoles/strasbourg/tarification_acceuil_perisco_loisirs.py new file mode 100644 index 00000000..4dceaed6 --- /dev/null +++ b/openfisca_france_local/metropoles/strasbourg/tarification_acceuil_perisco_loisirs.py @@ -0,0 +1,39 @@ +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" + + # Note: pour le moment c'est le QF de la caf, mais à terme il poura evoluer pour se baser sur les revenus imposables + def formula(famille, period): + return ( + famille.demandeur.foyer_fiscal("rfr", period.n_2) + / 12 + / famille.demandeur.foyer_fiscal("nbptr", period.n_2) + ) + + +class strasbourg_metropole_tarification_mensuelle_acceuil_periscolaire_loisir_matin_soir( + Variable +): + value_type = float + entity = Famille + definition_period = MONTH + definition_period = MONTH + label = "Tarification de l'acceuil 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" + # les tarifs 2202-2023 sont + # https://www.strasbourg.eu/documents/976405/1280877/0/c1917f09-97b2-2604-7d58-8b8cb5c0a849 + ] + + def formula(famille, period, parameters): + qf = famille("strasbourg_metropole_quotient_familial", period) + tarif = parameters( + period + ).metropoles.strasbourg.periscolaire.acceuil_matin_soir_maternelle + return tarif.calc(max_(0, qf), right=True) diff --git a/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_matin_soir_maternelle.yaml b/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_matin_soir_maternelle.yaml new file mode 100644 index 00000000..9099f756 --- /dev/null +++ b/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_matin_soir_maternelle.yaml @@ -0,0 +1,69 @@ +description: + Tarif mensuel du service d'acceuil dans les écoles maternelles de la ville de strasbourg +metadata: + type: single_amount + references: + - tarifs pour 2021-2022: "https://www.strasbourg.eu/documents/976405/1280877/0/0cc414e4-c6b7-1709-7e1e-46b088d28805" + # Non implémenté: + # - tarifs 2202-2023 sont: 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 +- threshold: + 2021-01-01: + value: 410 + amount: + 2021-01-01: + value: 16.70 +- 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: + 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: + 2021-01-01: + value: 920 + amount: + 2021-01-01: + value: 40.60 +- threshold: + 2021-01-01: + value: 1030 + amount: + 2021-01-01: + value: 45.30 +- threshold: + 2021-01-01: + value: 1540 + amount: + 2021-01-01: + value: 50.15 +- threshold: + 2021-01-01: + value: 2050 + amount: + 2021-01-01: + value: 54.90 diff --git a/tests/metropoles/strasbourg/periscolaire.yaml b/tests/metropoles/strasbourg/periscolaire.yaml new file mode 100644 index 00000000..7d1d48e2 --- /dev/null +++ b/tests/metropoles/strasbourg/periscolaire.yaml @@ -0,0 +1,5 @@ +- period: 2021-10 + input: + strasbourg_metropole_quotient_familial: [100, 1000, 3000] + output: + strasbourg_metropole_tarification_mensuelle_acceuil_periscolaire_loisir_matin_soir: [11.95, 40.60, 54.90] From 3300006c978fccd81f928d98db70df00912ad593 Mon Sep 17 00:00:00 2001 From: Shamzic Date: Thu, 24 Oct 2024 18:31:42 +0200 Subject: [PATCH 2/5] =?UTF-8?q?chore:=20m=C3=A0j=20setup=20&=20changelog?= =?UTF-8?q?=20&=20refacto=20nom=20de=20variable=20openfisca?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 8 ++++++++ ..._loisirs.py => tarification_solidaire_periscolaire.py} | 2 +- setup.py | 2 +- tests/metropoles/strasbourg/periscolaire.yaml | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) rename openfisca_france_local/metropoles/strasbourg/{tarification_acceuil_perisco_loisirs.py => tarification_solidaire_periscolaire.py} (93%) 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_acceuil_perisco_loisirs.py b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py similarity index 93% rename from openfisca_france_local/metropoles/strasbourg/tarification_acceuil_perisco_loisirs.py rename to openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py index 4dceaed6..2b8a9445 100644 --- a/openfisca_france_local/metropoles/strasbourg/tarification_acceuil_perisco_loisirs.py +++ b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py @@ -16,7 +16,7 @@ def formula(famille, period): ) -class strasbourg_metropole_tarification_mensuelle_acceuil_periscolaire_loisir_matin_soir( +class strasbourg_metropole_tarification_solidaire_periscolaire( Variable ): value_type = float 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 index 7d1d48e2..2d079fb2 100644 --- a/tests/metropoles/strasbourg/periscolaire.yaml +++ b/tests/metropoles/strasbourg/periscolaire.yaml @@ -2,4 +2,4 @@ input: strasbourg_metropole_quotient_familial: [100, 1000, 3000] output: - strasbourg_metropole_tarification_mensuelle_acceuil_periscolaire_loisir_matin_soir: [11.95, 40.60, 54.90] + strasbourg_metropole_tarification_solidaire_periscolaire: [11.95, 40.60, 54.90] From 70282df6848924d89aa52c85fd3653a4e679134e Mon Sep 17 00:00:00 2001 From: Shamzic Date: Thu, 24 Oct 2024 19:35:47 +0200 Subject: [PATCH 3/5] =?UTF-8?q?chore:=20compl=C3=A8te=20la=20couverture=20?= =?UTF-8?q?pour=20les=20tests=20de=20la=20tarification=20solidaire=20du=20?= =?UTF-8?q?p=C3=A9riscolaire=20pour=20ll'accueil=20du=20soir=20en=20matern?= =?UTF-8?q?elle=20sur=20l'ann=C3=A9e=202024?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tarification_solidaire_periscolaire.py | 26 ++- .../acceuil_matin_soir_maternelle.yaml | 69 -------- .../periscolaire/acceuil_soir_maternelle.yaml | 151 ++++++++++++++++++ tests/metropoles/strasbourg/periscolaire.yaml | 10 +- 4 files changed, 171 insertions(+), 85 deletions(-) delete mode 100644 openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_matin_soir_maternelle.yaml create mode 100644 openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_soir_maternelle.yaml diff --git a/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py index 2b8a9445..27fe43a9 100644 --- a/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py +++ b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py @@ -7,13 +7,10 @@ class strasbourg_metropole_quotient_familial(Variable): definition_period = MONTH label = "Quotient familial de l'eurometropole de strasbourg" - # Note: pour le moment c'est le QF de la caf, mais à terme il poura evoluer pour se baser sur les revenus imposables def formula(famille, period): - return ( - famille.demandeur.foyer_fiscal("rfr", period.n_2) - / 12 - / famille.demandeur.foyer_fiscal("nbptr", period.n_2) - ) + 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( @@ -22,18 +19,19 @@ class strasbourg_metropole_tarification_solidaire_periscolaire( value_type = float entity = Famille definition_period = MONTH - definition_period = MONTH label = "Tarification de l'acceuil 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" - # les tarifs 2202-2023 sont - # https://www.strasbourg.eu/documents/976405/1280877/0/c1917f09-97b2-2604-7d58-8b8cb5c0a849 + # 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): - qf = famille("strasbourg_metropole_quotient_familial", period) + quotient_familial = famille("strasbourg_metropole_quotient_familial", period) tarif = parameters( period - ).metropoles.strasbourg.periscolaire.acceuil_matin_soir_maternelle - return tarif.calc(max_(0, qf), right=True) + ).metropoles.strasbourg.periscolaire.acceuil_soir_maternelle + return tarif.calc(quotient_familial) diff --git a/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_matin_soir_maternelle.yaml b/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_matin_soir_maternelle.yaml deleted file mode 100644 index 9099f756..00000000 --- a/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_matin_soir_maternelle.yaml +++ /dev/null @@ -1,69 +0,0 @@ -description: - Tarif mensuel du service d'acceuil dans les écoles maternelles de la ville de strasbourg -metadata: - type: single_amount - references: - - tarifs pour 2021-2022: "https://www.strasbourg.eu/documents/976405/1280877/0/0cc414e4-c6b7-1709-7e1e-46b088d28805" - # Non implémenté: - # - tarifs 2202-2023 sont: 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 -- threshold: - 2021-01-01: - value: 410 - amount: - 2021-01-01: - value: 16.70 -- 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: - 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: - 2021-01-01: - value: 920 - amount: - 2021-01-01: - value: 40.60 -- threshold: - 2021-01-01: - value: 1030 - amount: - 2021-01-01: - value: 45.30 -- threshold: - 2021-01-01: - value: 1540 - amount: - 2021-01-01: - value: 50.15 -- threshold: - 2021-01-01: - value: 2050 - amount: - 2021-01-01: - value: 54.90 diff --git a/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_soir_maternelle.yaml b/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_soir_maternelle.yaml new file mode 100644 index 00000000..68f9909f --- /dev/null +++ b/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_soir_maternelle.yaml @@ -0,0 +1,151 @@ +description: + Tarif mensuel du service d'acceuil dans les écoles maternelles de la ville de strasbourg +metadata: + type: single_amount + references: + - tarifs pour 2021-2022: "https://www.strasbourg.eu/documents/976405/1280877/0/0cc414e4-c6b7-1709-7e1e-46b088d28805" + - tarifs pour 2022, 2023 et 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/tests/metropoles/strasbourg/periscolaire.yaml b/tests/metropoles/strasbourg/periscolaire.yaml index 2d079fb2..8c7a8e7b 100644 --- a/tests/metropoles/strasbourg/periscolaire.yaml +++ b/tests/metropoles/strasbourg/periscolaire.yaml @@ -1,5 +1,11 @@ - period: 2021-10 input: - strasbourg_metropole_quotient_familial: [100, 1000, 3000] + 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, 40.60, 54.90] + 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] From 48bc3a0e0d424b54ccc526e4f94e4684539b725d Mon Sep 17 00:00:00 2001 From: Simon Hamery Date: Tue, 5 Nov 2024 11:02:41 +0100 Subject: [PATCH 4/5] Update openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jérémy PASTOURET --- .../strasbourg/tarification_solidaire_periscolaire.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py index 27fe43a9..383e3256 100644 --- a/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py +++ b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py @@ -19,7 +19,7 @@ class strasbourg_metropole_tarification_solidaire_periscolaire( value_type = float entity = Famille definition_period = MONTH - label = "Tarification de l'acceuil periscolaire de l'Eurométropole de Strasbourg" + 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", From bcbf76818e19c7c9f377f6e760ea3fcbc9f4671a Mon Sep 17 00:00:00 2001 From: Shamzic Date: Tue, 5 Nov 2024 11:09:31 +0100 Subject: [PATCH 5/5] refactor: terme "accueil" periscolaire - Strasbourg --- .../strasbourg/tarification_solidaire_periscolaire.py | 2 +- ...il_soir_maternelle.yaml => accueil_soir_maternelle.yaml} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/{acceuil_soir_maternelle.yaml => accueil_soir_maternelle.yaml} (85%) diff --git a/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py index 383e3256..6679a72c 100644 --- a/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py +++ b/openfisca_france_local/metropoles/strasbourg/tarification_solidaire_periscolaire.py @@ -33,5 +33,5 @@ def formula(famille, period, parameters): quotient_familial = famille("strasbourg_metropole_quotient_familial", period) tarif = parameters( period - ).metropoles.strasbourg.periscolaire.acceuil_soir_maternelle + ).metropoles.strasbourg.periscolaire.accueil_soir_maternelle return tarif.calc(quotient_familial) diff --git a/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_soir_maternelle.yaml b/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/accueil_soir_maternelle.yaml similarity index 85% rename from openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_soir_maternelle.yaml rename to openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/accueil_soir_maternelle.yaml index 68f9909f..73ec861c 100644 --- a/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/acceuil_soir_maternelle.yaml +++ b/openfisca_france_local/parameters/metropoles/strasbourg/periscolaire/accueil_soir_maternelle.yaml @@ -1,10 +1,10 @@ description: - Tarif mensuel du service d'acceuil dans les écoles maternelles de la ville de strasbourg + Tarif mensuel du service d'accueil dans les écoles maternelles de la ville de Strasbourg metadata: type: single_amount references: - - tarifs pour 2021-2022: "https://www.strasbourg.eu/documents/976405/1280877/0/0cc414e4-c6b7-1709-7e1e-46b088d28805" - - tarifs pour 2022, 2023 et 2024: https://www.strasbourg.eu/documents/976405/1280877/0/c1917f09-97b2-2604-7d58-8b8cb5c0a849 + - 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: