OpenGATE / opengate

Gate 10 (beta)
http://www.opengatecollaboration.org
GNU Lesser General Public License v3.0
44 stars 39 forks source link

np.float_ or np.double ? #394

Open dsarrut opened 5 months ago

dsarrut commented 5 months ago

in opengate/geometry/utility.py” Maybe “np.float_” should be “np.double”. Unsure if related to numpy 2.0 ?

tbaudier commented 5 months ago

For the moment numpy is a rc version for version 2. ITK and pybind still have problem with that version. Check this commit: https://github.com/OpenGATE/opengate/commit/0036491c0d88aa6b25e1ba94b0e23d4af6b742cc

BishopWolf commented 5 months ago

You can test the following

import numpy as np

print(np.finfo(np.longdouble))
print(np.finfo(np.double))
print(np.finfo(np.float_))

you will get:

Therefore, float shall be replaced by float64 if you want 64 bit precision at least, otherwise it's safe to be used Source: https://numpy.org/devdocs/user/basics.types.html