Repository navigation
Call _transform_vmin_vmax during SymLogNorm.__init__ - #6780
Conversation
|
👍 Can you also add a test? It does not need to be an image test, just the minimal code that would have raised before. |
|
Not sure where to add that, but I'll look into it. The minimal test should be something like: Edit: I think I've found the spot. |
| normed_vals = norm(vals) | ||
| assert_array_almost_equal(normed_vals, expected) | ||
|
|
||
| # Ensure that a SymLogNorm object can be used in a colorbar |
There was a problem hiding this comment.
This should be it's own test (any function name that starts with test_ will work).
It also needs the @cleanup decorator.
|
❤️ pep8/pycodestyle There is some trailing white space: This may seem petty and annoying, but keeping a consistent style (including no trailing white space) really does help on big projects with many contributors. |
|
Whoops. The perils of not using a proper development environment. |
|
👍 LGTM |
efiring
left a comment
There was a problem hiding this comment.
Apart from the minor suggestion to delete a line from the test, this looks good--it makes sense.
| norm = mcolors.SymLogNorm(0.1, vmin=-1, vmax=1, linscale=1) | ||
| fig = plt.figure() | ||
| cbar = mcolorbar.ColorbarBase(fig.add_subplot(111), norm=norm) | ||
| plt.close(fig) |
There was a problem hiding this comment.
I think this close is unnecessary; the @cleanup decorator handles it, doesn't it?
There was a problem hiding this comment.
It does, but this does not hurt
|
Changed my mind about targeting 2.x . If someone disagrees, I will not protest to it being backported. |
|
It's not critical, but I am mildly in favor of the backport. The change has no effect in most uses, but blocks a potential failure mode. |
|
@efiring Are you going to backport? |
|
Sure, I can do that in a few minutes. |
ENH: Call _transform_vmin_vmax during SymLogNorm.__init__
|
Backported to v2.x as 0ab4599 |
A fix for #6750