Usage¶
AkimaSpline (see the API reference reference and the Quick Start on the
pyakima page) covers ordinary Python callers. This page covers the
Numba-facing helpers and the option flags shared by both interfaces.
Jitted Use¶
Use make_akima_coeffs and cubic_call when the spline should be created or
evaluated from inside an njit function.
import numpy as np
from numba import njit
from pyakima import make_akima_coeffs, cubic_call
@njit
def build_and_evaluate(x: np.ndarray, y: np.ndarray, x_eval: np.ndarray) -> np.ndarray:
coeffs = make_akima_coeffs(x, y, corner_model=2)
return cubic_call(x_eval, coeffs, 0)
For lower-level control, call cubic_call_scalar,
cubic_call_vector, or cubic_call_vector_linear directly.
Spline Options¶
pyakima supports several Akima corner models:
|
helper option |
Behavior |
|---|---|---|
|
|
Wodicka/GSL-style non-rounded sharp corners. |
|
|
Classic Akima behavior, close to |
|
|
Modified Akima weights, close to |
Boundary handling uses SciPy-like ext values:
|
Out-of-bounds behavior |
|---|---|
|
Extrapolate. |
|
Return zero. |
|
Return the nearest boundary value. |
|
Return |
ext=2 (raise on out-of-bounds) is not implemented. ext=4 is added for
NaN boundary handling. AkimaSpline defaults to ext=3.