From c2daee2a306909e38174b9056c1ba8e18fc491d0 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 29 Jan 2017 23:56:49 -0500 Subject: [PATCH 1/2] Fix another datad[cmapname] that didn't exist in master. --- lib/matplotlib/cm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/cm.py b/lib/matplotlib/cm.py index 0df436ab6d04..0384fa4cdc87 100644 --- a/lib/matplotlib/cm.py +++ b/lib/matplotlib/cm.py @@ -83,7 +83,8 @@ def _generate_cmap(name, lutsize): # Generate the reversed specifications ... for cmapname in list(six.iterkeys(datad)): - spec = datad[cmapname] + # Use superclass method to avoid deprecation warnings during initial load. + spec = dict.__getitem__(datad, cmapname) spec_reversed = _reverse_cmap_spec(spec) datad[cmapname + '_r'] = spec_reversed From a8a769d16143d60d44182cd29cf30f7b1f725c32 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 29 Jan 2017 23:57:58 -0500 Subject: [PATCH 2/2] Fix grammar of Vega cmap deprecation message. Once all the parameters are substituted into the warning message, it doesn't make grammatical sense due to some assumptions in the message. --- lib/matplotlib/_cm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/_cm.py b/lib/matplotlib/_cm.py index 2c229c879324..2ea33ed22ebe 100644 --- a/lib/matplotlib/_cm.py +++ b/lib/matplotlib/_cm.py @@ -1384,11 +1384,11 @@ def __getitem__(self, key): "Vega20b_r", "Vega20c", "Vega20c_r"]: warn_deprecated( "2.0", - name="Vega colormaps", - alternative="tab", + name=key, + alternative="tab" + key[4:], obj_type="colormap" ) - + return super(_deprecation_datad, self).__getitem__(key)