From 71e44066907bae00aee4529ff25973bf1434bf5d Mon Sep 17 00:00:00 2001 From: Thomas Guillet Date: Mon, 2 Dec 2024 12:38:48 +0100 Subject: [PATCH] Formatte avec ruff --- .../variables/aide_logement.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/openfisca_nouvelle_caledonie/variables/aide_logement.py b/openfisca_nouvelle_caledonie/variables/aide_logement.py index dfa78be..d46b241 100644 --- a/openfisca_nouvelle_caledonie/variables/aide_logement.py +++ b/openfisca_nouvelle_caledonie/variables/aide_logement.py @@ -176,7 +176,9 @@ def formula(household, period, parameters): loyer_reference = household("loyer_mensuel_reference", period) retraite = household("aide_logement_cas_particulier_retraite", period) loyer = where(retraite, loyer_reference, loyer_base) - aide_logement_neutralisation_loyer = household('aide_logement_neutralisation_loyer', period) + aide_logement_neutralisation_loyer = household( + "aide_logement_neutralisation_loyer", period + ) charges = household("charges_locatives", period) @@ -187,7 +189,11 @@ def formula(household, period, parameters): typologie ] - a = loyer * (1 - aide_logement_neutralisation_loyer) + charges - loyer_reference * (1 - aide_logement_neutralisation_loyer) + a = ( + loyer * (1 - aide_logement_neutralisation_loyer) + + charges + - loyer_reference * (1 - aide_logement_neutralisation_loyer) + ) b = p * loyer_reference return min_(a, b) @@ -207,14 +213,20 @@ def formula(household, period, parameters): charges = household("charges_locatives", period) loyer_reference = household("loyer_mensuel_reference", period) - aide_logement_neutralisation_loyer = household('aide_logement_neutralisation_loyer', period) + aide_logement_neutralisation_loyer = household( + "aide_logement_neutralisation_loyer", period + ) typologie = household("typologie_logement", period) pa = parameters( period ).benefits.aide_logement.supplement_loyer.solde_revenu_positif_pourcentage_charges - a = pa * (loyer * (1 - aide_logement_neutralisation_loyer) + charges - loyer_reference * (1 - aide_logement_neutralisation_loyer)) + a = pa * ( + loyer * (1 - aide_logement_neutralisation_loyer) + + charges + - loyer_reference * (1 - aide_logement_neutralisation_loyer) + ) pb = parameters( period @@ -546,5 +558,5 @@ def formula(household, period): return where( typologie_logement == TypologieLogement.maisonderetraite, montant, - where(loyer <= loyer_mensuel_plafond, montant, 0) - ) + where(loyer <= loyer_mensuel_plafond, montant, 0), + )