Minor tweaks

This commit is contained in:
Denis Merigoux 2022-09-26 17:35:43 +02:00
parent 0beaf6eb31
commit a805ac0acc
No known key found for this signature in database
GPG Key ID: EE99DCFA365C3EE3
2 changed files with 6 additions and 5 deletions

View File

@ -172,7 +172,7 @@ class CnafSimulatorInput():
self.revenu_pris_en_compte = revenu_pris_en_compte
def __str__(self):
return "-> Code postal : {}\n-> Logement : {}\n-> Loyer : {}\n-> Seul of couple : {}\n-> Enfants:\n{}\n-> Revenus pris en compte : {}".format(
return "-> Code postal : {}\n-> Logement : {}\n-> Loyer : {}\n-> Seul of couple : {}\n-> Enfants :\n{}\n-> Revenus pris en compte : {}".format(
self.zone.name,
self.logement,
self.loyer,

View File

@ -96,15 +96,16 @@ def run_catala_by_converting_cnaf_input(sample_input: CnafSimulatorInput) -> flo
return round(housing_benefits_gross*0.995) # We take the CRDS
print("🏡 Description du ménage")
print(sample_input)
housing_benefits_catala = run_catala_by_converting_cnaf_input(sample_input)
print("Aides au logement (Catala): {}".format(housing_benefits_catala))
print("💰 Aides au logement (Catala): {}".format(housing_benefits_catala))
housing_benefits_cnaf = run_simulator(sample_input)
print("Aides au logement (CNAF) : {}".format(housing_benefits_cnaf))
print("💰 Aides au logement (CNAF) : {}".format(housing_benefits_cnaf))
delta = abs(housing_benefits_catala - housing_benefits_cnaf)
if delta == 0:
print("No difference!")
print("✅ Pas de difference")
exit(0)
else:
print("There is a difference!")
print("❌ Différence")
exit(-1)