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.14.tar.gz (58.7 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.14-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for interpax-0.3.14.tar.gz
Algorithm Hash digest
SHA256 5018c18a07d946be7466504f385b4e5ac632cd7b006c1cead42b1aefe37e16e3
MD5 5d238263210e0040707d8e5c1e24ef1d
BLAKE2b-256 38b206d071b6eade1ea7e3bb0660aa3c1f8fd6484fa611cc45cd424d2bbebecf

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for interpax-0.3.14-py3-none-any.whl
Algorithm Hash digest
SHA256 070c5242227fa65bd7dafc472ae2ed0c4df9891fbbbede73a8b04e21859a5d47
MD5 712d7395957ecd21964f052738985994
BLAKE2b-256 c8773b4c3db18738ffc146887f3b47e44159d370509c3ee302f0456a8f0dfcac

See more details on using hashes here.

Provenance

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