Skip to content

Commit

Permalink
Merge pull request #295 from gerlero/typing
Browse files Browse the repository at this point in the history
Update type hints
  • Loading branch information
gerlero authored Dec 4, 2024
2 parents d4d9fcf + 545e769 commit 6036f7c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions foamlib/_files/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sys
from dataclasses import dataclass
from typing import TYPE_CHECKING, Dict, NamedTuple, Optional, Tuple, Union
from typing import TYPE_CHECKING, Dict, NamedTuple, Optional, Union

if TYPE_CHECKING:
import numpy as np
Expand All @@ -29,8 +29,7 @@ def __repr__(self) -> str:
Tensor = Union[
float,
Sequence[float],
"np.ndarray[Tuple[()], np.dtype[np.generic]]",
"np.ndarray[Tuple[int], np.dtype[np.generic]]",
"np.ndarray[tuple[()], np.dtype[np.float64 | np.int_]]",
]


Expand All @@ -48,8 +47,7 @@ def __post_init__(self) -> None:
Field = Union[
Tensor,
Sequence[Tensor],
"np.ndarray[Tuple[int], np.dtype[np.generic]]",
"np.ndarray[Tuple[int, int], np.dtype[np.generic]]",
"np.ndarray[tuple[int] | tuple[int, int], np.dtype[np.float64 | np.int_]]",
]

Data = Union[
Expand Down

0 comments on commit 6036f7c

Please sign in to comment.