From 6da13d6eed93422ffde6e3e87ce4c664611fef9b Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Thu, 2 Jan 2020 06:04:04 +0100 Subject: [PATCH] Corrige les annotations MyPy --- .../model/prestations/logement_social.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/openfisca_france/model/prestations/logement_social.py b/openfisca_france/model/prestations/logement_social.py index 74673e9b9d..b7e6549c46 100644 --- a/openfisca_france/model/prestations/logement_social.py +++ b/openfisca_france/model/prestations/logement_social.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from numpy import logical_not as not_, ndarray, select from numpy.core.defchararray import startswith @@ -67,14 +69,10 @@ class zone_logement_social(Variable): definition_period = MONTH label = "Zone logement social" - def formula(menage: GroupPopulation, period: Period) -> ndarray: - depcom: ndarray = menage('depcom', period) - - in_paris_communes_limitrophes: ndarray = any( - paris_communes_limitrophes == depcom - ) - - in_idf: ndarray = any(startswith(depcom, departements_idf)) + def formula(menage: GroupPopulation, period: Period) -> ZoneLogementSocial: + depcom: ndarray[bytes] = menage('depcom', period) + in_paris_communes_limitrophes: bool = any(paris_communes_limitrophes == depcom) + in_idf: bool = any(startswith(depcom, departements_idf)) return select( [