- Notifications
You must be signed in to change notification settings - Fork85
Open
Description
As of June 16, numpy 2.0.0 was released with breaking changes regarding the handling of out of bounds values when casting. This breaks the below line since python's native hash function can output out of bound values:
datahash=np.uint64(hash(str(raster.data.get()))) |
2024-06-18T22:51:25.961ZFile "/usr/local/lib/python3.10/dist-packages/xrspatial/viewshed.py", line 1663, in viewshed2024-06-18T22:51:25.961Zreturn viewshed_gpu(raster, x, y, observer_elev, target_elev)2024-06-18T22:51:25.961ZFile "/usr/local/lib/python3.10/dist-packages/xrspatial/gpu_rtx/viewshed.py", line 280, in viewshed_gpu2024-06-18T22:51:25.961Zscale = create_triangulation(raster, optix)2024-06-18T22:51:25.961ZFile "/usr/local/lib/python3.10/dist-packages/xrspatial/gpu_rtx/mesh_utils.py", line 7, in create_triangulation2024-06-18T22:51:25.961Zdatahash = np.uint64(hash(str(raster.data.get())))2024-06-18T22:51:25.961ZOverflowError: Python integer -2413162623232959393 out of bounds for uint64
The easy workaround for now is to pin the local numpy version to 1.26.4, but it might be a good idea to a) add this to readme/dependencies for now, and/or b) move to a better hash function that does not result in negative numbers.