-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Don't convert vmin, vmax to floats. #6700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't convert vmin, vmax to floats. #6700
Conversation
I suspect it would make more sense to just convert the float128 input to float64 at an early stage. The conversion will occur sooner or later anyway; we have no mechanism for maintaining float128 throughout the pipeline, and that level of precision makes no sense for plotting anyway. |
Eventually, everything needs to become float-like. The purpose of casting On Wed, Jul 6, 2016 at 3:34 PM, Antony Lee notifications@github.com wrote:
|
See also #6677 for @efiring's suggestion (which I agree with -- similar bugs with handling float128's probably occur at a bunch of other places). However I'd rather keep this simple solution for now and have a separate discussion for making the switch to float64 (or even float32, which is certainly enough for plotting purposes) everywhere at the same time. PS: The failure on Travis seems spurious. |
There is no float128 on windows? |
They may be float128's in which case precision would be lost; this can result in `Normalize` returning values (barely) outside of `[0, 1]`. (The cast to `float` was introduced in 28e1d2, referring to bug 2997687 on SF; it may be worth checking what it was about.)
a49ac62
to
16f9778
Compare
Apparently not... https://mail.scipy.org/pipermail/scipy-dev/2008-March/008562.html |
It looks like the single value branch of the |
Actually both branches probably need it, right? |
The array branch only casts to it if it is not a float type, otherwise we just copy. |
I see. I guess the whole
right? |
Yes, I think so. |
done. |
👍 LGTM pending appveyor |
Regarding float128 it's not actually 128 bytes but a long double which is padded to 128 bits http://docs.scipy.org/doc/numpy-dev/user/basics.types.html On Linux and OSX long doubles are normally 80 bits but on windows (MSVC) they are equivalent to doubles. They may have more precision on other less common platforms. |
…loat FIX: Don't convert vmin, vmax to floats in norm Conflicts: lib/matplotlib/colors.py Kept version from master. Conflicts due to maskedarray name normalization.
backported to v2.x as c7d7d19 |
@efiring @WeatherGod @tacaswell |
They may be float128's in which case precision would be lost; this can
result in
Normalize
returning values (barely) outside of[0, 1]
.(The cast to
float
was introduced in 28e1d2, referring to bug 2997687on SF; it may be worth checking what it was about.)
See #6698.