From e4fb13621a43283c5e43b4e78aad1bb8a808449e Mon Sep 17 00:00:00 2001 From: mferrera Date: Fri, 10 Nov 2023 13:14:23 +0100 Subject: [PATCH] CLN: Update typing in `gridprop_op1` --- src/xtgeo/grid3d/_gridprop_op1.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/xtgeo/grid3d/_gridprop_op1.py b/src/xtgeo/grid3d/_gridprop_op1.py index 8a1176645..e44d8cda9 100644 --- a/src/xtgeo/grid3d/_gridprop_op1.py +++ b/src/xtgeo/grid3d/_gridprop_op1.py @@ -18,16 +18,16 @@ from xtgeo.grid3d import Grid, GridProperty from xtgeo.xyz import Polygons - -XYCoordinate = Tuple[Union[float, int], Union[float, int]] -XYCoordList = List[List[List[XYCoordinate]]] -ValueList = List[List[Union[float, int]]] -XYValueLists = Tuple[XYCoordList, ValueList] +_CoordOrValue = Union[float, int] +_XYCoordinate = Tuple[_CoordOrValue, _CoordOrValue] +_XYCoordList = List[List[List[_XYCoordinate]]] +_ValueList = List[List[_CoordOrValue]] +XYValueLists = Tuple[_XYCoordList, _ValueList] def get_xy_value_lists( self: GridProperty, - grid: Optional[Union[Grid, GridProperty]] = None, + grid: Optional[Grid | GridProperty] = None, mask: Optional[bool] = None, ) -> XYValueLists: """Get values for webportal format @@ -87,7 +87,7 @@ def get_xy_value_lists( def operation_polygons( self: GridProperty, poly: Polygons, - value: Union[float, int], + value: float | int, opname: Literal["add", "sub", "mul", "div", "set"] = "add", inside: bool = True, ) -> None: