Skip to content

Commit

Permalink
Add missing variable types
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauko Quiroga committed Sep 21, 2021
1 parent 02488be commit 5be77d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openfisca_core/indexed_enums/enum.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import enum
from typing import Any, Union
from typing import Any, List, Union

import numpy

Expand Down Expand Up @@ -227,6 +227,9 @@ def encode(cls, array: A) -> EnumArray:
"""

conditions: List[ArrayType[bool]]
choices: List[int]

if isinstance(array, EnumArray):

return array
Expand Down
1 change: 1 addition & 0 deletions openfisca_core/indexed_enums/enum_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5be77d1

Please sign in to comment.