interpax


Nameinterpax JSON
Version 0.3.1 PyPI version JSON
download
home_pagehttps://github.com/f0uriest/interpax
SummaryInterpolation and function approximation with JAX
upload_time2024-03-06 00:48:09
maintainer
docs_urlNone
authorRory Conlin
requires_python>=3.8
licenseMIT
keywords interpolation spline cubic fourier approximation
VCS
bugtrack_url
requirements equinox jax numpy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
########
interpax
########
|License| |DOI| |Issues| |Pypi|

|Docs| |UnitTests| |Codecov|

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`:

.. code-block:: console

    pip install interpax



Usage
=====

.. code-block:: python

    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 <https://interpax.readthedocs.io/en/latest/api.html>`__


.. |License| image:: https://img.shields.io/github/license/f0uriest/interpax?color=blue&logo=open-source-initiative&logoColor=white
    :target: https://github.com/f0uriest/interpax/blob/master/LICENSE
    :alt: License

.. |DOI| image:: https://zenodo.org/badge/706703896.svg
    :target: https://zenodo.org/doi/10.5281/zenodo.10028967
    :alt: DOI

.. |Docs| image:: https://img.shields.io/readthedocs/interpax?logo=Read-the-Docs
    :target: https://interpax.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation

.. |UnitTests| image:: https://github.com/f0uriest/interpax/actions/workflows/unittest.yml/badge.svg
    :target: https://github.com/f0uriest/interpax/actions/workflows/unittest.yml
    :alt: UnitTests

.. |Codecov| image:: https://codecov.io/github/f0uriest/interpax/graph/badge.svg?token=MB11I7WE3I
    :target: https://codecov.io/github/f0uriest/interpax
    :alt: Coverage

.. |Issues| image:: https://img.shields.io/github/issues/f0uriest/interpax
    :target: https://github.com/f0uriest/interpax/issues
    :alt: GitHub issues

.. |Pypi| image:: https://img.shields.io/pypi/v/interpax
    :target: https://pypi.org/project/interpax/
    :alt: Pypi

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/f0uriest/interpax",
    "name": "interpax",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "interpolation spline cubic fourier approximation",
    "author": "Rory Conlin",
    "author_email": "wconlin@princeton.edu",
    "download_url": "https://files.pythonhosted.org/packages/01/8a/41de5b0c8ef271d3dd667b5eeb1b0c61d563c368e8e9683f74a9498d0fc0/interpax-0.3.1.tar.gz",
    "platform": null,
    "description": "\n########\ninterpax\n########\n|License| |DOI| |Issues| |Pypi|\n\n|Docs| |UnitTests| |Codecov|\n\ninterpax is a library for interpolation and function approximation using JAX.\n\nIncludes methods for nearest neighbor, linear, and several cubic interpolation schemes\nin 1d, 2d, and 3d, as well as Fourier interpolation for periodic functions in\n1d and 2d.\n\nComing soon:\n- Spline interpolation for rectilinear grids in N-dimensions\n- RBF interpolation for unstructured data in N-dimensions\n- Smoothing splines for noisy data\n\n\nInstallation\n============\n\ninterpax is installable with `pip`:\n\n.. code-block:: console\n\n    pip install interpax\n\n\n\nUsage\n=====\n\n.. code-block:: python\n\n    import jax.numpy as jnp\n    import numpy as np\n    from interpax import interp1d\n\n    xp = jnp.linspace(0, 2 * np.pi, 100)\n    xq = jnp.linspace(0, 2 * np.pi, 10000)\n    f = lambda x: jnp.sin(x)\n    fp = f(xp)\n\n    fq = interp1d(xq, xp, fp, method=\"cubic\")\n    np.testing.assert_allclose(fq, f(xq), rtol=1e-6, atol=1e-5)\n\n\nFor full details of various options see the `API documentation <https://interpax.readthedocs.io/en/latest/api.html>`__\n\n\n.. |License| image:: https://img.shields.io/github/license/f0uriest/interpax?color=blue&logo=open-source-initiative&logoColor=white\n    :target: https://github.com/f0uriest/interpax/blob/master/LICENSE\n    :alt: License\n\n.. |DOI| image:: https://zenodo.org/badge/706703896.svg\n    :target: https://zenodo.org/doi/10.5281/zenodo.10028967\n    :alt: DOI\n\n.. |Docs| image:: https://img.shields.io/readthedocs/interpax?logo=Read-the-Docs\n    :target: https://interpax.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation\n\n.. |UnitTests| image:: https://github.com/f0uriest/interpax/actions/workflows/unittest.yml/badge.svg\n    :target: https://github.com/f0uriest/interpax/actions/workflows/unittest.yml\n    :alt: UnitTests\n\n.. |Codecov| image:: https://codecov.io/github/f0uriest/interpax/graph/badge.svg?token=MB11I7WE3I\n    :target: https://codecov.io/github/f0uriest/interpax\n    :alt: Coverage\n\n.. |Issues| image:: https://img.shields.io/github/issues/f0uriest/interpax\n    :target: https://github.com/f0uriest/interpax/issues\n    :alt: GitHub issues\n\n.. |Pypi| image:: https://img.shields.io/pypi/v/interpax\n    :target: https://pypi.org/project/interpax/\n    :alt: Pypi\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Interpolation and function approximation with JAX",
    "version": "0.3.1",
    "project_urls": {
        "Contributing": "https://github.com/f0uriest/interpax/blob/master/CONTRIBUTING.rst",
        "Documentation": "https://interpax.readthedocs.io/",
        "Homepage": "https://github.com/f0uriest/interpax",
        "Issues Tracker": "https://github.com/f0uriest/interpax/issues",
        "Source Code": "https://github.com/f0uriest/interpax/"
    },
    "split_keywords": [
        "interpolation",
        "spline",
        "cubic",
        "fourier",
        "approximation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9b23a7c1edea0c673ceac48dcb60d8b56ce1f932701beb93282a7ff25b4dcea9",
                "md5": "825441e2ad83bc02cd916edf5950d223",
                "sha256": "09bfeb5135f2f793c6c1306c0fc3b92e7e880d7de865770e84e54587108a6f4a"
            },
            "downloads": -1,
            "filename": "interpax-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "825441e2ad83bc02cd916edf5950d223",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 26633,
            "upload_time": "2024-03-06T00:48:08",
            "upload_time_iso_8601": "2024-03-06T00:48:08.743988Z",
            "url": "https://files.pythonhosted.org/packages/9b/23/a7c1edea0c673ceac48dcb60d8b56ce1f932701beb93282a7ff25b4dcea9/interpax-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "018a41de5b0c8ef271d3dd667b5eeb1b0c61d563c368e8e9683f74a9498d0fc0",
                "md5": "d37d62894b6bf366db230cd89e52251c",
                "sha256": "c9d4ece484f4e5fe1310d9c455115b05424cfa55a3bb4de11f81c535454247e6"
            },
            "downloads": -1,
            "filename": "interpax-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d37d62894b6bf366db230cd89e52251c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 55928,
            "upload_time": "2024-03-06T00:48:09",
            "upload_time_iso_8601": "2024-03-06T00:48:09.992826Z",
            "url": "https://files.pythonhosted.org/packages/01/8a/41de5b0c8ef271d3dd667b5eeb1b0c61d563c368e8e9683f74a9498d0fc0/interpax-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-06 00:48:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "f0uriest",
    "github_project": "interpax",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "equinox",
            "specs": [
                [
                    "<",
                    "0.12"
                ],
                [
                    ">=",
                    "0.11"
                ]
            ]
        },
        {
            "name": "jax",
            "specs": [
                [
                    ">=",
                    "0.3.2"
                ],
                [
                    "<",
                    "0.5.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.20.0"
                ],
                [
                    "<",
                    "2.0"
                ]
            ]
        }
    ],
    "lcname": "interpax"
}
        
Elapsed time: 0.19964s