Deprecations and housecleaning #2026

Merged
merged 11 commits into from May 21, 2013

Projects

None yet

3 participants

@mdboom
Member
mdboom commented May 20, 2013

This PR ties up a number of related issues:

  • #1961: All backends should work: This removes Qt3, FltkAgg, and Emf and deprecates CocoaAgg.
  • #1966: Remove deprecated code: This removes a number of smallish APIs that have already been deprecated.
  • #2009: Deprecate the top-level functions in path.py

This also brings over a helper function and decorator originally written by @iguananaut for the astropy project that makes it easier to mark functions as deprecated. This also unifies the interface for deprecated things and makes it easier to search later for things that are due for removal (that should make this kind of PR a little easier next time).

@efiring efiring commented on an outdated diff May 20, 2013
matplotlibrc.template
@@ -24,7 +24,7 @@
#### CONFIGURATION BEGINS HERE
# the default backend; one of GTK GTKAgg GTKCairo GTK3Agg GTK3Cairo
-# CocoaAgg FltkAgg MacOSX QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS
+# CocoaAgg FltkAgg MacOSX Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS
@efiring
efiring May 20, 2013 Matplotlib Developers member

FltkAgg is also removed, so it needs to be deleted from this comment.

@efiring efiring commented on an outdated diff May 20, 2013
doc/users/whats_new.rst
@@ -21,6 +21,16 @@ revision, see the :ref:`github-stats`.
new in matplotlib-1.3
=====================
+
+Housecleaning
+-------------
+
+A number of features that were deprecated in 1.2 or earlier, or have
+not been in a working state for a long time have been removed.
+Highlights in include removing the Qt version 3 backends, and the
@efiring
efiring May 20, 2013 Matplotlib Developers member

Delete "in".

@efiring
Member
efiring commented May 20, 2013

Wow! Thanks for putting all that together. It looks like the test failure with 2.6 is completely unrelated.

@pelson pelson commented on an outdated diff May 21, 2013
lib/matplotlib/cbook.py
+ message = ((message % {
+ 'func': name,
+ 'name': name,
+ 'alternative': alternative,
+ 'obj_type': obj_type,
+ 'since': since}) +
+ altmessage)
+
+ return message
+
+
+def warn_deprecated(
+ since, message='', name='', alternative='', pending=False,
+ obj_type='attribute'):
+ """
+ Used display deprecation warning in a standard way.
@pelson
pelson May 21, 2013 Matplotlib Developers member

Missing to.

@pelson pelson commented on the diff May 21, 2013
lib/matplotlib/cbook.py
+ 'since': since}) +
+ altmessage)
+
+ return message
+
+
+def warn_deprecated(
+ since, message='', name='', alternative='', pending=False,
+ obj_type='attribute'):
+ """
+ Used display deprecation warning in a standard way.
+
+ Parameters
+ ------------
+ since : str
+ The release at which this API became deprecated. This is
@pelson
pelson May 21, 2013 Matplotlib Developers member

"This is required" is not necessary. The lack of "optional" makes this clear.

@pelson pelson commented on an outdated diff May 21, 2013
lib/matplotlib/mpl.py
@@ -2,14 +2,13 @@
.. note:: Deprecated in 1.3
"""
import warnings
-from matplotlib.cbook import mplDeprecation
-warnings.warn(
- "matplotlib.mpl is deprecated and will be removed in version 1.4."
- "Please use `import matplotlib as mpl` instead", mplDeprecation)
+from matplotlib import cbook
+cbook.warn_deprecated(
+ '1.3', 'matplotlib.mpl', alterative='`import matplotlib as mpl`',
@pelson
pelson May 21, 2013 Matplotlib Developers member

Typo on alternative.

@pelson pelson commented on an outdated diff May 21, 2013
lib/matplotlib/rcsetup.py
@@ -20,13 +20,13 @@
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
from matplotlib.colors import is_color_like
-#interactive_bk = ['gtk', 'gtkagg', 'gtkcairo', 'fltkagg', 'qtagg', 'qt4agg',
+#interactive_bk = ['gtk', 'gtkagg', 'gtkcairo', 'qtagg', 'qt4agg',
@pelson
pelson May 21, 2013 Matplotlib Developers member

Shouldn't qtagg be gone too?

@pelson
Member
pelson commented May 21, 2013

@mdboom - I've added a couple of trivial actions. If you just add a commit on top of 85f1966 (or alternatively ammend the last commit, leaving 3dab377 static) I'd be happy to merge this ASAP. This will conflict with #2011 but given the size of this PR, I'm happy to have to resolve that conflict in my PR.

Awesome! I think this is the best PR I've seen on mpl - I'm a big fan of deleting code 😄

@pelson pelson merged commit 3586394 into matplotlib:master May 21, 2013

1 check passed

Details default The Travis CI build passed
@mdboom mdboom deleted the mdboom:deprecations-pre-13 branch Aug 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment