how to get python documentation easier

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to get python documentation easier

Franks
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.
<http://vtk.1045678.n5.nabble.com/file/t342588/TIM%E5%9B%BE%E7%89%8720190108180449.png>

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: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: how to get python documentation easier

VTK - Users mailing list


On Tue, Jan 8, 2019 at 5:43 AM Franks <[hidden email]> wrote:
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.

Yes, this can be a bit verbose. To see what methods are available, I find `dir()` to be useful and less verbose.
 
2. The ducumentation downloaded in the official website is helpful. But I
found a problem. It can't expand list by mouse click.
<http://vtk.1045678.n5.nabble.com/file/t342588/TIM%E5%9B%BE%E7%89%8720190108180449.png>

Yes, that's from a missing JavaScript file. We'll get it fixed. 

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, '')

I'm not sure about that one.

Best,
Cory 
 




--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers


--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: how to get python documentation easier

Andras Lasso
In reply to this post by Franks
> 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 <[hidden email]> On Behalf Of Franks
Sent: Tuesday, January 8, 2019 5:44 AM
To: [hidden email]
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&amp;data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&amp;sdata=k%2FzD1%2BfPszjZM%2Fx9zCCmdpry9ZdzSm%2FSmxK7kEDbdok%3D&amp;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&amp;data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&amp;sdata=u4FWYTJVtdFCqseAbnid%2FP%2FTzwo1Q2VKSM7ECSnrdWE%3D&amp;reserved=0
_______________________________________________
Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&amp;data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&amp;sdata=NxdthqXiIoQBM9VcIYKJ9uVCFjzQfsCHmt6yzL65YxQ%3D&amp;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&amp;data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&amp;sdata=4wHn1vnUxo1XbDtnPNKKqfPWr6DegFd5ZBFNRsy1Tl8%3D&amp;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&amp;data=02%7C01%7Classo%40queensu.ca%7Cdc90d6a9056549f3753408d675562ea5%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636825410348993302&amp;sdata=uLrMjODJ4O6iqPvRxQFFIDTPd53q4%2BvBk3y0tk0RaI0%3D&amp;reserved=0

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

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

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers