Skip to content

Commit dfd5427

Browse files
committed
Fix typing
1 parent beea193 commit dfd5427

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/examples/plot_stress.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# pylint: disable=pointless-statement
88

99
from pathlib import Path
10-
from typing import List
10+
from typing import List, Union
1111
import numpy as np
1212
from lasso.dyna import ArrayType
1313
from mesh2vec.mesh2vec_cae import Mesh2VecCae
@@ -23,7 +23,7 @@
2323
)
2424

2525

26-
def mean_over_components_all_layers(v: List | np.ndarray) -> np.ndarray:
26+
def mean_over_components_all_layers(v: Union[List, np.ndarray]) -> np.ndarray:
2727
"""get mean over all components and all layers"""
2828
return np.mean(v, axis=-1)
2929

mesh2vec/mesh_features.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""calculation of mesh based features"""
22

33
import os
4-
from typing import Tuple, List, Any, Optional
4+
from typing import Tuple, List, Any, Optional, Union
55

66
import numpy as np
77
import numpy.typing
@@ -245,7 +245,7 @@ def from_ansa_json(elements: List[Any], nodes: List[Any]) -> "CaeShellMesh":
245245
return CaeShellMesh(point_coordinates, pnt_ids, elem_ids, elem_node_idxs)
246246

247247
@staticmethod
248-
def from_keyfile(keyfile: str | os.PathLike, partid: str = "") -> "CaeShellMesh":
248+
def from_keyfile(keyfile: Union[str, os.PathLike], partid: str = "") -> "CaeShellMesh":
249249
"""
250250
create CaeShellMesh from keyfile
251251

0 commit comments

Comments
 (0)