Skip to content

Commit

Permalink
Improve type hints.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminRodenberg committed Nov 27, 2024
1 parent d27d64f commit 4ded055
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 7 additions & 0 deletions oscillator-overlap/solver-python/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[mypy]

[mypy-scipy.*]
ignore_missing_imports = True

[mypy-precice.*]
ignore_missing_imports = True
5 changes: 3 additions & 2 deletions oscillator-overlap/solver-python/problemDefinition.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
from numpy.linalg import eig
from numpy.typing import NDArray
from typing import Callable


Expand All @@ -23,8 +24,8 @@ class Mass:
m: float
u0: float
v0: float
u_analytical: Callable[[float | np.ndarray], float | np.ndarray]
v_analytical: Callable[[float | np.ndarray], float | np.ndarray]
u_analytical: Callable[[float | NDArray], float | NDArray]
v_analytical: Callable[[float | NDArray], float | NDArray]


class MassLeft(Mass):
Expand Down
5 changes: 3 additions & 2 deletions oscillator/solver-python/problemDefinition.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
from numpy.linalg import eig
from numpy.typing import NDArray
from typing import Callable


Expand All @@ -23,8 +24,8 @@ class Mass:
m: float
u0: float
v0: float
u_analytical: Callable[[float | np.ndarray], float | np.ndarray]
v_analytical: Callable[[float | np.ndarray], float | np.ndarray]
u_analytical: Callable[[float | NDArray], float | NDArray]
v_analytical: Callable[[float | NDArray], float | NDArray]


class MassLeft(Mass):
Expand Down

0 comments on commit 4ded055

Please sign in to comment.