suppress UserWarning

Gustavo Goretkin gustavo.goretkin at gmail.com
Mon Apr 11 03:30:43 EDT 2016


I should be clear, that the warning message changes each time, because the 
file name is different each time, so the warning module doesn't know it's 
the same warning
https://github.com/scikit-image/scikit-image/blob/bfb6175485afc929ba2ee6f1ba73013f8fa98731/skimage/io/_io.py#L132

For anyone else searching, these warnings are using the general python 
`warnings` module, and that this works to suppress the warning.

                with warnings.catch_warnings():
                    warnings.simplefilter("ignore")
                    skimage.io.imsave


On Monday, April 11, 2016 at 3:07:55 AM UTC-4, Gustavo Goretkin wrote:
>
> I'm on skimage.__version__ '0.12.3' and I see warnings like
>
> `UserWarning: test.png is a low contrast image`
>
> and it gets printed every time, not just once. How can I suppress this 
> warning? I am not even sure if skimage is responsible for printing this.
>
> Thanks,
> Gustavo
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160411/e1555708/attachment.html>


More information about the scikit-image mailing list