Closed Christopher-Chianelli closed 3 months ago
Tried float(value.doubleValue())
, but that also have the conversion error, which means we cannot really fix the issue without fixing it upstream in JPype.
Tried
float(value.doubleValue())
, but that also have the conversion error, which means we cannot really fix the issue without fixing it upstream in JPype.
So is this PR a fix or not? And if not, please link the upstream issue.
Tried
float(value.doubleValue())
, but that also have the conversion error, which means we cannot really fix the issue without fixing it upstream in JPype.So is this PR a fix or not? And if not, please link the upstream issue.
The issue still reproduces, but is much more rare with this PR (issue is, type(JDouble) != type(float)
, hence the test failures)
Exact location of the bug (where the value suddenly change to an unexpected value) is unknown.
Need further investigation.
Found an alternative solution: not using a distance map avoids the issue (w/o a performance cost)
When testing VRP, it was discovered that occasionally, the location, represented as a pair of floats, was converted incorrectly.
It appears JPype's float conversion for Number is inconsistent, so we use Number.doubleValue() instead, which seems to consistency convert correctly.
Ideally,
test_float.test_use_64_bits
or the other float tests would have catch it, but somehow, those tests never failed; the exact condition for incorrect conversion is unknown.