| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
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. |
Sorry, something went wrong.
|
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:
|
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
|
There is no float128 on windows? |
Sorry, something went wrong.
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.)
|
Apparently not... https://mail.scipy.org/pipermail/scipy-dev/2008-March/008562.html |
Sorry, something went wrong.
|
It looks like the single value branch of the process_value method needs the same sort of logic as the array branch. I think it will currently cast a single float128 to a possibly shorter float leading to the same issue. |
Sorry, something went wrong.
|
Actually both branches probably need it, right? |
Sorry, something went wrong.
|
The array branch only casts to it if it is not a float type, otherwise we just copy. |
Sorry, something went wrong.
|
I see. I guess the whole process_value method could be simplified to def process_value(value):
is_scalar = not cbook.iterable(value)
if is_scalar:
value = [value]
dtype = np.min_scalar_type(value)
dtype = (np.float32 if dtype.itemsize <= 2
else np.promote_types(dtype, float))
result = np.ma.array(value, dtype=dtype, copy=True)
return result, is_scalar
right? |
Sorry, something went wrong.
|
Yes, I think so. |
Sorry, something went wrong.
|
done. |
Sorry, something went wrong.
|
👍 LGTM pending appveyor |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
…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.
|
@efiring @WeatherGod @tacaswell |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.)
See #6698.