Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Don't convert vmin, vmax to floats. #6700
Conversation
mdboom
added the
needs_review
label
Jul 6, 2016
|
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? |
tacaswell
added this to the
2.1 (next point release)
milestone
Jul 7, 2016
|
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. |
|
|
|
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. |
tacaswell
modified the milestone: 2.0 (style change major release), 2.1 (next point release)
Jul 12, 2016
tacaswell
merged commit 0346f1a
into matplotlib:master
Jul 12, 2016
tacaswell
removed the
needs_review
label
Jul 12, 2016
anntzer
deleted the
anntzer:dont-cast-normalize-limits-to-float branch
Jul 12, 2016
tacaswell
added a commit
that referenced
this pull request
Jul 12, 2016
|
|
tacaswell |
c7d7d19
|
|
backported to v2.x as c7d7d19 |
This was referenced Jul 12, 2016
|
@efiring @WeatherGod @tacaswell |
anntzer commentedJul 6, 2016
They may be float128's in which case precision would be lost; this can
result in
Normalizereturning values (barely) outside of[0, 1].(The cast to
floatwas introduced in 28e1d2, referring to bug 2997687on SF; it may be worth checking what it was about.)
See #6698.