<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Is there a conversion document describing how the "look and feel" of the new binding?<br><br>The current binding is very non-pythonesque in various ways. E.g.:<br>
<br><pre class=""><span style="color:rgb(160,32,240)">import</span> vtk

<span style="color:rgb(178,34,34)"># </span><span style="color:rgb(178,34,34)">identity transformation</span>
t = vtk.vtkTransform()
in_point = (1,0,0)
out_point = [0,0,0]
t.TransformPoint(in_point,out_point)

<span style="color:rgb(178,34,34)"># </span><span style="color:rgb(178,34,34)">would expect something like</span>
in_point = vtk.vtkPoint((1,0,0))
out_point = t.TransformPoint(in_point)
</pre>There are lots of other examples as well that I encountered in the source. E.g. the use of gettattr() and a dispatcher, instead of just using the standard python list of class methods.<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
Of course, such a drastic change this will break the current API. But you can always call it vtk6 and decide not to be backwards compatible.<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">
Regards,<br>Dov<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 1, 2014 at 10:21 AM, Arnd Baecker <span dir="ltr"><<a href="mailto:arnd.baecker@web.de" target="_blank">arnd.baecker@web.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, 31 Jul 2014, David Gobbi wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thu, Jul 31, 2014 at 6:44 AM, diego0020 <<a href="mailto:da.angulo39@uniandes.edu.co" target="_blank">da.angulo39@uniandes.edu.co</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But I am also looking forward to this. Is there anything we could do to push<br>
support for python 3 forward?<br>
</blockquote>
<br>
There has been some discussion about converting all of the python<br>
tests and examples, which is a part of the process where extra<br>
manpower would be a big asset.  I imagine that the conversion will<br>
go something like this:<br>
<br>
1) Someone will run 2to3 on all the python code, and then make<br>
sure that it can be byte-compiled with python3 (it will be too early<br>
at this stage to actually run the code, but making sure that it<br>
byte-compiles will be a good first step).<br>
<br>
2) Lots of people will then pick through the code to fix conversion<br>
errors and to make sure that the code actually looks like good<br>
python3 code.<br>
<br>
3) Finally, someone will add some CMake magic to VTK so that if VTK<br>
is built against python2, cmake will run 3to2 on all of these new python3<br>
files and put the equivalent python2 code into the VTK build<br>
directory.  This is the magic that is needed to make sure that VTK<br>
will be able to support both python2 and python3.<br>
<br>
So any assistance with the above process would be a big help.  In<br>
particular, it would be very useful if someone could verify that item<br>
(3) is even feasible: in the end it might be necessary to have hand-<br>
written python2 and python3 exist side-by-side instead of using<br>
automatic conversion.  It _should_ be feasible, since the VTK<br>
tests used automated tcl-to-python conversion for many years,<br>
and python3 to python2 should be much easier than tcl to python.<br>
</blockquote>
<br></div></div>
As a disclaimer ahead: I don't have any experience in porting<br>
to python 3. For my own projects I am just trying to follow pylint's<br>
suggestions about possible python 3 problems and using<br>
``from __future__ import (division, print_function)`` at the beginning.<br>
<br>
According to <a href="https://docs.python.org/2/howto/pyporting.html" target="_blank">https://docs.python.org/2/<u></u>howto/pyporting.html</a><br>
it might be worth a try to run the examples/tests with the ``-3``<br>
option to find out about possible compatibility problems.<br>
I tried this with some random examples and no problems were<br>
reported.<br>
So it might be that a lot of code is such<br>
that it would work fine both with python 2 and python 3.<br>
(Maybe someone from the numpy/scipy/... experts could<br>
also help with their experience in supporting both python 2 and 3).<br>
<br>
Unfortunately at the moment I won't have time to look into this<br>
further, but I will try to help, if needed.<br>
<br>
Best, Arnd<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_<u></u>FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/<u></u>mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>