[SciPy-dev] Patch: Add 'insert' method to fitpack.py (in scipy.interpolate)

John Travers jtravs at gmail.com
Tue Jan 30 06:18:36 CST 2007

On 30/01/07, Zachary Pincus <zpincus at stanford.edu> wrote:
> Hello,
> In the fortran fitpack library (aka ddierckx) that underlies
> scipy.interpolate, an insert.f function is provided to insert new
> knots into a given spline.
> Attached is a patch which exposes this function to python via the low-
> level fitpack.py interface. This patch properly handles both regular
> and parametric splines, and allows a 'knot multiplicity' to be
> specified so that a given knot can be inserted multiple times (which
> can be handled more efficiently in the c-level code than in python-
> level code).
> The inclusion of this function will make it easy to, among other
> things, convert a b-spline into a Bezier curve (useful for plotting
> purposes). (This can be accomplished by inserting new knots at the
> current knot points until each knot has a multiplicity equal to the
> spline degree.)
> I hope the patch will prove useful,

Thanks for the contribution! I've committed it to subversion.
I have only checked that it compiles and doesn't break anything. I'll
add a test case later.

More information about the Scipy-dev mailing list