Package: minterpy
minterpyto minterpy *sth.* (transitive verb) -- to produce a multivariate polynomial representation of *sth.* .— The minterpy developers in["Lifting the curse of dimensionality"](https://interpol.pages.hzdr.de/minterpy/fundamentals/introduction.html)minterpyis an open-source Python package for a multivariate generalization
of the classical Newton and Lagrange interpolation schemes as well as related tasks.
It is based on an optimized re-implementation of
the multivariate interpolation prototype algorithm (MIP) by Hecht et al.^1and thereby provides software solutions that lift the curse of dimensionality from interpolation tasks.
While interpolation occurs as the bottleneck of most computational challenges,minterpyaims to free empirical sciences from their computational limitations.minterpyis continuously extended and improved
by adding further functionality and modules that provide novel digital solutions
to a broad field of computational challenges, including but not limited to:multivariate interpolationnon-linear polynomial regressionnumerical integrationglobal (black-box) optimizationsurface level-set methodsnon-periodic spectral partial differential equations (PDE) solvers on
flat and complex geometriesmachine learning regularizationdata reconstructioncomputational solutions in algebraic geometryInstallationSince this implementation is a prototype,
we currently only provide the installation by self-building from source.
We recommend to usinggitto get theminterpysource:gitclonehttps://gitlab.hzdr.de/interpol/minterpy.gitWithin the source directory,
you may use the following package manager to installminterpy.A best practice is to create a virtual environment forminterpy.
You can do this with the help ofcondaand theenvironment.yamlby:condaenvcreate-fenvironment.yamlA new conda environment calledminterpyis created.
Activate the new environment by:condaactivateminterpyFrom within the environment, install theminterpyusingpip,pipinstall[-e].[all,dev,docs]where the flag-emeans 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 theoptions.extras_requiresection insetup.cfg.Youmust notuse the commandpython setup.py installto installminterpy,
as you cannot always assume the filessetup.pywill always be present
in the further development ofminterpy.Finally, if you want to deactivate the conda environment, type:condadeactivateAlternative to conda, you can create a new virtual environment viavenv,virtualenv, orpyenv-virtualenv.
SeeCONTRIBUTING.mdfor details.QuickstartWithminterpyone can easily interpolate a given function.
For instance, take the functionf(x) = x\sin(10x)in one dimension:importnumpyasnpdeftest_function(x):returnx*np.sin(10*x)In order tominterpythe functiontest_functionone can use the top-level functioninterpolate:importminterpyasmpinterpolant=mp.interpolate(test_function,spatial_dimension=1,poly_degree=64)Here, interpolant is a callable function,
which can be used as a representation oftest_function.interpolatetakes as arguments the function to interpolate,
the number of dimensions (spatial_dimension),
and the degree of the underlying polynomial (poly_degree).You may adjust this parameter in order to get higher accuracy.
For the example above, a degree of 64 produces an interpolant that reproduces
thetest_functionalmost up to machine precision:importmatplotlib.pylabaspltx=np.linspace(-1,1,100)plt.plot(x,interpolant(x),label="interpolant")plt.plot(x,test_function(x),"k.",label="test function")plt.legend()plt.show()For more comprehensive examples, see thegetting started guidessection of theminterpydocs.TestingAfter installation, we encourage you to at least run the unit tests ofminterpy,
where we usepytestto run the tests.If you want to run all tests, type:pytest[-vvv]from within theminterpysource directory.Contributing tominterpyContributions to theminterpypackages are highly welcome.
We recommend you have a look at theCONTRIBUTING.mdfirst.
For a more comprehensive contribution guide visit
theContributors sectionof the documentation.Credits and contributorsThis work was partly funded by the Center for Advanced Systems Understanding (CASUS)
that is 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 teamThe core development of theminterpyis currently done
by a small team at the Center for Advanced Systems Understanding (CASUS),
namelyUwe Hernandez Acosta (HZDR/CASUS) (u.hernandez@hzdr.de)Sachin Krishnan Thekke Veettil (HZDR/CASUS) (s.thekke-veettil@hzdr.de)Damar Wicaksono (HZDR/CASUS) (d.wicaksono@hzdr.de)Janina Schreiber (HZDR/CASUS) (j.schreiber@hzdr.de)Mathematical foundationMichael Hecht (HZDR/CASUS) (m.hecht@hzdr.de)Former Members and ContributionsJannik MichelfeitNico Hoffman (HZDR)Steve Schmerler (HZDR)Vidya Chandrashekar (TU Dresden)AcknowledgementKlaus Steiniger (HZDR)Patrick Stiller (HZDR)Matthias Werner (HZDR)Krzysztof Gonciarz (MPI-CBG,CSBD)Attila Cangi (HZDR/CASUS)Michael Bussmann (HZDR/CASUS)CommunityThis package would not be possible without many contributions done
from the community as well.
For that, we want to send big thanks to:the guy who will show me how to include a list of contributors on github/gitlabLicenseMIT© minterpy development team