Ondrej Certik | 1 Mar 03:23
Picon
Gravatar

Re: Mayavi2 in Sage (was Re: mayavi offscreen rendering)

On Fri, Feb 27, 2009 at 10:03 AM, Prabhu Ramachandran
<prabhu@...> wrote:
> On 02/26/09 18:59, Prabhu Ramachandran wrote:
>>>
>>> When I get this resolved, I would be able to start using mayavi in
>>> Sage notebook over the web, so it'd be really awesome.
>>
>> Yes, I had wanted to get there too but thanks to too many other things I
>> never got around to this.  The big problem is that offscreen rendering is
>> kind of cheating on the Mac/Linux since it does require a real window.
>>
>> I think the cleanest option to do this for sage would be to build with
>> Mesa + OSMesa rather than OpenGL but I haven't tried this.  This will not
>> produce any screen output but will produce the pictures you want without an
>> X-connection.  It will also not make use of any acceleration on your card.
>>  I think this is a pretty solid option that we can use for sage and it will
>> end up being a big win.  I am trying out a mesa build now and will see how
>> that goes.
>
> OK after some pain and a little help from Dave Cole at Kitware, I've figured
> out how to do this pretty reliably.  Doing this will allow you to use VTK
> and therefore TVTK/Mayavi completely headless.  It will do all the rendering
> in software, you can still use the UI if you want to though but the
> offscreen option is what will be most useful for the sage notebook.  I guess
> if you have the right card and can use the dri version of mesa you could
> benefit from some h/w acceleration too.  But anyways, this is how you set
> things up:
>
> Build a recent version of mesa.  I tried with the version that was installed
> via ubuntu -- 7.0.3-rc2.  7.0.4 would work as would 7.2 but 7.2 is
(Continue reading)

Picon
Gravatar

Re: Mayavi2 in Sage (was Re: mayavi offscreen rendering)

On 03/01/09 07:53, Ondrej Certik wrote:
> Or easier:
> 
> cmake -DVTK_OPENGL_HAS_OSMESA=ON -DVTK_USE_OFFSCREEN=ON
> -DCMAKE_INSTALL_PREFIX=/home/ondrej/ext/vtk-offscreen ~/repos/VTK/

Yes, but often it is convenient to use the UI so you don't miss options.

>>  make
> 
> make -j9
> 
> takes 2 min, not bad.

You lucky <beep>. It takes me an hour at least -- which explains my pain 
that night experimenting with a 1 hour cycle time.  There are a couple 
of nice 8 core boxes in my lab but thats busy running other stuff.

>> Now install VTK or set the PYTHONPATH and LD_LIBRARY_PATH suitably. Also
>> ensure that LD_LIBRARY_PATH points to $MESA/lib to get the right GL libs.
> 
> How do I install the Python bindings?

How do you want to, what environment variables are you willing to set? 
'make install' should do the job. You could use virtualenv and install 
there and set the LD_LIBRARY_PATH.  ccmake will set 
VTK_PYTHON_SETUP_ARGS:STRING=--prefix="${CMAKE_INSTALL_PREFIX}"
by default and use that when you do make install.  There is a long 
README.txt in Wrapping/Python that I wrote ages ago but the general 
ideas apply.  You could also peek at the debian packages and see what 
(Continue reading)

Picon
Gravatar

Re: using mayavi2 to edit points

On 03/01/09 01:46, Szymon Stoma wrote:
> 
> for me this solution does not work. my screen blinks as previously. 
> could it be mac os x? 

Not sure, it seems to work fine for me on linux, haven't tried on mac.

cheers,
prabhu
Picon
Gravatar

Re: selecting and moving actors

On 03/01/09 01:35, Szymon Stoma wrote:
> the goal is simple. i would like to use the tvtk to do simple 
> interactions: moving selected actors. in the code i attach the moving is 
> working correctly (selected actor is surrounded by spherical marker 
> which can be used to move on the screen. the marker is moved when we 
> press on it with left mouse button and move the mouse cursor. the 
> selected object can be switched by clicking with the right mouse button, 
> it cycles through all the actors. here is the problem:
> 
> 1. i would like to select the actor which was clicked with right mouse 
> button (instead of cycling through all the actors).
> 
> the problem is that i do not know how to go from click event to actor 
> selection. everything is documented in the code. can someone (thank you 
> in advance Prabhu ;] ), look in the code and try to comment all/some 
> comments?

You should really study the code for the picker.py that I mentioned.  It 
answers your basic questions.  A good way to play with the code and 
learn the behavior of the various pickers in that code would be to do 
something like this:

  $ mayavi2 -d ParametricSurface -m Surface

  Then on the ui hit 'p' to pick a point.
  Drag the scene icon to the embedded python shell and do the following:
  >>> s = _
  >>> print s.scene.picker.pointpicker

To answer your question:
(Continue reading)

Ondrej Certik | 1 Mar 09:54
Picon
Gravatar

Re: Mayavi2 in Sage (was Re: mayavi offscreen rendering)

On Sat, Feb 28, 2009 at 7:18 PM, Prabhu Ramachandran
<prabhu <at> aero.iitb.ac.in> wrote:
> On 03/01/09 07:53, Ondrej Certik wrote:
>>
>> Or easier:
>>
>> cmake -DVTK_OPENGL_HAS_OSMESA=ON -DVTK_USE_OFFSCREEN=ON
>> -DCMAKE_INSTALL_PREFIX=/home/ondrej/ext/vtk-offscreen ~/repos/VTK/
>
> Yes, but often it is convenient to use the UI so you don't miss options.

Here is the actual command:

cmake -DVTK_OPENGL_HAS_OSMESA=ON -DVTK_USE_OFFSCREEN=ON
-DCMAKE_INSTALL_PREFIX=/home/ondrej/ext/vtk-offscreen
-DVTK_WRAP_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/bin/python2.5
-DPYTHON_LIBRARY=/usr/lib/libpython2.5.a -DBUILD_SHARED_LIBS=ON
~/repos/VTK/

>
>>>  make
>>
>> make -j9
>>
>> takes 2 min, not bad.
>
> You lucky <beep>. It takes me an hour at least -- which explains my pain
> that night experimenting with a 1 hour cycle time.  There are a couple of
> nice 8 core boxes in my lab but thats busy running other stuff.

(Continue reading)

Picon
Gravatar

Re: Mayavi2 in Sage (was Re: mayavi offscreen rendering)

Hi Ondrej,

On 03/01/09 14:24, Ondrej Certik wrote:
> Here is the actual command:
> 
> cmake -DVTK_OPENGL_HAS_OSMESA=ON -DVTK_USE_OFFSCREEN=ON
> -DCMAKE_INSTALL_PREFIX=/home/ondrej/ext/vtk-offscreen
> -DVTK_WRAP_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/bin/python2.5
> -DPYTHON_LIBRARY=/usr/lib/libpython2.5.a -DBUILD_SHARED_LIBS=ON
> ~/repos/VTK/

Yes, thats how the debian packages/rpm spec files would do it.  Did it 
pick up the right locations for osmesa etc.?

> $ LD_LIBRARY_PATH=/home/ondrej/ext/vtk-offscreen/lib/vtk-5.3/
> PYTHONPATH=~/ext/vtk-offscreen/local/lib/python2.6/dist-packages
> python2.6 Cone.py
> Segmentation fault (core dumped)
> 
> I then tried to compile with python2.5:
> 
> $ LD_LIBRARY_PATH=/home/ondrej/ext/vtk-offscreen/lib/vtk-5.3/
> PYTHONPATH=~/ext/vtk-offscreen/lib/python2.5/site-packages/ python2.5
> Cone.py
> Segmentation fault (core dumped)
> 
> 
> So I am not that lucky after all. :(

We'll see about that. :)
(Continue reading)

Gael Varoquaux | 2 Mar 09:35
Favicon
Gravatar

Re: [mv2] animation

On Fri, Feb 27, 2009 at 07:52:54PM +0100, Jaap Spies wrote:
> I have vtk-5.2.1 installed in Sage. Don't know how to turn offscreen on :(

Doesn't "mlab.options.offscreen = True" work for you? I cannot try, as I
don't have VTK 5.2 around.

Gaël
Gael Varoquaux | 2 Mar 09:38
Favicon
Gravatar

Re: Mayavi and ipython start up issue: appears to hang Mayavi

On Fri, Feb 27, 2009 at 10:10:07PM -0600, Dave Peterson wrote:
>    Thanks for the response and the offer to play with M2 to fix, but there is
>    no urgency on the change from my perspective.  I just wanted to make sure
>    Gael / Prabhu knew of the issue since it could potentially confuse new
>    Mayavi users.

Thanks for the heads up. I wasn't aware of this (I do use Mayavi with the
IPython frontend). We are talking of ETS trunk, right? So I can go ahead
and fix this in the trunk when I get time? Hopefully I'll do this
tonight.

Gaël
Marcel Luethi | 2 Mar 10:42
Picon

Cannot install ETS 2.7.1 on Win XP

Hi,

I'm trying to install ETS 2.7.1 on WinXP (as described in https://svn.enthought.com/enthought/wiki/Install/ETS_2.7.1/Py2.5/Win_XP_i386) but I encounter a problem.
My config:
  • ActivePython 2.5.2.2 (ActiveState Software Inc.) based on
    Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit (Intel)] on win32
  • setuptools 0.6c9
Anything I'm doing wrong?

TIA for any help!
Regards, Marcel


c:\Python25>easy_install -f http://code.enthought.com/enstaller/eggs/windows/xp "ets[nonets]==2.7.1"
Searching for ets[nonets]==2.7.1
Reading http://code.enthought.com/enstaller/eggs/windows/xp
Best match: ets 2.7.1
Downloading http://code.enthought.com/enstaller/eggs/windows/xp/ets-2.7.1-py2.5.egg
Processing ets-2.7.1-py2.5.egg
Moving ets-2.7.1-py2.5.egg to c:\python25\lib\site-packages
Adding ets 2.7.1 to easy-install.pth file

Installed c:\python25\lib\site-packages\ets-2.7.1-py2.5.egg
Reading http://code.enthought.com/enstaller/eggs/source
Processing dependencies for ets[nonets]==2.7.1
Searching for enthought.util[nonets]
Best match: enthought.util 2.0.4
Downloading http://code.enthought.com/enstaller/eggs/source/enthought.util-2.0.4.tar.gz
Processing enthought.util-2.0.4.tar.gz
Running enthought.util-2.0.4\setup.py -q bdist_egg --dist-dir c:\docume~1\tgdlumah\locals~1\temp\easy_install-2roczp\enthought.util-2.0.4\egg-dist-tmp-iiqxeb
Adding enthought.util 2.0.4 to easy-install.pth file

Installed c:\python25\lib\site-packages\enthought.util-2.0.4-py2.5.egg
Searching for enthought.units[nonets]
Best match: enthought.units 2.0.4
Downloading http://code.enthought.com/enstaller/eggs/source/enthought.units-2.0.4.tar.gz
Processing enthought.units-2.0.4.tar.gz
Running enthought.units-2.0.4\setup.py -q bdist_egg --dist-dir c:\docume~1\tgdlumah\locals~1\temp\easy_install-mvywau\enthought.units-2.0.4\egg-dist-tmp-y_eo50
Adding enthought.units 2.0.4 to easy-install.pth file

Installed c:\python25\lib\site-packages\enthought.units-2.0.4-py2.5.egg
Searching for enthought.type-manager[nonets]
Best match: enthought.type-manager 2.0.4
Downloading http://code.enthought.com/enstaller/eggs/source/enthought.type_manager-2.0.4.tar.gz
Processing enthought.type_manager-2.0.4.tar.gz
Running enthought.type_manager-2.0.4\setup.py -q bdist_egg --dist-dir c:\docume~1\tgdlumah\locals~1\temp\easy_install-hnk7tt\enthought.type_manager-2.0.4\egg-dist-tmp-ic5agw
Adding enthought.type-manager 2.0.4 to easy-install.pth file

Installed c:\python25\lib\site-packages\enthought.type_manager-2.0.4-py2.5.egg
Searching for enthought.tvtk[nonets]
Best match: enthought.tvtk 2.1.0
Downloading http://code.enthought.com/enstaller/eggs/source/enthought.tvtk-2.1.0.tar.gz
Processing enthought.tvtk-2.1.0.tar.gz
Running enthought.tvtk-2.1.0\setup.py -q bdist_egg --dist-dir c:\docume~1\tgdlumah\locals~1\temp\easy_install-qzywxs\enthought.tvtk-2.1.0\egg-dist-tmp-sswjil
Traceback (most recent call last):
  File "C:\Python25\Scripts\easy_install-script.py", line 8, in <module>
    load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 1671, in main
    with_ei_usage(lambda:
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 1659, in with_ei_usage
    return f()
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 1675, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "C:\Python25\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
    self.run_command(cmd)
  File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
    cmd_obj.run()
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 211, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 446, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 478, in install_item
    self.process_distribution(spec, dist, deps)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 519, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "C:\Python25\lib\site-packages\pkg_resources.py", line 522, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "C:\Python25\lib\site-packages\pkg_resources.py", line 758, in best_match
    return self.obtain(req, installer) # try and download/install
  File "C:\Python25\lib\site-packages\pkg_resources.py", line 770, in obtain
    return installer(requirement)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 446, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 476, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 655, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 930, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 919, in run_setup
    run_setup(setup_script, args)
  File "C:\Python25\Lib\site-packages\setuptools\sandbox.py", line 27, in run_setup
    lambda: execfile(
  File "C:\Python25\Lib\site-packages\setuptools\sandbox.py", line 63, in run
    return func()
  File "C:\Python25\Lib\site-packages\setuptools\sandbox.py", line 29, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 2, in <module>
ImportError: No module named numpy.distutils.core

c:\Python25>
 
_______________________________________________
Enthought-dev mailing list
Enthought-dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev
Thomas Lecocq | 2 Mar 10:54
Picon
Favicon

Re: Cannot install ETS 2.7.1 on Win XP

it seems that Numpy is missing...



**********************
Thomas Lecocq
Geologist
Ph.D.Student (Seismology)
Royal Observatory of Belgium
**********************



Date: Mon, 2 Mar 2009 10:42:34 +0100
From: marcel.luethi-fK9Nr9oJXxeWpB8AXVHUkA@public.gmane.org
To: enthought-dev-oRDGkvazHdacsI7C1d+pp9BPR1lH4CV8@public.gmane.org
Subject: [Enthought-dev] Cannot install ETS 2.7.1 on Win XP

Hi,

I'm trying to install ETS 2.7.1 on WinXP (as described in https://svn.enthought.com/enthought/wiki/Install/ETS_2.7.1/Py2.5/Win_XP_i386) but I encounter a problem.

My config:
  • ActivePython 2.5.2.2 (ActiveState Software Inc.) based on
    Python 2.5.2 (r252:60911, Mar 27 2008, 17:57:18) [MSC v.1310 32 bit (Intel)] on win32
  • setuptools 0.6c9
Anything I'm doing wrong?

TIA for any help!
Regards, Marcel


c:\Python25>easy_install -f http://code.enthought.com/enstaller/eggs/windows/xp "ets[nonets]==2.7.1"
Searching for ets[nonets]==2.7.1
Reading http://code.enthought.com/enstaller/eggs/windows/xp
Best match: ets 2.7.1
Downloading http://code.enthought.com/enstaller/eggs/windows/xp/ets-2.7.1-py2.5.egg
Processing ets-2.7.1-py2.5.egg
Moving ets-2.7.1-py2.5.egg to c:\python25\lib\site-packages
Adding ets 2.7.1 to easy-install.pth file

Installed c:\python25\lib\site-packages\ets-2.7.1-py2.5.egg
Reading http://code.enthought.com/enstaller/eggs/source
Processing dependencies for ets[nonets]==2.7.1
Searching for enthought.util[nonets]
Best match: enthought.util 2.0.4
Downloading http://code.enthought.com/enstaller/eggs/source/enthought.util-2.0.4.tar.gz
Processing enthought.util-2.0.4.tar.gz
Running enthought.util-2.0.4\setup.py -q bdist_egg --dist-dir c:\docume~1\tgdlumah\locals~1\temp\easy_install-2roczp\enthought.util-2.0.4\egg-dist-tmp-iiqxeb
Adding enthought.util 2.0.4 to easy-install.pth file

Installed c:\python25\lib\site-packages\enthought.util-2.0.4-py2.5.egg
Searching for enthought.units[nonets]
Best match: enthought.units 2.0.4
Downloading http://code.enthought.com/enstaller/eggs/source/enthought.units-2.0.4.tar.gz
Processing enthought.units-2.0.4.tar.gz
Running enthought.units-2.0.4\setup.py -q bdist_egg --dist-dir c:\docume~1\tgdlumah\locals~1\temp\easy_install-mvywau\enthought.units-2.0.4\egg-dist-tmp-y_eo50
Adding enthought.units 2.0.4 to easy-install.pth file

Installed c:\python25\lib\site-packages\enthought.units-2.0.4-py2.5.egg
Searching for enthought.type-manager[nonets]
Best match: enthought.type-manager 2.0.4
Downloading http://code.enthought.com/enstaller/eggs/source/enthought.type_manager-2.0.4.tar.gz
Processing enthought.type_manager-2.0.4.tar.gz
Running enthought.type_manager-2.0.4\setup.py -q bdist_egg --dist-dir c:\docume~1\tgdlumah\locals~1\temp\easy_install-hnk7tt\enthought.type_manager-2.0.4\egg-dist-tmp-ic5agw
Adding enthought.type-manager 2.0.4 to easy-install.pth file

Installed c:\python25\lib\site-packages\enthought.type_manager-2.0.4-py2.5.egg
Searching for enthought.tvtk[nonets]
Best match: enthought.tvtk 2.1.0
Downloading http://code.enthought.com/enstaller/eggs/source/enthought.tvtk-2.1.0.tar.gz
Processing enthought.tvtk-2.1.0.tar.gz
Running enthought.tvtk-2.1.0\setup.py -q bdist_egg --dist-dir c:\docume~1\tgdlumah\locals~1\temp\easy_install-qzywxs\enthought.tvtk-2.1.0\egg-dist-tmp-sswjil
Traceback (most recent call last):
  File "C:\Python25\Scripts\easy_install-script.py", line 8, in <module>
    load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 1671, in main
    with_ei_usage(lambda:
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 1659, in with_ei_usage
    return f()
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 1675, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "C:\Python25\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
    self.run_command(cmd)
  File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
    cmd_obj.run()
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 211, in run
    self.easy_install(spec, not self.no_deps)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 446, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 478, in install_item
    self.process_distribution(spec, dist, deps)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 519, in process_distribution
    [requirement], self.local_index, self.easy_install
  File "C:\Python25\lib\site-packages\pkg_resources.py", line 522, in resolve
    dist = best[req.key] = env.best_match(req, self, installer)
  File "C:\Python25\lib\site-packages\pkg_resources.py", line 758, in best_match
    return self.obtain(req, installer) # try and download/install
  File "C:\Python25\lib\site-packages\pkg_resources.py", line 770, in obtain
    return installer(requirement)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 446, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 476, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 655, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 930, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "C:\Python25\lib\site-packages\setuptools\command\easy_install.py", line 919, in run_setup
    run_setup(setup_script, args)
  File "C:\Python25\Lib\site-packages\setuptools\sandbox.py", line 27, in run_setup
    lambda: execfile(
  File "C:\Python25\Lib\site-packages\setuptools\sandbox.py", line 63, in run
    return func()
  File "C:\Python25\Lib\site-packages\setuptools\sandbox.py", line 29, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'}
  File "setup.py", line 2, in <module>
ImportError: No module named numpy.distutils.core

c:\Python25>
 
_______________________________________________
Enthought-dev mailing list
Enthought-dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev

Gmane