Skip to content

Commit

Permalink
CLN: Add types to ecl_output_file
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Nov 23, 2023
1 parent 4dc7244 commit ee18075
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/xtgeo/grid3d/_ecl_output_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from __future__ import annotations

from enum import Enum, unique
from typing import Literal


@unique
Expand All @@ -15,7 +18,7 @@ class TypeOfGrid(Enum):
BLOCK_CENTER = 3

@classmethod
def alternate_code(cls, code):
def alternate_code(cls, code: Literal[0, 1, 2, 3]) -> TypeOfGrid:
"""Converts from alternate code to TypeOfGrid member.
weirdly, type of grid sometimes (For instance init's INTHEAD and
Expand All @@ -34,7 +37,7 @@ def alternate_code(cls, code):
return type_of_grid

@property
def alternate_value(self):
def alternate_value(self) -> int:
"""Inverse of alternate_code."""
alternate_value = 0
if self == TypeOfGrid.CORNER_POINT:
Expand Down

0 comments on commit ee18075

Please sign in to comment.