Skip to content

Commit

Permalink
Formatte la base de code
Browse files Browse the repository at this point in the history
  • Loading branch information
guillett committed Nov 21, 2024
1 parent 7a98dac commit 830c16a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 0 additions & 2 deletions openfisca_nouvelle_caledonie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"""

import os

from openfisca_core.taxbenefitsystems import TaxBenefitSystem

from openfisca_nouvelle_caledonie import entities

COUNTRY_DIR = os.path.dirname(os.path.abspath(__file__))
Expand Down
15 changes: 10 additions & 5 deletions openfisca_nouvelle_caledonie/variables/aide_logement.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def formula(household, period, parameters):
loyer_base = household("aide_logement_loyer", period)
loyer_reference = household("loyer_mensuel_reference", period)
retraite = household("aide_logement_cas_particulier_retraite", period)
loyer = where(retraite, loyer_reference, loyer_base)
loyer = where(retraite, loyer_reference, loyer_base)

charges = household("charges_locatives", period)

Expand All @@ -197,14 +197,16 @@ def formula(household, period, parameters):
loyer_base = household("aide_logement_loyer", period)
loyer_reference = household("loyer_mensuel_reference", period)
retraite = household("aide_logement_cas_particulier_retraite", period)
loyer = where(retraite, loyer_reference, loyer_base)
loyer = where(retraite, loyer_reference, loyer_base)

charges = household("charges_locatives", period)
loyer_reference = household("loyer_mensuel_reference", period)

typologie = household("typologie_logement", period)

pa = parameters(period).benefits.aide_logement.supplement_loyer.solde_revenu_positif_pourcentage_charges
pa = parameters(
period
).benefits.aide_logement.supplement_loyer.solde_revenu_positif_pourcentage_charges
a = pa * (loyer + charges - loyer_reference)

pb = parameters(
Expand Down Expand Up @@ -403,7 +405,7 @@ def formula(household, period):
nb_enfs = household("aide_logement_nb_enfants", period)

c1 = (nb_adultes == 1) * (nb_enfs == 0) * (base_ressources <= 90000)
c2 = (base_ressources <= 110000)
c2 = base_ressources <= 110000
c3 = (nb_enfs > 0) * (base_ressources <= 110000)

return ret * (c1 + c2 + c3)
Expand Down Expand Up @@ -449,7 +451,10 @@ def formula(household, period, parameters):
bourse = household("bourse", period)
aides_sociales_et_bourses = aide_sociale + bourse

return where(aides_sociales_et_bourses > 0, minimum_aides_bourses, minimum) + max_(0, base_ressources - plafond) / 3.
return (
where(aides_sociales_et_bourses > 0, minimum_aides_bourses, minimum)
+ max_(0, base_ressources - plafond) / 3.0
)


class aide_logement_contribution_minimale(Variable):
Expand Down

0 comments on commit 830c16a

Please sign in to comment.