[SciPy-Dev] GSoC'15 Idea: Approximation with Parametric Splines

Evgeni Burovski evgeny.burovskiy at gmail.com
Mon Mar 9 12:30:33 EDT 2015


Dear Anastasiia,

It's nice to see an interest in improving scipy interpolation capabilities.

It seems that your proposal has several components.

First, you propose to write an interactive front-end to building
splines and manipulating control points etc. This would definitely be
very interesting and useful. Especially if it carries minimal
dependencies, matplotlib only or IPython widgets ---This way it does
not require a user to install a heavy-weight library like Qt.
Something similar to, for example,
<https://github.com/Pybonacci/bezierbuilder/blob/master/bezierbuilder.py>
for Bezier curves (this is only one example from a quick search on
github, I'm sure there are others). One challenge here would be to
somehow make sure the code is placed somewhere when it can be found by
prospective users later on --- I'm sure there are/were multiple
attempts at writing such a front-end, but I'm not even sure how to
start looking for one. So if you write one, let this list know!

One large-ish issue with such a front-end and scipy is that a
graphical front-end is likely out of scope for scipy :-(.

Second, you seem to propose to implement B-spline evaluation routines
in cython instead of fortran routines we currently wrap from fitpack.
For one,  there is at least one C implementation in scipy,
<https://github.com/scipy/scipy/blob/master/scipy/interpolate/src/__fitpack.h#L894>.
Surely, this makes a fun exercise implementing it, and I myself am
certainly guilty of having a bit of fun implementing it in Cython (eg
https://github.com/ev-br/scipy/commit/eefa0b4a227a87c2dfce00df884135043ea9b24c)
but FWIW at least that particular implementation did not offer any
advantages over the C one from __fitpack.h.
Overall, I do not see a month of work here.

Third, you mention that you plan on looking into methods of optimizing
the control points for spline fitting. This is, in my opinion, the
most interesting (and hardest!) part. If implemented in a transparent
way (as opposed to being hidden in an ingenious Fortran code of Prof
Dierckx), this could be a very welcome addition to scipy.interpolate.
I would guess ideally we'd have several algorithms --- De Boor's
NEWKNOT, a reimplementation of Dierckx's algorithm from FITPACK, more
recent algorithms --- and have them decoupled from representation and
manipulation of b-spline objects themselves. As far as I understand,
all these automatic fitting routines have their failure modes, so it
could be nice to give a user  a reasonable degree of control over the
at least the choice of the fitting routine. Can you elaborate on what
sort of ideas you have in this respect?

Several possible alternatives:

* regular grid interpolators in higher dimensions. This is what Pauli
wrote in the GSoc idea on interpolation
* Tensor product splines. In there a first step would be to actually
implement the basic object. An inspiration for UI could be Pauli's n-d
piecewise polynomial class, https://github.com/scipy/scipy/pull/3104
* Cardinal splines. Again, a first step is to implement the basic
functionality, and remove duplication with scipy.signal

All in all, I think your proposal could and should be improved.
I've listed several alternatives above, but don't take this as a
discouragement and/or a prescription of what to do. I encourage you to
revise your proposal and send a revised proposal to this list.

All the best,

Evgeni




On Sun, Mar 8, 2015 at 9:25 AM, Anastasiia Tsyplia
<anastasiyatsyplya at gmail.com> wrote:
> Hello,
>
> My name is Anastasiia Tsyplia. I am a 5th-yaer student of National Mining
> University of Ukraine.
>
> I am keen on interpolation/approximation with splines and it was a nice
> surprise to find out that there is a demand in interpolation improvements
> amongst the Scipy's ideas for GSoC'15. However, I've spend some time on
> working out the idea of my own.
>
> Recently I've made a post dedicated to description of the parametric spline
> curves construction process and approaches to approximate engineering data
> by spline functions and parametric spline curves with SciPy.
>
> It seems that using parametric spline curves in approximation can be
> extremely useful and time-saving approach. That's why I would like to share
> my project idea and hope to hear some feedback as I am about to make a
> proposal for the Google Summer of Code.
>
> I have a 2-year experience in programming with Python, PyOpengl, PyQt,
> Matplotlib, Numpy & SciPy. Some time I spent to dive into ctypes and
> scratched the surface of C. Now my priority is Cython. I've read the book on
> the spline methods recommended on SciPy's idea page, so I feel myself
> competent in spline methods. I feel free with recursions: the last challenge
> I faced was implementation of binary space partitioning algorithm in python
> as I was writing my own ray-tracer.
>
> I would like to contribute to SciPy by any means, so I'm ready to receive
> instructions on my next move. And, certainly I'm looking forward to start
> dealing with B-Splines in Cython as it is also a part of my project idea.
>
>
> Thanks in advance,
>
> Looking forward to receive the feedback,
>
> Anastasiia Tsyplia
>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>



More information about the SciPy-Dev mailing list