From 5be77d1d1ba1d4b9aeffe73d191ca5051a61a531 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Mon, 20 Sep 2021 16:40:44 +0200 Subject: [PATCH] Add missing variable types --- openfisca_core/indexed_enums/enum.py | 5 ++++- openfisca_core/indexed_enums/enum_array.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/openfisca_core/indexed_enums/enum.py b/openfisca_core/indexed_enums/enum.py index 6cea7a383d..b3f5dc6c76 100644 --- a/openfisca_core/indexed_enums/enum.py +++ b/openfisca_core/indexed_enums/enum.py @@ -1,7 +1,7 @@ from __future__ import annotations import enum -from typing import Any, Union +from typing import Any, List, Union import numpy @@ -227,6 +227,9 @@ def encode(cls, array: A) -> EnumArray: """ + conditions: List[ArrayType[bool]] + choices: List[int] + if isinstance(array, EnumArray): return array diff --git a/openfisca_core/indexed_enums/enum_array.py b/openfisca_core/indexed_enums/enum_array.py index c480c2dae9..ca118cb119 100644 --- a/openfisca_core/indexed_enums/enum_array.py +++ b/openfisca_core/indexed_enums/enum_array.py @@ -76,6 +76,7 @@ def __new__( ) -> EnumArray: """See comment above.""" + obj: EnumArray obj = numpy.asarray(input_array).view(cls) obj.possible_values = possible_values return obj