Further simplify colormap reversal. #14679
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of implementing reversal of colormaps in the various formats
in
_cm
and_cm_listed
, we can just rely on Colormap.reversed() to dothe job...
revcmap
was a public helper to a private function(
_reverse_cmap_spec
) so I'm not too worried with deprecating it. Theprivate
_reverser
gets deprecated rather than deleted becauserevcmap
depends on it.The
cmapname
toplevel variable used to leak out of the loop; I deletedit without deprecation or notice and moved cmap generation to a private
function to avoid such leakage.
The
datad
global now no longer contains "unconverted" entries forreversed cmaps (as not generating them is the whole point of the PR...);
I'm not even sure it's worth an API note...
Followup to #14674 (when I wrote #14674 I didn't realize this could be made much simpler).
PR Summary
PR Checklist