Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
MAINT deprecated 'spectral' in favor of 'nipy_spectral' #7416
Conversation
NelleV
added this to the
2.0 (style change major release)
milestone
Nov 6, 2016
|
@Carreau Do you want to review? :) |
NelleV
added the
needs_review
label
Nov 6, 2016
Yes :-) The name vas changed in 2012, so I would not be shy as marking as deprecated since at least matplotlib 1.5. You might want to warn on For post 2.0 / Subsequent PRs:
An easy implementation would be to actually remove the data find the dict, and if name==spectral, return |
|
|
|
Yeah, I forgot to look at the documentation and "fix" it… |
|
Sorry I'm slow to review I'm in the train, tethering and the car is shaking quite a bit. |
|
Updated it to deprecate |
|
Looks OK to me. |
| + name="spectral", | ||
| + alternative="nipy_spectral", | ||
| + obj_type="colormap" | ||
| + ) |
Carreau
Nov 7, 2016
Contributor
do you want to make the message dynamic for spectral_r as well ? I can see pros and cons to both.
| from matplotlib._cm import cubehelix | ||
| from matplotlib._cm_listed import cmaps as cmaps_listed | ||
| -cmap_d = dict() | ||
| +cmap_d = _deprecation_datad() |
Carreau
Nov 7, 2016
Contributor
Note that line 88 of this file will likely trigger the deprecation warning if I'm not wrong, as it loop through all the colormap to build the reversed ones. Not sure what we can do about the though. Just pointing it out.
+1. Thanks @NelleV ! |
|
I'm now catching warnings when creating the reverse colormaps to avoid raising the deprecation warning when cm.py is imported (ie, when anyone uses matplotlib). |
|
Do we want to also deprecate |
|
Yes, we should… but how to do this with the function being generated? |
|
https://github.com/matplotlib/matplotlib/blob/v2.x/boilerplate.py#L333 split the list into two (deprecated and not) and make a new template which includes the deprecation warning. |
|
Got it. I'll do that. |
NelleV
added some commits
Nov 6, 2016
|
Should I run boilerplate and commit the function as well or should we wait for the release? |
|
Yes, it's best to keep pyplot in sync with everything else. |
tacaswell
changed the title from
MAINT deprecated 'spectral' in favor of 'nipy_spectral' to [MRG+1] MAINT deprecated 'spectral' in favor of 'nipy_spectral'
Nov 9, 2016
|
Wow, |
|
Should probably just re-run boilerplate after doing the backport. |
efiring
merged commit 660aa65
into matplotlib:master
Nov 10, 2016
efiring
changed the title from
[MRG+1] MAINT deprecated 'spectral' in favor of 'nipy_spectral' to MAINT deprecated 'spectral' in favor of 'nipy_spectral'
Nov 10, 2016
efiring
added a commit
that referenced
this pull request
Nov 10, 2016
|
|
efiring |
f87100a
|
|
backported as f87100a (including the pyplot.py regenerated by boilerplate.py) |
NelleV commentedNov 6, 2016
This raises a deprecation warning for the deprecated "spectral" colormap.
I think I covered all the possible calls to "spectral".
closes #7315