[SciPy-User] interpolate.sproot -- Warning: the number of zeros exceeds mest

Evgeni Burovski evgeny.burovskiy at gmail.com
Thu Sep 18 12:36:42 EDT 2014


On Sep 18, 2014 6:07 PM, "Nils Wagner" <nils106 at googlemail.com> wrote:
>
> IMHO, this behavior could be improved.
>
> Nils
>
>
> On Thu, Sep 18, 2014 at 3:49 PM, Moore, Eric (NIH/NIDDK) [F] <
eric.moore2 at nih.gov> wrote:
>>
>> From: Nils Wagner [mailto:nils106 at googlemail.com]
>> Sent: Thursday, September 18, 2014 8:52 AM
>> To: SciPy Users List
>> Subject: Re: [SciPy-User] interpolate.sproot -- Warning: the number of
zeros exceeds mest
>>
>> So far I have used
>>
>> from scipy.interpolate import splrep, splev, sproot
>> import warnings
>> warnings.simplefilter("ignore")
>> but the warning message is still there.
>> Am I missing something ?
>>
>> Nils
>>
>> On Thu, Sep 18, 2014 at 2:43 PM, Daπid <davidmenhur at gmail.com> wrote:
>>
>> On 18 September 2014 14:32, Nils Wagner <nils106 at googlemail.com> wrote:
>> How can I suppress the message
>> Warning: the number of zeros exceeds mest
>> Is it possible to throw an exception ?
>>
>> Python's warnings machinery can be used.
>>
>> https://docs.python.org/2/library/warnings.html
>> Using warnings.simplefilter('ignore') you will completely silence the
warning, and using 'error' instead will raise an exception. You may want to
run this in a context, so it doesn't "leak out" on the rest of your program:
>> with warnings.catch_warnings():
>>
>> See examples in the docs.
>>
>> /David.
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
>>
>> It isn't a warning in that sense.  sproot simply calls print. See
https://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack.py#L726
>>
>> Eric
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>


+1 for replacing the print with a normal python warning.
There are several more of them in fitpack.py, all of which could/should be
python warnings.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20140918/2b206fde/attachment.html>


More information about the SciPy-User mailing list