-
Notifications
You must be signed in to change notification settings - Fork 24
Tulip python does not follow python idioms #33
Comments
Hi Romain, Good catch! I have just created PR #34 fixing the issue. Cheers! |
@anlambert Thanks for proposing a patch so quickly. I have to admit that I'm surprised the solution is so short |
Thanks to both of you. |
In the same vein, g.addNodes([node1, node2, node3]) where edit: here is the error message
|
Sorry for the noise, tulip is able to add list of nodes without any issue... However, the error message is misleading, as my variable was a list |
It seems that the API documentation is missing some methods, I will make a pass on it to add them. I agree that the error message is confusing, I may have an idea to improve that. |
QOpenGL module is marked as deprecated since a while now so it is time to remove its use from the Talipot codebase and promote the use of QOpenGL* classes directly integrated in the QtGui module. The big difference between QOpenGL and QtOpenGL from Qt5 is that all rendering is performed in framebuffer objects, there is no more direct rendering in the underlying os windows with its own OpenGL context. Talipot OpenGL rendering also follows that idiom, all renderings are performed offscreen using a shared OpenGL context. This also means that there is no more QGLWidget as viewport for QGraphicsView. Talipot OpenGL scene are now converted to QImage in order to display them using the default Qt raster rendering engine. This should fixes the numerous rendering glitches observed on MacOS. First thing observed after the migration is a consequent performance boost in OpenGL rendering when using an Intel GPU on a Linux host machine (especially when selecting elements, it is now 10 times faster on debian stable).
In python, the natural syntax to test the existance of a
thing
in acontainer
is to use the keywordin
.Sadly, it seems it is not the case with tulip bindings in python.
The following code:
is expected to work.
However
assert n1 in g
raises the following error:I do not know at all
sip
, but I'm sure the error comes fromGraph.sip
where some cases are not taken into account in__getitem__
.No idea if it is technically feasible to fix this unexpected behavior.
By the way
type(n1)
gives<class '_tulip.node'>
and notint
as the error message suggestThe text was updated successfully, but these errors were encountered: