[cctbxbb] Deprecation warning?

Graeme.Winter at diamond.ac.uk Graeme.Winter at diamond.ac.uk
Wed Aug 8 03:52:40 PDT 2012


Hi Nat,

Interestingly I added this 

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)

and it did not make the warnings go away… even though I tried both where I import matplotlib and also in the top of the main() routine.

That seems odd to me - any ideas?

Many thanks,

Graeme

On 7 Aug 2012, at 18:49, Nathaniel Echols wrote:

> On Tue, Aug 7, 2012 at 3:04 AM,  <Graeme.Winter at diamond.ac.uk> wrote:
>> Is there a way to avoid this?
>> 
>> Using matplotlib.pyplot.
>> 
>> /Users/graeme/svn/cctbx_plus/base/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/backends/backend_wx.py:1382: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
>>  wxapp = wx.PySimpleApp()
> 
> You can do this:
> 
> import warnings
> warnings.filterwarnings("ignore", category=DeprecationWarning)
> 
> But that's somewhat dangerous.  How are you starting pyplot?  I don't
> get this error when I try something trivial like this:
> 
> nat at clover:~> phenix.wxpython
>>>> import matplotlib.pyplot as plt
>>>> f = plt.figure()
>>>> p = plt.plot([1,2,3],[4,5,6])
>>>> plt.show()
> 
> But if I do this, I get the same warning:
> 
>>>> import wx
>>>> app = wx.PySimpleApp()
> __main__:1: wxPyDeprecationWarning: Using deprecated class.
> 
> So I suspect matplotlib is suppressing the warning somehow.
> Alternately, it looks as though if a wx.App instance has already been
> created, matplotlib will use that instead.
> 
> -Nat
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb


-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 





More information about the cctbxbb mailing list