Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test extract_cells_by_type() failing on 32-bit arches: Expecting a numpy.int32 array, got int64 instead. #1154

Open
drew-parsons opened this issue Jul 7, 2024 · 2 comments

Comments

@drew-parsons
Copy link

vedo 2024.5.2 tests are failing on 32-bit architectures in debian tests.
The failure is in extract_cells_by_type() from common tests test_core2.py

517s --- TEST METHOD extract_cells_by_type() -------------------
517s           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
517s   File "/usr/lib/python3/dist-packages/vedo/grids.py", line 634, in extract_cells_by_type
517s     uarrtyp = utils.numpy2vtk(ctarrtyp, deep=False, dtype="id")
517s               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
517s   File "/usr/lib/python3/dist-packages/vedo/utils.py", line 778, in numpy2vtk
517s     varr = numpy_to_vtkIdTypeArray(arr.astype(np.int64), deep=deep)
517s            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
517s   File "/usr/lib/python3/dist-packages/vtkmodules/util/numpy_support.py", line 191, in numpy_to_vtkIdTypeArray
517s     raise ValueError(
517s ValueError: Expecting a numpy.int32 array, got int64 instead.

numpy2vtk in vedo/utils.py explicitly requests np.int64, which I presume is causing the error.
Should it use simple python int instead?

Full test logs are available at
armel https://ci.debian.net/packages/v/vedo/testing/armel/48706152/
armhf https://ci.debian.net/packages/v/vedo/testing/armhf/48706220/
i386 https://ci.debian.net/packages/v/vedo/testing/i386/48705992/
https://ci.debian.net/packages/v/vedo/

This is with vtk 9.3.0 and numpy 1.26.4.

marcomusy added a commit that referenced this issue Jul 11, 2024
@marcomusy
Copy link
Owner

Thanks for reporting! I just committed a fix, but I guess that the simple python int should also do the trick...

@drew-parsons
Copy link
Author

Great, I'll apply your patch to keep the codebase consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants