rxnfit.numbalsoda_rhs module

Compile SymPy-derived ODE right-hand sides into numbalsoda LSODA kernels.

Generates Numba cfunc callables with the LSODA signature rhs(t, u, du, p). The parameter layout in p must stay synchronized with rxnfit.lsoda_p_vector.build_lsoda_parameter_vector_p().

Note

Do not import rxnfit.build_ode from this module; build_ode loads it lazily to keep the dependency graph acyclic.

rxnfit.numbalsoda_rhs.compile_numbalsoda_rhs_for_builder(builder: Any, rate_const_values: Any, symbolic_rate_const_keys: Any) → Tuple[Any, int] | None

Return (numba cfunc, n_p) for numbalsoda, or None if unavailable.

Skips compilation for time-dependent systems (callable rate_const_values or t in rate expressions) or when optional deps fail.

Note

SymPy 1.13+ no longer registers lambdify(..., modules="numba"). We use modules="numpy" then compile with numba.njit(...) (see SymPy test_issue_20070).