You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [4]: plt.imshow(np.random.randint(-128, 128, dtype=np.int8, size=(3, 3)))
Out[4]: <matplotlib.image.AxesImage at 0x7fe00ba2f0f0>
In [5]: /usr/lib/python3.5/site-packages/matplotlib/colors.py:848: RuntimeWarning: overflow encos
resdat /= (vmax - vmin)
and a fully black image appears.
Pretty sure this is due to #6700 and can be fixed by restoring the casts of vmin and vmax to a floating type. However that type should be determined as in process_value (i.e., np.float32 if dtype.itemsize <= 2 else np.promote_types(dtype, float) -- see the issue for the discussion).
Not making a PR yet because this (as well as the original #6700) may or may not affect the other Normalize classes too? Perhaps that's something that should be factored out.
@anntzer, it looks like a more general solution to these problems is needed, starting with input normalization: float128 should be converted to float64 as early as possible, float32 should be preserved and used when possible, etc. Maybe the thing to do is revert #6700, and develop a more comprehensive solution, which need not block 2.0. Does this make sense to you? And if so, can you lead it?
Activity
efiring commentedon Jul 25, 2016
@anntzer, it looks like a more general solution to these problems is needed, starting with input normalization: float128 should be converted to float64 as early as possible, float32 should be preserved and used when possible, etc. Maybe the thing to do is revert #6700, and develop a more comprehensive solution, which need not block 2.0. Does this make sense to you? And if so, can you lead it?
anntzer commentedon Jul 25, 2016
Sure, I'll give it a try. Continuing the discussion in that thread.
Merge pull request #6837 from anntzer/fix-integer-normalization