Skip to content

Commit

Permalink
Formatte avec ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
guillett committed Dec 2, 2024
1 parent 219e4f8 commit 71e4406
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions openfisca_nouvelle_caledonie/variables/aide_logement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -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),
)

0 comments on commit 71e4406

Please sign in to comment.