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

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Jul 21 16:15:14 EDT 2005


After going over the standards and Utilities/tcl2py, I have done the
following changes (haven't committed them yet)

* I have changed the modules in accordance with the standard (names,
indentation etc.).
* getting rid of vtkColors (using vtk.util.colors instead)
* can't use tcl2py, as it does not support foreach/catch/variable
substitution in strings, procedure calls with arguments etc. So, for
now, sticking with the vtkTclParser and vtkTclToPyConvertor.
* created a new package vtktesting under vtk (don't want to put it in
vtk.test as these scripts are not to be used to write new tests, only
for running the converted tests).

Will commit these files tomorrow if there is no objection.

Utkarsh.

ps. David, Thanks for the link.


On 7/21/05, David Gobbi <dgobbi at atamai.com> wrote:

>> Hi Utkarsh,
>> 
>> There are well-documented code guidelines for python:
>> http://www.python.org/peps/pep-0008.html
>> 
>>  - David
>> 
>> Utkarsh Ayachit wrote:
>> 
>  
>
>>> > I apologize for any inconvieniences that the recent Wrapping/Python
>>> > may have caused.
>>> > Here is a brief summary of what I wanted to do. I would appreciate any
>>> > feedback.
>>> >
>>> > Basically, all the added stuff (which I agree I should have been put
>>> > away in a package: I'll put it away as "vtktesting", is that ok?) is a
>>> > quick script to convert most of the Tcl tests to Python. (I wasn't
>>> > aware of Utilities/tcl2py.py. On a quick attempt, it seems to fail for
>>> > quite a few tests eg. Graphics/Testing/Tcl/Delaunay3D.tcl). No VTK
>>> > user is supposed to use any of these scripts. The sole purpose is to
>>> > convert VTK tcl tests to python.
>>> >
>>> > I will wait for any feedback before proceeding with the changes. Out
>>> > of curiousity, why doesn't Python code follow VTK C++ code guidelines?
>>> > If I am not mistaken, python has no restrictions on the nature of indent.
>>> >
>>> > Utkarsh
>>> >
>>> >
>>> > ------- Original Message --------
>>> > Subject:     [vtk-developers] Incorrect checkins into Wrapping/Python: a
>>> > plea for communication!
>>> > Date:     Thu, 21 Jul 2005 18:46:27 +0530
>>> > From:     Prabhu Ramachandran <prabhu_r at users.sourceforge.net>
>>> > To:     vtk-developers at vtk.org
>>> >
>>> >
>>> >
>>> > Hi,
>>> >
>>> > 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
>>> >    general?
>>> >
>>> >  - 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.
>>> >
>>> >
>>> > prabhu
>>> > _______________________________________________
>>> > vtk-developers mailing list
>>> > vtk-developers at vtk.org
>>> > http://www.vtk.org/mailman/listinfo/vtk-developers
>>> >
>>> > _______________________________________________
>>> > vtk-developers mailing list
>>> > vtk-developers at vtk.org
>>> > http://www.vtk.org/mailman/listinfo/vtk-developers
>>> >
>>    
>>
>> 
>>
>  
>




More information about the vtk-developers mailing list