Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] Deprecate gtk, gdk and wx backends and remove Cocoaagg#6574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

jenshnielsen
Copy link
Member

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

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.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think you need this line; the replacement advice is auto-generated when you supply the alternative kwarg.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

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)

@tacaswelltacaswell modified the milestones:2.1 (next point release),2.0 (style change major release)Jun 12, 2016
@tacaswell
Copy link
Member

@OceanWolf@fariza Can you take a look at this verify that this does not warn on the supported versions of gtk* backends?

@OceanWolf
Copy link
Member

Yay for getting rid of a MacO$ backend that I can't test the backend refactor on! But why don't we deprecateCocoaAgg on the same timeline as the other two rather than immediately removing it now?

I didn't realise thatGTK existed as a separate backend fromGTKAgg andGTKCairo, I always assumed thatGTK aliased toGTKAgg or`GTKCairo``.

P.S. Never heard of FLTK until now ;).

@efiring
Copy link
Member

On 2016/06/13 10:33 AM, OceanWolf wrote:

But why don't we deprecate |CocoaAgg| on the same timeline as the other
two rather than immediately removing it now?

It was never a complete backend, and has been deprecated since 1.3 with
removal scheduled in 1.4, but forgotten. It is highly unlikely that
anyone is using it for anything.

@OceanWolf
Copy link
Member

Ahh, okay, then we have given users plenty of time to migrate away from it.

In terms of testing, I can't get theGTKAgg/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 apython-gtk2 onlypython3-gi.

@fariza do you still use python2, if not I will recompile mpl for python2.

@jenshnielsen
Copy link
MemberAuthor

As far as I know PyGtk2 never supported python3 so the GTK2 backends are python 2 only

@fariza
Copy link
Member

This was the case long time ago, I don't know still the same but I have always thought
Python2 => GTK2
Python3 => GTK3

@OceanWolf
Copy link
Member

Not 100% sure about that...

importgigi.require_version("Gtk","2.0")fromgi.repositoryimportGtkasgtk,Gdkasgdk,GObjectasgobject,GLib,Pangoaspango

gives

/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.

@OceanWolf
Copy link
Member

OceanWolf commentedJun 13, 2016
edited
Loading

Btw, if you want to make it really clear and extra safe you can write:

ifself.__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, withself.__class__ referring to the actual class of the instance.

classParent(object):def__init__(self):print('Setting up Parent',self.__class__)ifself.__class__==Parent:print('I am me')else:print('I am someone else')classChild(Parent):def__init__(self):print('Setting up Child',self.__class__)super(Child,self).__init__()print('--- Creating Parent ---')a=Parent()print('--- Creating Child ---')b=Child()

@tacaswell
Copy link
Member

Suspect this was broken by the six merge

@jenshnielsen
Copy link
MemberAuthor

Closing in favour of#6582

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
v2.0.0
Development

Successfully merging this pull request may close these issues.

6 participants
@jenshnielsen@tacaswell@OceanWolf@efiring@fariza@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp