enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.32k stars 285 forks source link

tvtk polydata does not tab-complete "points" #745

Open jjstickel opened 5 years ago

jjstickel commented 5 years ago

I'm using tvtk for the first time, and I find it a bit difficult to know what attributes to use with the various tvtk objects. Using tab-complete in an iPython shell is helpful (although still challenging with so many attributes available and most being not useful). And then I found a case where the attribute I want exists but does not tab-complete! Specifically, I used tvtk.XMLPolyDataReader to read in a .vtp file and get the output:

treader = tvtk.XMLPolyDataReader(file_name=filename)
treader.update() 
data = treader.get_output()

I want the points. After browsing the docs, I found that I can get them with data.points. However, data.points does not tab-complete. If so, I would have found it a lot earlier. I'm also concerned there are other attributes I could use that I am missing.

My system is MacOS 10.12.6 with software components installed via Macports:

  py36-mayavi @4.6.2_0 (active)
  python36 @3.6.7_0 (active)
  vtk @8.1.1_1+python36 (active)
jjstickel commented 5 years ago

Quick followup. I just discovered that I can do tvtkobject.get() to see a list of the "traits" attributes. This is very useful. For some of the objects, like the polydata example above, most (maybe all?) of these attributes do not tab-complete.