Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Numpy 2.0.0 doesn't allow out of range integers when casting to np.uint64 #803

Open
Assignees
brendancol
Labels
@ehiggins0

Description

@ehiggins0

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp