cinx
cinx is a minimal, non-nonsense library for differentiable and fast cubic spline interpolation in JAX.
It's designed to be fully JAX-native, supporting GPU/TPU/CPU execution, and allowing you to backpropagate through your interpolation steps for seamless integration into your machine learning workflows.
Usage
cinx provides a straightforward interp function that handles both single-variable and multi-variable interpolation.
Its pure JAX design means you can trivially use JAX transformations like jax.vmap for batch processing and jax.grad for gradient calculations.
Basic 1D Interpolation
import cinx
import jax.numpy as jnp
xp = jnp.linspace(0, 1, 5)
fp = jnp.sin(xp * jnp.pi)
x = jnp.linspace(0, 1, 100)
f = cinx.interp(x, xp, fp)
Multi-variate Interpolation
import jax.numpy as jnp
from cinx import interp
theta = jnp.linspace(0, 2 * jnp.pi, 5)
X_data = jnp.stack((theta, jnp.sin(theta)), axis=-1)
fp = jnp.dot(X_data, rot_matrix(jnp.pi / 4).T)
xp = jnp.linspace(0, 1, len(fp))
x = jnp.linspace(0, 1, 100)
f = interp(x, xp, fp)
Batch Interpolation
import jax
import jax.numpy as jnp
from cinx import interp
theta = jnp.linspace(0, 2 * jnp.pi, 5)
rot_matrix = lambda a: jnp.array([[jnp.cos(a), -jnp.sin(a)],
[jnp.sin(a), jnp.cos(a)]])
X_data = jnp.stack((theta, jnp.sin(theta)), axis=-1)
angles_batch = jnp.linspace(0, 2 * jnp.pi, 10)
fp = jnp.stack([jnp.dot(X_data, rot_matrix(a).T) for a in angles_batch], axis=0)
xp = jnp.linspace(0, 1, len(fp[0]))
x = jnp.linspace(0, 1, 100)
interp_vmap = jax.vmap(interp, in_axes=(None, None, 0))
f = interp_vmap(x, xp, fp)
Installation
cinx can be installed from PyPI via pip:
pip install cinx
Citation
You don't have to, but if you use cinx in your research and need to reference it, please cite it as follows:
@software{alonso_zdyb_cinx,
author = {Alonso, Albert and Zdyb, Frans},
title = {cinx: Minimal Cubic Spline Interpolation in JAX},
url = {https://github.com/alonfnt/cinx},
version = {0.0.1},
year = {2025}
}
Metadata
Release files for cinx 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cinx-0.0.1.tar.gz | 4.4 kB | With provenance | Details for cinx-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cinx-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for cinx-0.0.1-py3-none-any.whl |
Total release size: 9.0 kB
Release files / cinx-0.0.1.tar.gz
| Download URL | cinx-0.0.1.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c52b9a3c4543ef073daf85946fd83a14d5ff4c82745cdbdb93fa7426dd51c0fd
|
|
BLAKE2b-256 checksum How to use checksums |
7d2d0e7d4d61f1682ef0f3f94e92598ae3a83a2909426c34c5db23476034728e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2025.
Transparency logRelease files / cinx-0.0.1-py3-none-any.whl
| Download URL | cinx-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
389f541a298787b4cde2255a09069db703d8b99ba2e59039a3996c91abdc0d47
|
|
BLAKE2b-256 checksum How to use checksums |
a4904ae8ec784151dee06b86c674b9b89de58ce9beaf8777b46db1edd1114978
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2025.
Transparency logSecurity for cinx 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for cinx-0.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 4, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.