wolph / numpy-stl

Simple library to make working with STL files (and 3D objects in general) fast and easy.
http://numpy-stl.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
628 stars 107 forks source link

Debug tuple print of np.float #224

Open tbaudier opened 1 month ago

tbaudier commented 1 month ago

Debug https://github.com/wolph/numpy-stl/issues/223

With numpy>=2.0.0, tuple(vectors[0]) returns the type of the number (eg: np.float64()) instead of the number.

Adding .tolist() to the vector converts the vector to a python list and could be printed.

Work also with numpy <2.0.0

wolph commented 3 weeks ago

I'm testing whether this works in both cases. I can't just drop numpy 1.x any time soon :)

Thank you so much for the pull request though! Even if it doesn't work in both cases, I can simply make the test conditional.