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:

AkimaSpline option

helper option

Behavior

"non-rounded"

0

Wodicka/GSL-style non-rounded sharp corners.

"akima"

1

Classic Akima behavior, close to scipy method="akima".

"makima"

2

Modified Akima weights, close to scipy method="makima".

Boundary handling uses SciPy-like ext values:

ext

Out-of-bounds behavior

0

Extrapolate.

1

Return zero.

3

Return the nearest boundary value.

4

Return nan.

ext=2 (raise on out-of-bounds) is not implemented. ext=4 is added for NaN boundary handling. AkimaSpline defaults to ext=3.