[SciPy-user] Polynomial interpolation

Ed Rahn ed at lamedomain.net
Mon Apr 28 16:23:29 EDT 2008


If the functionality of krogh_ev is useful, why not put it in a method?

A compatibility module is a very good idea. But a concern with that is 
one of documentation. If I am a new user to both scipy and the 
splrep/splev library, I will be confused with which calling convention 
is best. As a developer more external explanation is needed and more 
code needs to be commented.

More tests also need to be written to ensure full code coverage.

- Ed


Anne Archibald wrote:
> 2008/4/28 Robert Kern <robert.kern at gmail.com>:
>> On Mon, Apr 28, 2008 at 12:17 PM, Gael Varoquaux
>>
>> <gael.varoquaux at normalesup.org> wrote:
>>
>>>  I am not suggesting to make a bad design choice, or to go
>>  >  out of our way, I just want a two liner helper function.
>>
>>  I'm afraid that *is* widely recognized as a bad design choice.
> 
> Well, I think the way to go is to mimic splrep/splev:
> 
> def krogh_rep(xi, yi):
>     return KroghInterpolator(xi, yi)
> def krogh_ev(kr, x, der=0):
>     if der==0:
>         return kr(x)
>     else:
>         return kr.derivative(x, der=der)
> 
> The only danger is that if it ever raises an exception and the users
> see how simple it is they will feel like idiots.
> 
> Anne
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
> 



More information about the SciPy-User mailing list