|
154 | 154 | from transonic import jit |
155 | 155 |
|
156 | 156 |
|
157 | | -def semi_integration(y, x, v=-0.5, alg="frlt", transonic_backend="pythran", d_tol=1e-5): |
| 157 | +def semi_integration( |
| 158 | + y: np.ndarray, |
| 159 | + x: np.ndarray, |
| 160 | + v: float = -0.5, |
| 161 | + alg: str = "frlt", |
| 162 | + transonic_backend: str = "pythran", |
| 163 | + d_tol: float = 1e-5, |
| 164 | +) -> np.ndarray: |
158 | 165 | r""" |
159 | 166 | A generalized call is implemented, in which the user can define with ``v`` the operation i.e. semi integration |
160 | 167 | (``v`` :math:`=-0.5`) or semi differentiation (``v`` :math:`=0.5`) for a predefined dataset (``y`` and ``t``). |
@@ -271,8 +278,10 @@ def riemann_pythran(y, delta_x, v): |
271 | 278 |
|
272 | 279 | return riemann_pythran(y, delta_x, v) |
273 | 280 |
|
| 281 | + raise AssertionError(f"unhandled alg/backend combination: {alg!r}/{transonic_backend!r}") |
274 | 282 |
|
275 | | -def gruenwald(y, delta_x, v=-0.5): |
| 283 | + |
| 284 | +def gruenwald(y: np.ndarray, delta_x: float, v: float = -0.5) -> np.ndarray: |
276 | 285 | """ |
277 | 286 | Gruenwald Algorithm |
278 | 287 | ^^^^^^^^^^^^^^^^^^^ |
@@ -331,7 +340,7 @@ def gruenwald(y, delta_x, v=-0.5): |
331 | 340 | return g_1 |
332 | 341 |
|
333 | 342 |
|
334 | | -def riemann(y, delta_x, v=-0.5): |
| 343 | +def riemann(y: np.ndarray, delta_x: float, v: float = -0.5) -> np.ndarray: |
335 | 344 | """ |
336 | 345 |
|
337 | 346 | Riemann Algorithm |
@@ -399,7 +408,7 @@ def riemann(y, delta_x, v=-0.5): |
399 | 408 | return r_1 |
400 | 409 |
|
401 | 410 |
|
402 | | -def fast_riemann(y, delta_x=1, q=-0.5, c1=8, c2=2): |
| 411 | +def fast_riemann(y: np.ndarray, delta_x: float = 1, q: float = -0.5, c1: int = 8, c2: int = 2) -> np.ndarray: |
403 | 412 | r""" |
404 | 413 |
|
405 | 414 | Fast Riemann Algorithm |
|
0 commit comments