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.13.tar.gz (58.5 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.13-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: interpax-0.3.13.tar.gz
  • Upload date:
  • Size: 58.5 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.13.tar.gz
Algorithm Hash digest
SHA256 1aab65282045ca3972dbec6cb63878415836ae2d2764c77e78d3880bd711efd7
MD5 858342c25d0a73e3e94726058d435891
BLAKE2b-256 155a30250d5f01b5da2841aefade5baac9c8e65edb747e82fffda4c225db1127

See more details on using hashes here.

Provenance

The following attestation bundles were made for interpax-0.3.13.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.13-py3-none-any.whl.

File metadata

  • Download URL: interpax-0.3.13-py3-none-any.whl
  • Upload date:
  • Size: 27.9 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 7385452a5ffdc7f7a7aaec05aad27e88c069abcd561b4cf3afc643b08458b22d
MD5 6930f607b1d4dc932db4495ae43ce0a6
BLAKE2b-256 4007dbf4a8caea5f050c9e8d647a0e705a4d8fbe25ae5baf89657ba3af3695da

See more details on using hashes here.

Provenance

The following attestation bundles were made for interpax-0.3.13-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