[vtk-developers] New vtk packages; suggestions reqd. for other modules

David Gobbi dgobbi at irus.rri.ca
Mon Oct 8 18:03:04 EDT 2001


Hi Prabhu,

I've tried out the new python module structure.  The overall structure
is good, but it doesn't behave quite like I would expect.

For example, if I do

>>> import vtk.common

the result is identical to if I do

>>> import vtk

because both cause vtk/__init__.py to be loaded.  The only way to import
just the 'common' module is with "from vtk import common".

The only work-around I can think of is to move the contents of
vtk/__init__.py into another file called e.g. vtk/all.py, so that
a simple "import vtk" doesn't cause any modules to be loaded.


Also, (also because vtk/__init__.py is being called) when I do

>>> import vtk.parallel

no error is generated even though I don't have "parallel" compiled.

---------------

It might, in the end, be easier not use a directory structure, and to
instead just have a "vtk.py", a "vtkcommon.py", etc.  but only if the
directory-structure approach doesn't work out.

 - David


On Sun, 7 Oct 2001, Prabhu Ramachandran wrote:

> hi,
>
> Only the basic vtk libraries are supported currently by the new
> modules.  Here are things to be discussed.
>
>   (1) Testing: i have added a testing directory but it is empty right
>   now.  I think we should only put modules that are useful to
>   testing in here.  The actual tests should be elsewhere.  something
>   like the following directory structure:
>
>     ls <vtk_src>/Wrapping/Python
>     vtk/
>     tests/
>
>   The tests will go in tests/ and the testing related modules in
>   vtk/testing.  What do you say?
>
>   (2) Interaction/widgets: As Sebastien said maybe its a good idea
>   keeping the same name as in Tcl.  But again I need more feedback on
>   this.  I plan on doing the following:
>
>     vtk/interaction/
>     vtk/interaction/tk/
>     vtk/interaction/tk/ImageWindowWidget.py
>     vtk/interaction/tk/RenderWidget.py
>     vtk/interaction/tk/ImageViewerWidget.py
>
>     vtk/interaction/gtk/
>     vtk/interaction/gtk/RenderWidget.py
>
>     vtk/interaction/wx/...
>     etc.
>
>   What do you think - would 'widgets' be better or 'gui' or is
>   'interaction' fine.
>
>   (3) As part of my current set of tests i use a parser for the vtk
>   methods.  Maybe this should go into a separate utils directory?
>
>     vtk/utils/
>     vtk/utils/MethodParser.py
>     vtk/utils/<other utilities>
>
>   Again I need feedback on this.
>
> Thanks,
> prabhu
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtk-developers
>




More information about the vtk-developers mailing list