Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
A method added to Colormap classes to reverse the colormap #6211
Conversation
mdboom
added the
needs_review
label
Mar 23, 2016
|
Looking at the Tracis CI test, I understand the pep8 failure (missing a blank line in the test_colors.py) but the other failure I don't understand. Can someone explain that to me? It seems to be unrelated to what I've done in this PR. |
QuLogic
added this to the
2.1 (next point release)
milestone
Mar 23, 2016
|
The other failure is testing against Numpy nightlies, which is known to be broken. It's an optional test, though -- it doesn't cause the whole thing to fail when it fails. |
|
Cc: @efiring |
|
Based on a quick look, I think this looks promising. |
tacaswell
commented on an outdated diff
Mar 26, 2016
tacaswell
commented on an outdated diff
Mar 26, 2016
| @@ -665,6 +665,30 @@ def _resample(self, lutsize): | ||
| """ | ||
| raise NotImplementedError() | ||
| + def reversed(self, name=None): | ||
| + """ | ||
| + Make a reversed instance of the Colormap. | ||
| + | ||
| + NOTE: Function not implemented for base class. | ||
| + | ||
| + Parameters | ||
| + ---------- | ||
| + name : str, optional | ||
| + The name for the reversed colormap. If it's None the | ||
| + name will be the name of the parent colormap + "_r". | ||
| + | ||
| + Raises |
|
|
|
Can you also add a note in |
tacaswell
merged commit 6f27f95
into matplotlib:master
Mar 27, 2016
tacaswell
removed the
needs_review
label
Mar 27, 2016
|
@kjartankg Thanks! I think this is your first contribution to mpl, congratulations! Hope we hear from you again. |
|
Excellent, thanks! I will most likely have a look at some more things. @tacaswell if there's anything specific that needs to be worked on feel free to point me in that direction. Otherwise I will just browse the issues again. |
kjartankg
deleted the
kjartankg:reverse-cm branch
Mar 27, 2016
|
Browsing the issues / fixing itches you encounter day-to-day is the best place to start. |
kjartankg commentedMar 23, 2016
This implements a solution for issue #4271
ListedColormapandLinearSegmentedColormapColormapraisesNotImplementedErrortest_colors.pyThis PR succeeds PR #5899. Following is the initial comment copy/pasted from the previous PR:
A few things that I ran into while implementing this: