[SciPy-Dev] replace print by custom Warnings

josef.pktd at gmail.com josef.pktd at gmail.com
Sat Apr 30 10:15:45 EDT 2011


On Thu, Apr 28, 2011 at 2:52 PM,  <josef.pktd at gmail.com> wrote:
> On Wed, Apr 27, 2011 at 2:05 PM, Robert Kern <robert.kern at gmail.com> wrote:
>> On Wed, Apr 27, 2011 at 09:56,  <josef.pktd at gmail.com> wrote:
>>> should scipy get additional custom warnings instead of print statements ?
>>>
>>> eg. InterpolationWarning, OptimizationWarning, ....
>>
>> Is that a volunteer I smell?  :-)
>
> I'm currently not smelly enough :), but I created
> http://projects.scipy.org/scipy/ticket/1428
>
> (
> However, after trying for a few hours yesterday, I managed to
> authenticate with github so I can push something there.
> git(gui) is kind of fun, at least for bugfixes.
> )
>
> Josef
>
>>
>> Yes, these print statements should become warnings wherever possible.

A first attempt, just to get started

https://github.com/josef-pkt/scipy/commit/548a8925c36c2627f0acb8102a835393deeefe26

in optimization, do we drop the disp option for warnings and the
associated prints ? there still remains the final print for success.

Is there a way to set the default warning level for the UserWarning to
"always" ?

Still needs tests, examples that raise the warnings.

(I'm only partially familiar with the internal details of
scipy.optimize, interpolate, ... )

Josef



>>
>> --
>> Robert Kern
>>
>> "I have come to believe that the whole world is an enigma, a harmless
>> enigma that is made terrible by our own mad attempt to interpret it as
>> though it had an underlying truth."
>>   -- Umberto Eco
>> _______________________________________________
>> 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