[vtk-developers] Incorrect checkins into Wrapping/Python: a plea for communication!

Prabhu Ramachandran prabhu_r at users.sf.net
Thu Jul 21 09:16:27 EDT 2005


I noticed a bunch of checkins into Wrapping/Python.  I would
personally have appreciated if there was some discussion on this.  For
one thing, the placement of the modules is totally incorrect.

You can't just stick Python modules files in an arbitrary fashion into
Wrapping/Python.  You have to understand that this directory becomes
available on sys.path via vtk.pth.  Therefore, by adding the files
there you make expr, file, info etc. accessible to any Python module.
This is wrong.  The Wrapping/Python directory (as mentioned in
CMakeLists.txt) is where we have backwards comaptibility code.  No new
modules go there!

If you want to add modules that logically form part of a package
create a separate package directory inside
Wrapping/Python/vtk/your_package/.  Then add your modules there and
access them in your scripts via "import vtk.your_package".  Unless you
are sure that no one will object, you should ask on the list to make
sure the package structure makes sense.

Random comments on some of the code:

  - What does the module do?  Is it just an executable script?  Do you
    think other folks will need to import it?  Is it VTK specific or

  - No docs (or email) explaining *anything* about the code.

  - The indentation is non-standard in all the modules.  Use 4 spaces
    not two.  Python code does not and will not follow the VTK C++
    code guidelines.

  - The functionality in vtkColors already exists in vtk.util.colors.

  - Avoid the use of the 'vtkpython' module, use 'vtk' instead.

  - Have you taken a look at Utilities/tcl2py.py?  Is there a problem?

Not that it is a big deal but I wish we were asked about these
checkins before they were made.


More information about the vtk-developers mailing list