Skip to main content

numsci

num[ba]sci[py] - A Numba-Compatible Port for Popular Scipy Functions

Most Scipy Functions do not work in jit-compiled Numba functions. This project aims to make this possible.

How to use

Model functions must abide by the following convention

from numsci.optimize import model_sig

@model_sig
def model_function(x: float64, params: ndarray(dtype=float64)) -> float64:
    ***do computation***
    return result

Where the @model_sig decorator indicates that the function is a Numba Cfunc of signature float64(float64, *float64).

Outside of the jit-compiled function, the caller must also obtain the address to the model function

model_function_address = model_function.address

This can then be used to call Scipy-like functions like curve_fit() in a @njit decorated function

from numsci.optimize import curve_fit

@njit
def njit_function():
    fvec, pcov = curve_fit(model_function_address, xdata, ydata)

Setup

Install dependencies and compile

pip install -r requirements.txt
bash build.sh                                          

Metadata

Release files for numsci 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for numsci 1.0.0
File Size Uploaded
numsci-1.0.0.tar.gz 38.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for numsci 1.0.0
File Interpreter ABI Platform
numsci-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 75.4 kB

Release files / numsci-1.0.0.tar.gz

Download URL numsci-1.0.0.tar.gz
Size 38.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a736d45da186b7f88eef4f80543a9167a0ac0c652d00fddb14704c37c9081ee3
BLAKE2b-256 checksum
How to use checksums
b56269b0310dc763db06743fc4811cfb598f54c19541cbee9b6c3676267fccca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / numsci-1.0.0-py3-none-any.whl

Download URL numsci-1.0.0-py3-none-any.whl
Size 37.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54174bef78c60b8a620158917f01206a9a12059dbebaf9d82210df89ff5518c9
BLAKE2b-256 checksum
How to use checksums
f5583fdd5abb2742dbf1f945116162d9384bda9ced5692cb8d93133744ac76c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page