Skip to main content

Interpolation and function approximation with JAX

Project description

License DOI GitHub issues Pypi

Documentation UnitTests Coverage

interpax is a library for interpolation and function approximation using JAX.

Includes methods for nearest neighbor, linear, and several cubic interpolation schemes in 1d, 2d, and 3d, as well as Fourier interpolation for periodic functions in 1d and 2d.

Coming soon: - Spline interpolation for rectilinear grids in N-dimensions - RBF interpolation for unstructured data in N-dimensions - Smoothing splines for noisy data

Installation

interpax is installable with pip:

pip install interpax

Usage

import jax.numpy as jnp
import numpy as np
from interpax import interp1d

xp = jnp.linspace(0, 2 * np.pi, 100)
xq = jnp.linspace(0, 2 * np.pi, 10000)
f = lambda x: jnp.sin(x)
fp = f(xp)

fq = interp1d(xq, xp, fp, method="cubic")
np.testing.assert_allclose(fq, f(xq), rtol=1e-6, atol=1e-5)

For full details of various options see the API documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interpax-0.3.12.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

interpax-0.3.12-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file interpax-0.3.12.tar.gz.

File metadata

  • Download URL: interpax-0.3.12.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for interpax-0.3.12.tar.gz
Algorithm Hash digest
SHA256 9563b5458a70a9bac34372c68d8fca34a03864e19805b06763a1c48dbd420699
MD5 83eb16a5164dbc3b4d4ef3d7e99b20a5
BLAKE2b-256 1b3955576cf2c33c1f4df483ec1507fb36027389c00863772b78abf04c75afff

See more details on using hashes here.

Provenance

The following attestation bundles were made for interpax-0.3.12.tar.gz:

Publisher: release.yml on f0uriest/interpax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file interpax-0.3.12-py3-none-any.whl.

File metadata

  • Download URL: interpax-0.3.12-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for interpax-0.3.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1f447c238ae629dabf23f9c04671d52a03d11251f31ec7607556c576a81142b6
MD5 a87f7def531d3eab16733e149b8f62ee
BLAKE2b-256 e6412077ef0c346d44ec66d1ee807493631fbe07e6088255191b4324fc258949

See more details on using hashes here.

Provenance

The following attestation bundles were made for interpax-0.3.12-py3-none-any.whl:

Publisher: release.yml on f0uriest/interpax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page