| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| warn_deprecated('2.0', message="The GDK backend is " | ||
| "deprecated. It is untested, known to be " | ||
| "broken and will be removed in Matplotlib 2.2. " | ||
| "Use the Agg backend instead.", |
There was a problem hiding this comment.
I don't think you need this line; the replacement advice is auto-generated when you supply the alternative kwarg.
Sorry, something went wrong.
There was a problem hiding this comment.
I thought so too but I don't see it without explicitly adding the last line.
This is the warning message from the above as it looks for me
/usr/local/lib/python2.7/site-packages/matplotlib/cbook.py:137: MatplotlibDeprecationWarning: The GTK backend is deprecated. It is untested, known to be broken and will be removed in Matplotlib 2.2. Use the GTKAgg backend instead. warnings.warn(message, mplDeprecation, stacklevel=1)
Sorry, something went wrong.
|
@OceanWolf @fariza Can you take a look at this verify that this does not warn on the supported versions of gtk* backends? |
Sorry, something went wrong.
Update make.py
ttconv: Also replace carriage return with spaces.
|
Yay for getting rid of a MacO$ backend that I can't test the backend refactor on! But why don't we deprecate CocoaAgg on the same timeline as the other two rather than immediately removing it now? I didn't realise that GTK existed as a separate backend from GTKAgg and GTKCairo, I always assumed that GTK aliased to GTKAgg or`GTKCairo``. P.S. Never heard of FLTK until now ;). |
Sorry, something went wrong.
|
On 2016/06/13 10:33 AM, OceanWolf wrote:
It was never a complete backend, and has been deprecated since 1.3 with |
Sorry, something went wrong.
|
Ahh, okay, then we have given users plenty of time to migrate away from it. In terms of testing, I can't get the GTKAgg/Cairo backends to work on python3... a bug? ImportError: Gtk* backend requires pygtk to be installed.`` I look in the debian In debian we don't have a python-gtk2 only python3-gi. @fariza do you still use python2, if not I will recompile mpl for python2. |
Sorry, something went wrong.
|
As far as I know PyGtk2 never supported python3 so the GTK2 backends are python 2 only |
Sorry, something went wrong.
|
This was the case long time ago, I don't know still the same but I have always thought |
Sorry, something went wrong.
|
Not 100% sure about that... import gi
gi.require_version("Gtk", "2.0")
from gi.repository import Gtk as gtk, Gdk as gdk, GObject as gobject, GLib, Pango as pangogives /usr/lib/python3/dist-packages/gi/overrides/Gtk.py:50: RuntimeWarning: You have imported the Gtk 2.0 module. Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail. As such this is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. PyGTK is the recomended python module to use with Gtk 2.0 I can't test further as I don't think _backend_gdk.so builds under python3. |
Sorry, something went wrong.
|
Btw, if you want to make it really clear and extra safe you can write: if self.__class__ == FigureCanvasGTK:
warn.deprecated()I have tested this syntax on both python2.7 and python3.5.1 in __init__ and both do the expected thing, with self.__class__ referring to the actual class of the instance. class Parent(object):
def __init__(self):
print('Setting up Parent', self.__class__)
if self.__class__ == Parent:
print('I am me')
else:
print('I am someone else')
class Child(Parent):
def __init__(self):
print('Setting up Child', self.__class__)
super(Child, self).__init__()
print('--- Creating Parent ---')
a = Parent()
print('--- Creating Child ---')
b = Child() |
Sorry, something went wrong.
|
Suspect this was broken by the six merge |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
I still need to add an api_change note and update the documentation to reflect the deprecation.
The inheritance between the various Gtk backends is a bit complicated but this solution correctly prints the deprecation warning when using the Gtk and Gdk backends but not the GtkAgg og GtkCairo backends.
I also removed some references to the long since removed fltk and emf backends
Fixes #6541