Change spectral to nipy_spectral, update docs, leave aliases #1127

Merged
merged 3 commits into from Mar 23, 2013

Projects

None yet

5 participants

Contributor

For #879, rename spectral to nipy_spectral (to distinguish from Spectral). Leave spectral as an alias, and spectral() as a shortcut, but only in footnotes.

Contributor

Check my docstring formatting. I used

:func:`spectral`

and

 `set_cmap('nipy_spectral')`

for instance. not sure if that's right for functions

Member

I think you need double backquotes for the set_cmap call example, but that is completely from memory.

@dmcdougall dmcdougall and 1 other commented on an outdated diff Aug 21, 2012
lib/matplotlib/_cm.py
@@ -342,7 +343,7 @@ def gfunc32(x):
'green': ((0., 0., 0.),(1.0, 1.0, 1.0)),
'blue': ((0., 1., 1.),(1.0, 0.5, 0.5))}
-_spectral_data = {'red': [(0.0, 0.0, 0.0), (0.05, 0.4667, 0.4667),
+_nipy_spectral_data = {'red': [(0.0, 0.0, 0.0), (0.05, 0.4667, 0.4667),
(0.10, 0.5333, 0.5333), (0.15, 0.0, 0.0),
(0.20, 0.0, 0.0), (0.25, 0.0, 0.0),
(0.30, 0.0, 0.0), (0.35, 0.0, 0.0),
dmcdougall
dmcdougall Aug 21, 2012 Member

I know it's only aesthetic, but it wouldn't hurt to have all the data line up nicely.

endolith
endolith Aug 21, 2012 Contributor

Oh I was thinking of refactoring the datad assignments into a single dictionary too. These sorts of OCD formatting are welcome? :)

dmcdougall
dmcdougall Aug 21, 2012 Member

Personally, if it makes the code more readable then that's preferred. Ideally, @WeatherGod will weigh in with his PEP8 ninja chops :)

endolith
endolith Aug 21, 2012 Contributor

Well PEP8 says not to align code for readability, but I think common usage disagrees. http://www.python.org/dev/peps/pep-0008/#pet-peeves

Contributor
endolith commented Mar 9, 2013

anything else that needs to be done here?

Member
pelson commented Mar 11, 2013

@NelleV - your feedback on this would be highly valuable if you have a moment?

Contributor
NelleV commented Mar 11, 2013

LGTM 👍

@dmcdougall dmcdougall merged commit b79b55d into matplotlib:master Mar 23, 2013
@endolith endolith deleted the endolith:patch-9 branch Mar 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment