GLisosurface example fails; error in functions.py

18 views
Skip to first unread message

Jerzy Karczmarczuk

unread,
Dec 3, 2019, 10:50:22 AM12/3/19
to pyqtgraph
Just loaded and tested pyqtgraph included examples. Windows 10, recent Anaconda.

The isosurface plotting example doesn't work, Python reports:

TypeError: only integer scalar arrays can be converted to a scalar index

The error is found in :   ... site-packages\pyqtgraph\functions.py", line 2069, in <listcomp>

    faceTableI[faceTableInds[:,0]] = np.array([triTable[j] for j in faceTableInds])

So, some incompatibility with Numpy...
I try to find the cause, but perhaps somebody knows already the "true" solution? For the moment I see only the surface of the problem,
and I hate to make blind corrections... Here we go.

FaceTableInds is:  [[  1],  [  2],  [  4], [  8] ...],
so the variable j is not integer, but an int *wrapped*, and cannot index triTable, since its shape is (1,)

I replaced triTable[j] by triTable[j[0]]
And I got the yellow, semi-transparent 3D plot,, but, as I said, this is a blind solution...
Thank you.

Jerzy Karczmarczuk
/Caen, France/

Kenneth Lyons

unread,
Dec 3, 2019, 9:22:07 PM12/3/19
to pyqtgraph
This has been fixed (pull request 637), but a version with the fix implemented hasn't been released yet.

A new release should be coming pretty soon, but there's no specific schedule. In the meantime, you may want to try replacing the conda package with an installation from git (many things have been fixed/improved since 0.10.0): see installation methods.
Reply all
Reply to author
Forward
0 new messages