Minterpy

Minterpy: multivariate polynomial interpolation in Python - Published in JOSS (2025)

https://github.com/minterpy-project/minterpy

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: scholar.google, joss.theoj.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Scientific Fields

Engineering Computer Science - 40% confidence
Last synced: 6 months ago · JSON representation

Repository

Multivariate polynomial interpolation in Python

Basic Info
Statistics
  • Stars: 8
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Created about 1 year ago · Last pushed 10 months ago
Metadata Files
Readme Changelog Contributing License Authors

README.md

DOI status Code style: black License PyPI

Minterpy: Multivariate Polynomial Interpolation in Python

| Branches | Status | | :-----------------------------------------------------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | main (stable) | Build codecov Documentation Build and Deployment | | dev (latest) | Build codecov Documentation Build and Deployment |

Minterpy is an open-source Python package designed for constructing and manipulating multivariate interpolating polynomials with the goal of lifting the curse of dimensionality from interpolation tasks.

Minterpy is being continuously extended and improved, with new functionalities added to address the bottlenecks involving interpolations in various computational tasks.

Installation

You can obtain the stable release of Minterpy directly from PyPI using pip:

bash pip install minterpy

Alternatively, you can also obtain the latest version of Minterpy from the GitHub repository:

bash git clone https://github.com/minterpy-project/minterpy

Then from the source directory, you can install Minterpy:

bash pip install [-e] .[all,dev,docs]

where the flag -e means the package is directly linked into the python site-packages of your Python version. The options [all,dev,docs] refer to the requirements defined in the options.extras_require section in setup.cfg.

A best practice is to first create a virtual environment with the help of a tool like mamba, conda, venv, virtualenv or pyenv-virtualenv. See CONTRIBUTING.md for details.

NOTE: Do not use the command python setup.py install to install Minterpy, as we cannot guarantee that the file setup.py will always be present in the further development of Minterpy.

Quickstart

Using Minterpy, you can easily interpolate a given function. For instance, take the one-dimensional function $f(x) = x \, \sin{(10x)}$ with $x \in [-1, 1]$:

```python import numpy as np

def test_function(x): return x * np.sin(10*x) ```

To interpolate the function, you can use the top-level function interpolate():

```python import minterpy as mp

interpolant = mp.interpolate(testfunction, spatialdimension=1, poly_degree=64) ```

interpolate() takes as arguments the function to interpolate, the number of dimensions (spatial_dimension), and the degree of the underlying polynomial interpolant (poly_degree). You may adjust this parameter in order to get higher accuracy. The resulting interpolant is a Python callable, which can be used as an approximation of test_function.

In this example, an interpolating polynomial of degree $64$ produces an approximation of test_function to near machine precision:

```python import matplotlib.pyplot as plt

xx = np.linspace(-1, 1, 150)

plt.plot(xx, interpolant(xx), label="interpolant") plt.plot(xx, test_function(xx), "k.",label="test function") plt.legend() plt.show() ```

Compare test function with its interpolating polynomial

Minterpy's capabilities extend beyond function approximation; by accessing the underlying interpolating polynomials, you can carry out common numerical operations on the approximations like multiplication and differentiation:

```python

Access the underlying Newton interpolating polynomial

nwtpoly = interpolant.tonewton()

Multiply the polynomial -> obtained another polynomial

prodpoly = nwtpoly * nwt_poly

Differentiate the polynomial once -> obtained another polynomial

diffpoly = nwtpoly.diff(1)

Reference function for the (once) differentiated test function

diff_fun = lambda xx: np.sin(10 * xx) + xx * 10 * np.cos(10 * xx)

fig, axs = plt.subplots(1, 2, figsize=(10, 5))

axs[0].plot(xx, prodpoly(xx), label="product polynomial") axs[0].plot(xx, fun(xx)**2, "k.", label="product test function") axs[0].legend() axs[0].setxlabel("$x$") axs[0].setylabel("$y$") axs[1].plot(xx, diffpoly(xx), label="differentiated polynomial") axs[1].plot(xx, difffun(xx), "k.", label="differentiated test function") axs[1].legend() axs[1].setxlabel("$x$")

plt.show()
```

Product and differentiated polynomial

The Getting Started Guides provide more examples on approximating functions and performing operations on interpolating polynomials, including multidimensional cases.

Getting help

For detailed guidance, please refer to the online documentation (stable or latest). It includes detailed installation instructions, usage examples, API references, and contributors guide.

For any other questions related to the package, feel free to post your questions on the GitHub repository Issue page.

Contributing to Minterpy

Contributions to Minterpy are welcome!

We recommend you have a look at the CONTRIBUTING.md first. For a more comprehensive guide visit the Contributors Guide of the documentation.

Citing Minterpy

If you use Minterpy in your research or projects, please consider citing the archived version in RODARE.

The citation for the current public version is:

bibtex @software{Minterpy_0_3_0, author = {Hernandez Acosta, Uwe and Thekke Veettil, Sachin Krishnan and Wicaksono, Damar Canggih and Michelfeit, Jannik and Hecht, Michael}, title = {{Minterpy} - multivariate polynomial interpolation}, month = dec, year = 2024, publisher = {RODARE}, version = {v0.3.0}, doi = {10.14278/rodare.3354}, url = {http://doi.org/10.14278/rodare.3354} }

Credits and contributors

This work was partly funded by the Center for Advanced Systems Understanding (CASUS), an institute of the Helmholtz-Zentrum Dresden-Rossendorf (HZDR), financed by Germany’s Federal Ministry of Education and Research (BMBF) and by the Saxony Ministry for Science, Culture and Tourism (SMWK) with tax funds on the basis of the budget approved by the Saxony State Parliament.

The Minterpy development team

Minterpy is currently developed and maintained by a small team at the Center for Advanced Systems Understanding (CASUS):

Mathematical foundation

Former members and contributors

Acknowledgements

License

Minterpy is released under the MIT license.

Owner

  • Name: minterpy-project
  • Login: minterpy-project
  • Kind: organization

JOSS Publication

Minterpy: multivariate polynomial interpolation in Python
Published
May 01, 2025
Volume 10, Issue 109, Page 7702
Authors
Damar Wicaksono ORCID
Center for Advanced Systems Understanding (CASUS) - Helmholtz-Zentrum Dresden-Rossendorf (HZDR), Germany
Uwe Hernandez Acosta ORCID
Center for Advanced Systems Understanding (CASUS) - Helmholtz-Zentrum Dresden-Rossendorf (HZDR), Germany
Sachin Krishnan Thekke Veettil ORCID
Max Planck Institute of Molecular Cell Biology and Genetics, Dresden, Germany
Jannik Kissinger ORCID
Max Planck Institute of Molecular Cell Biology and Genetics, Dresden, Germany, Technische Universität Dresden, Germany
Michael Hecht ORCID
Center for Advanced Systems Understanding (CASUS) - Helmholtz-Zentrum Dresden-Rossendorf (HZDR), Germany, University of Wrocław, Poland
Editor
Juanjo Bazán ORCID
Tags
numerical computing function approximation polynomial interpolation polynomial regression

GitHub Events

Total
  • Create event: 24
  • Release event: 2
  • Issues event: 43
  • Watch event: 8
  • Delete event: 12
  • Issue comment event: 78
  • Push event: 186
  • Pull request event: 40
Last Year
  • Create event: 24
  • Release event: 2
  • Issues event: 43
  • Watch event: 8
  • Delete event: 12
  • Issue comment event: 78
  • Push event: 186
  • Pull request event: 40

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 26
  • Total pull requests: 46
  • Average time to close issues: 13 days
  • Average time to close pull requests: about 3 hours
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 1.35
  • Average comments per pull request: 2.13
  • Merged pull requests: 44
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 26
  • Pull requests: 46
  • Average time to close issues: 13 days
  • Average time to close pull requests: about 3 hours
  • Issue authors: 1
  • Pull request authors: 3
  • Average comments per issue: 1.35
  • Average comments per pull request: 2.13
  • Merged pull requests: 44
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • damar-wicaksono (26)
Pull Request Authors
  • damar-wicaksono (42)
  • xuanxu (2)
  • szabo137 (2)
Top Labels
Issue Labels
documentation (15) bug (12) joss (9) enhancement (8) ci/cd (4)
Pull Request Labels
bug (24) documentation (22) enhancement (16) ci/cd (6) joss (4)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 39 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
pypi.org: minterpy

Python library for multivariate polynomial interpolation.

  • Versions: 3
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 39 Last month
Rankings
Dependent packages count: 6.6%
Average: 18.7%
Downloads: 18.8%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 6 months ago