SciJIT

GitHub · PyPI

A scipy-equivalent library callable from inside numba @njit code. scijit either wraps the same Fortran packs scipy wraps, or re-implements scipy’s pure-Python routines as @njit. Results match scipy, verified against it in the test suite. It pays off most when the same routine runs many times inside a compiled loop, where scipy would pay Python’s per-call overhead on every iteration.

scipy’s classes are called like spl(x), but a numba jitclass has no __call__. To mirror scipy, scijit uses scijitclass, which adds __call__ to numba jitclasses, so scijit’s classes keep scipy’s call syntax inside @njit. It is a standalone @jitclass replacement, usable in any numba project.

import numpy as np
from numba import njit
from scijit.integrate import quad

@njit
def decay(t):
    return np.exp(-t)

@njit
def area(a, b):
    return quad(decay, a, b)[0]

area(0.0, 1.0)                                 # 0.6321205588285578

Getting started

  • Getting started: a first end-to-end @njit workflow.

  • Install: wheel install, source install, and the import-failure note.

Usage guides

  • Usage overview: callback conventions and thread safety.

  • interpolate: FITPACK splines, BSpline, make_interp_spline, Akima1DInterpolator, and the interpolator classes.

  • integrate: quad, solve_ivp, odeint, the nestable nquad/dblquad/tplquad, and the sampled-data quadrature routines.

  • optimize: roots, least squares, minimization, PRIMA, and the scalar root-finders and minimizers.

Reference

  • API reference: every public name, generated from the docstrings.

Explanation

  • Architecture: what a call passes through, the callback adapter, the ctypes boundary, the return types, and the jitclass rules.

  • Compatibility: supported versions, where agreement with scipy is bit-for-bit, thread safety, and the prange-safety matrix.

  • Roadmap: what is not covered yet, and why.

  • Credits: provenance and the upstream library and license table.