[SciPy-Dev] Multilinear interpolation

Pablo Winant pablo.winant@gmail....
Mon Feb 25 06:04:13 CST 2013


On 21/02/2013 20:25, Robert Kern wrote:
> On Thu, Feb 21, 2013 at 7:04 PM, Pauli Virtanen <pav@iki.fi> wrote:
>> 21.02.2013 21:01, Robert Kern kirjoitti:
>>> On Thu, Feb 21, 2013 at 2:37 PM, Pablo Winant <pablo.winant@gmail.com> wrote:
>>>
>>>> I hesitate between two options that seem be to be used somewhere in
>>>> scipy : Mako templates and code generation via a simple python module.
>>>> Do you have a preference ?
>>> Since we're already using Mako in scipy.interpolate, I would recommend
>>> giving it a try.
>> We're actually not using Mako any more. Using Tempita instead could be
>> better, as that we can bundle with Scipy.
> Sorry, I had an old checkout. Pablo, do check out Tempita, then. It is
> pretty nice:
>
>    http://pythonpaste.org/tempita/

So I made an attempt using tempita in the case of regularly spaced 
grids. For now, it is in a temporary repository in github:

https://github.com/albop/python_interpolation

There is a file multilinear_cython.pyx.in which must be interpreted to 
produce multilinear_cython.pyx . There is also a multilinear.py file 
containing an object oriented wrapper for the compiled routines.

Here is an example:

http://nbviewer.ipython.org/urls/raw.github.com/albop/python_interpolation/master/interpolation.ipynb

Before, I do the same for irregularly spaced grid, I have some questions:
- I included the templates as Python strings in the .pyx.in file . Was 
there a better way ?
- I was not sure about how to deal with single/double precision in the 
cython code.

>
> --
> Robert Kern
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev



More information about the SciPy-Dev mailing list