Skip to content

Commit

Permalink
CLN: Update typing in _grid3d_utils
Browse files Browse the repository at this point in the history
Updates to future type annotations.
  • Loading branch information
mferrera committed Nov 13, 2023
1 parent b4cfae6 commit 13d43a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/xtgeo/grid3d/_grid3d_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import re
from typing import TYPE_CHECKING, List, Literal, Union
from typing import TYPE_CHECKING, Literal

import pandas as pd

Expand Down Expand Up @@ -93,7 +93,7 @@ def scan_dates(pfile: _XTGeoFile, maxdates: int = MAXDATES, dataframe: bool = Fa

def _scan_ecl_keywords(
pfile: _XTGeoFile, maxkeys: int = MAXKEYWORDS, dataframe: bool = False
) -> Union[List[KeywordTuple], pd.DataFrame]:
) -> list[KeywordTuple] | pd.DataFrame:
cfhandle = pfile.get_cfhandle()

# maxkeys*10 is used for 1D keywords; 10 => max 8 letters in eclipse +
Expand Down Expand Up @@ -144,7 +144,7 @@ def _scan_ecl_keywords(

def _scan_ecl_keywords_w_dates(
pfile: _XTGeoFile, maxkeys: int = MAXKEYWORDS, dataframe: bool = False
) -> Union[List[KeywordDateTuple], pd.DataFrame]:
) -> list[KeywordDateTuple] | pd.DataFrame:
"""Add a date column to the keyword"""
xkeys = _scan_ecl_keywords(pfile, maxkeys=maxkeys, dataframe=False)
xdates = scan_dates(pfile, maxdates=MAXDATES, dataframe=False)
Expand Down Expand Up @@ -172,7 +172,7 @@ def _scan_ecl_keywords_w_dates(

def _scan_roff_keywords(
pfile: _XTGeoFile, maxkeys: int = MAXKEYWORDS, dataframe: bool = False
) -> Union[List[KeywordTuple], pd.DataFrame]:
) -> list[KeywordTuple] | pd.DataFrame:
rectypes = _cxtgeo.new_intarray(maxkeys)
reclens = _cxtgeo.new_longarray(maxkeys)
recstarts = _cxtgeo.new_longarray(maxkeys)
Expand Down

0 comments on commit 13d43a1

Please sign in to comment.