[SciPy-user] Interpolation/Documentation woes...

Travis Oliphant oliphant at ee.byu.edu
Mon Dec 9 19:58:43 EST 2002


> Just this:
>
>              import scipy
>              from scipy.interpolate import splrep, splev, splint
>              tck = splrep(xvals, hvals)
>              spline = [ splev(p, tck) for p in xvals]
>

Note, that splev should accept xvals (i.e. you shouldn't have to do the
list comprehension)

spline = splev(xvals, tck)

should work fine.

Try

info(interpolate)

to get an overview of the interpolate package.

Try

info(scipy)

to get an overview of scipy


In other words, you can use the interactive help to get started with the
package.  Yes docs are important, but there are ways to get help with self
documenting code.

Another command you may find useful is source.

This will list the Python source code of a method or function.

>
> Well, I could. But I wanted to get an overview of the package, not just an
> individual command. This 'info' sounds useful, but I think a complete set
> of docs is just as important, since that's how newbies (like me) learn
> what's possible in broad terms. The 'info' command sounds more useful when
> you know what you want to do, you just need to be reminded of the arglist,
> or that optional parameter that you rarely use.

Again, try using info on a module for more uses.

> > > Readable docs are important in my opinion. Is this a problem with other
> > > packages too? Perhaps we can come up with a script to fix it SciPy-wide.
> >
> >I think everybody agrees with you.  But, I don't think everybody uses
> >HappyDoc and therefore doesn't see this problem.  It would be nice if
> >there were a pre-filter that could be used before HappyDoc so that the
> >docstrings don't actually have to be changed.
>
> I'm still learning about HappyDoc, so I'm not in a position right now to
> suggest how to deal with this problem. Does SciPy have a standard for
> documentation? (Perhaps 'info' is it?)
>
> I was just trying to do some interpolation, and noticed that performance
> was really poor for small (~0.01 or smaller) y-values, but really good for
> large ones (~10 or more). I'll get back with more precise details once I
> understand better what's going on....
>

You are getting the performance of FITPACK here.  I have not heard
complaints like this before.  Make sure you are using it correctly.


-Travis O.




More information about the SciPy-User mailing list