[vtkusers] how to get python documentation easier

Andras Lasso lasso at queensu.ca
Tue Jan 8 10:38:03 EST 2019


> 3. I use the vtk installed by pip. It has a problem that my ide(pycharm) can not prompt the inherited function. I must know the parent class name and it prompt the function name.

If you open the generated skeleton (it should be in a location like c:\Users\(username)\.PyCharm2018.3\system\python_stubs\1414425392\vtk) then you can find this in vtkJPEGReader.py:

    class vtkJPEGReader(__vtkIOImagePython.vtkImageReader2):

I've uploaded skeletons that PyCharm is generated for me: https://1drv.ms/f/s!Arm_AFxB9yqHtqlf6Dgc0G6F8PppPA

Unfortunately, PyCharm has trouble understanding qualified class names (__vtkIOImagePython.vtkImageReader2), therefore it cannot identify its parent class.

If you replace this line by these lines then it works perfectly (documentation is found for parent class methods):

    from .vtkImageReader2 import vtkImageReader2
    class vtkJPEGReader(vtkImageReader2):

I'm not sure if this is an error of PyCharm or in how VTK packages are organized. For example PyCharm generates skeleton for opencv correctly (see in StereoSGBM.py file), so maybe we could try to do something similar what is done in opencv. If we think that qualified class names should work then a bug report should be submitted to PyCharm.

Andras

-----Original Message-----
From: vtkusers <vtkusers-bounces at vtk.org> On Behalf Of Franks
Sent: Tuesday, January 8, 2019 5:44 AM
To: vtkusers at vtk.org
Subject: [vtkusers] how to get python documentation easier

I am using python to create my vtk project. But I found that there are less resources for python than c++. I want to read the documentation for python.

1. I use help() in python. It is somehow helpful. But it is inconvenient to see the documentation in the console.

2. The ducumentation downloaded in the official website is helpful. But I found a problem. It can't expand list by mouse click.
<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2Ffile%2Ft342588%2FTIM%25E5%259B%25BE%25E7%2589%258720190108180449.png&data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&sdata=k%2FzD1%2BfPszjZM%2Fx9zCCmdpry9ZdzSm%2FSmxK7kEDbdok%3D&reserved=0> 

3. I use the vtk installed by pip. It has a problem that my ide(pycharm) can not prompt the inherited function. I must know the parent class name and it prompt the function name. 

  reader = vtk.vtkJPEGReader()
  # reader.SetFileName()  this can not be prompted
  vtk.vtkImageReader2.SetFileName(reader, '')





--
Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvtk.1045678.n5.nabble.com%2FVTK-Users-f1224199.html&data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&sdata=u4FWYTJVtdFCqseAbnid%2FP%2FTzwo1Q2VKSM7ECSnrdWE%3D&reserved=0
_______________________________________________
Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&sdata=NxdthqXiIoQBM9VcIYKJ9uVCFjzQfsCHmt6yzL65YxQ%3D&reserved=0

Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&sdata=4wHn1vnUxo1XbDtnPNKKqfPWr6DegFd5ZBFNRsy1Tl8%3D&reserved=0

Please keep messages on-topic and check the VTK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vtk.org%2FWiki%2FVTK_FAQ&data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&sdata=uLrMjODJ4O6iqPvRxQFFIDTPd53q4%2BvBk3y0tk0RaI0%3D&reserved=0

Search the list archives at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmarkmail.org%2Fsearch%2F%3Fq%3Dvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&sdata=yK2BfZhzQCQkqsWkelRhN7w8BNvSp9lkBsqftKklmiA%3D&reserved=0

Follow this link to subscribe/unsubscribe:
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvtk.org%2Fmailman%2Flistinfo%2Fvtkusers&data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&sdata=hdwBvMtIqoiMYvwBC60rinSc0RGfny0xS4uQ%2FRh3D8U%3D&reserved=0


More information about the vtkusers mailing list