Ondrej Certik | 1 Aug 02:15
Picon
Gravatar

Re: installing mayavi from svn: AttributeError: 'ETSConfig' object has no attribute 'get_application_home'

> Sorry for the lack of response.   I hadn't forgotten about it, I'm just
> swamped and haven't gotten around to doing a bit of investigation before I
> reply.

No problem at all, I understand.

Ondrej
_______________________________________________
Enthought-Dev mailing list
Enthought-Dev <at> enthought.com
https://mail.enthought.com/mailman/listinfo/enthought-dev
Ondrej Certik | 1 Aug 04:02
Picon
Gravatar

how to write gui for FEM using traits

Hi,

my colleagues (C++ guys) have wrote a really nice GUI for fem (2D),
code and screenshots are here:

http://hpfem.org/agros2d/

And it gets the job done. But it's already 22,764 lines of C++ code
using QT4 and it uses some C++ like scripting language for scripting
things, plus the post processing is not that great either, I already
can do way better job with mayavi (even though for some 3D stuff
mayavi is way slower than pure opengl, so that's a real problem, but
mayavi is also way more flexible, works in the offscreen mode like
Sage notebook, etc.). Python for scripting is awesome, I don't have to
link with umfpack and our C++ fem solver etc (I just import it). What
I still cannot do yet however is to put everything together and
provide a program that could do the exact same thing as the C++ gui.
And I want to compare what is smaller and more maintainable. I must
say the QT4 C++ toolkit is doing very good job at keeping things
maintainable and crossplatform in C++, so it is a challenge, but still
I believe in Python.

I can of course just use PyQt4 directly, but I don't really like that.
So I started to learn traits yesterday, attached find my attempt so
far, gui.py (just run it, it will work). You can also download the
full code + icons from here:

http://github.com/certik/hermes-gui

for the time being I want to see if I can get the interface done and
(Continue reading)

Ondrej Certik | 1 Aug 06:08
Picon
Gravatar

Re: how to write gui for FEM using traits

On Fri, Jul 31, 2009 at 8:02 PM, Ondrej Certik<ondrej@...> wrote:

> Also, in principle, am I doing things the right way? I read all the
> traits documentation, Gael's tutorial, and I am learning from examples
> in the svn directories and also from the mayavi application. It seems
> to me there are quite a few ways to approach it, e.g.
> ApplicationWindow, SplitApplicationWindow, or just configure_traits()
> on a regular traits object, etc.

Ok, I think I can see the difference now --- ApplicationWindow,
SplitApplicationWindow are from pyface, while configure_traits() from
traits.

So for example which menubars and toolbars should I be using? Those
from pyface or traits? I tried to reimplement the menu bar with
traits.ui only, if I create a menu in the View like this:

MenuBar(
            Menu(
                    new_action,
                    open_action,
                    save_action,
                    Action(name='Save &As...',
                        accelerator="Ctrl+Shift+S",
                        image=ImageResource("images/document-save-as.png")),
                    Action(name='Close',
                        accelerator="Ctrl+W"),

                    Action(name='Import DXF...'),
                    Action(name='Export DXF...'),
(Continue reading)

Robert Kern | 1 Aug 06:19
Gravatar

Re: how to write gui for FEM using traits

On Fri, Jul 31, 2009 at 23:08, Ondrej Certik<ondrej@...> wrote:
> On Fri, Jul 31, 2009 at 8:02 PM, Ondrej Certik<ondrej@...> wrote:
>
>> Also, in principle, am I doing things the right way? I read all the
>> traits documentation, Gael's tutorial, and I am learning from examples
>> in the svn directories and also from the mayavi application. It seems
>> to me there are quite a few ways to approach it, e.g.
>> ApplicationWindow, SplitApplicationWindow, or just configure_traits()
>> on a regular traits object, etc.
>
> Ok, I think I can see the difference now --- ApplicationWindow,
> SplitApplicationWindow are from pyface, while configure_traits() from
> traits.
>
> So for example which menubars and toolbars should I be using? Those
> from pyface or traits?

If you are making a menu for a Traits UI View, use MenuBar, Menu,
Action, and ActionGroup from enthought.traits.ui.menu.

If you are making a menu for an ApplicationWindow, use MenuBar, Menu,
Action, and Group from enthought.pyface.action.api.

Note that the Traits UI Actions are a little bit different from PyFace
Actions. The former have support for calling methods on the Handler
just by giving the name of the method. The latter are the more general
base class.

> Anyway, I also implemented a toolbar using traits.ui, but then it's
> just one toolbar and it seems like only a panel. Is there a way to get
(Continue reading)

Ondrej Certik | 1 Aug 06:21
Picon
Gravatar

Re: how to write gui for FEM using traits

On Fri, Jul 31, 2009 at 10:08 PM, Ondrej Certik<ondrej@...> wrote:
> On Fri, Jul 31, 2009 at 8:02 PM, Ondrej Certik<ondrej@...> wrote:
>

>
> I am almost sure I must be doing something wrong, but I can't figure
> it out. I looked at mayavi, but it uses plugins and some other way to
> construct menus. And I didn't find any example of this either, only
> using pyface, where btw I got the exact same behavior, but using
> Group() fixes it.

I found pretty good full blown application in
AppTools_3.3.1/enthought/rst, and there it uses pyface's Group() to
fix the order in the menu. That works for me too.

But isn't this a hack to use pyface? I thought the idea is to use
traits.ui only and leave the rendering to pyface.

Ondrej
Robert Kern | 1 Aug 06:31
Gravatar

Re: how to write gui for FEM using traits

On Fri, Jul 31, 2009 at 23:21, Ondrej Certik<ondrej@...> wrote:
> On Fri, Jul 31, 2009 at 10:08 PM, Ondrej Certik<ondrej@...> wrote:
>> On Fri, Jul 31, 2009 at 8:02 PM, Ondrej Certik<ondrej@...> wrote:
>>
>
>>
>> I am almost sure I must be doing something wrong, but I can't figure
>> it out. I looked at mayavi, but it uses plugins and some other way to
>> construct menus. And I didn't find any example of this either, only
>> using pyface, where btw I got the exact same behavior, but using
>> Group() fixes it.
>
> I found pretty good full blown application in
> AppTools_3.3.1/enthought/rst, and there it uses pyface's Group() to
> fix the order in the menu. That works for me too.
>
> But isn't this a hack to use pyface? I thought the idea is to use
> traits.ui only and leave the rendering to pyface.

Traits UI doesn't really use PyFace all that much; actions, dock
widgets, ImageResource, and the grid control, really. Use Traits UI
for the things that Traits UI are good for; PyFace for what it's good
for.

Traits UI is a framework. It's good for a large, but finite number of
tasks. In particular, it's good for implementing individual views of
models. PyFace is good for implementing the main application window
stuff (menus, toolbars, etc.) with maximum flexibility. Fortunately,
these are easily combined. For example, the Workbench Envisage plugin
is all PyFace, not Traits UI. We often write applications that use the
(Continue reading)

Ondrej Certik | 1 Aug 07:11
Picon
Gravatar

Re: how to write gui for FEM using traits

On Fri, Jul 31, 2009 at 10:31 PM, Robert Kern<rkern@...> wrote:
> On Fri, Jul 31, 2009 at 23:21, Ondrej Certik<ondrej@...> wrote:
>> On Fri, Jul 31, 2009 at 10:08 PM, Ondrej Certik<ondrej@...> wrote:
>>> On Fri, Jul 31, 2009 at 8:02 PM, Ondrej Certik<ondrej@...> wrote:
>>>
>>
>>>
>>> I am almost sure I must be doing something wrong, but I can't figure
>>> it out. I looked at mayavi, but it uses plugins and some other way to
>>> construct menus. And I didn't find any example of this either, only
>>> using pyface, where btw I got the exact same behavior, but using
>>> Group() fixes it.
>>
>> I found pretty good full blown application in
>> AppTools_3.3.1/enthought/rst, and there it uses pyface's Group() to
>> fix the order in the menu. That works for me too.
>>
>> But isn't this a hack to use pyface? I thought the idea is to use
>> traits.ui only and leave the rendering to pyface.
>
> Traits UI doesn't really use PyFace all that much; actions, dock
> widgets, ImageResource, and the grid control, really. Use Traits UI
> for the things that Traits UI are good for; PyFace for what it's good
> for.
>
> Traits UI is a framework. It's good for a large, but finite number of
> tasks. In particular, it's good for implementing individual views of
> models. PyFace is good for implementing the main application window
> stuff (menus, toolbars, etc.) with maximum flexibility. Fortunately,
> these are easily combined. For example, the Workbench Envisage plugin
(Continue reading)

Ondrej Certik | 1 Aug 08:29
Picon
Gravatar

Re: Mayavi documentation

On Fri, Jul 31, 2009 at 12:17 PM, Travis Vaught<travis <at> enthought.com> wrote:
>
> On Jul 8, 2009, at 1:45 PM, Gael Varoquaux wrote:
>
>> On Wed, Jul 08, 2009 at 08:34:14PM +0200, Nils Wagner wrote:
>>> ./run.py
>>
>>> Traceback (most recent call last):
>>>   File "./run.py", line 12, in <module>
>>>     from common import test, TestCase
>>>   File
>>> "/home/nwagner/svn/Mayavi_3.1.1/Mayavi_3.1.1/integrationtests/
>>> mayavi/common.py",
>>> line 17, in <module>
>>>     from enthought.pyface.api import GUI
>>>   File
>>> "/home/nwagner/local/lib64/python2.6/site-packages/
>>> TraitsGUI-3.0.5.dev_r24077-py2.6.egg/enthought/pyface/api.py",
>>> line 18, in <module>
>>>     from clipboard import clipboard, Clipboard
>>>   File
>>> "/home/nwagner/local/lib64/python2.6/site-packages/
>>> TraitsGUI-3.0.5.dev_r24077-py2.6.egg/enthought/pyface/clipboard.py",
>>> line 23, in <module>
>>>     clipboard = Clipboard()
>>>   File
>>> "/home/nwagner/local/lib64/python2.6/site-packages/
>>> TraitsGUI-3.0.5.dev_r24077-py2.6.egg/enthought/pyface/toolkit.py",
>>> line 87, in __init__
>>>     raise NotImplementedError("the %s pyface backend
(Continue reading)

Nils Wagner | 1 Aug 11:15
Picon
Favicon

Trouble with runtests.py

Hi all,

I am using the latest svn version of mayavi.
If I run runtest.py I get
nwagner <at> linux-mogv:~/svn/Mayavi_3.1.1/Mayavi_3.1.1/enthought/mayavi/tests> 
./runtests.py
----------------------------------------------------------------------
Running TVTK tests.
...........................................................F.......................
----------------------------------------------------------------------
Ran 83 tests in 60.84 seconds

FAILED: there were 1 failures and 0 errors
File: 
/home/nwagner/local/lib64/python2.6/site-packages/Mayavi-3.3.1.dev_r24427-py2.6-linux-x86_64.egg/enthought/tvtk/tests/test_tvtk.py

.................F.........
======================================================================
FAIL: Test if object cache works.
----------------------------------------------------------------------
Traceback (most recent call last):
   File

"/home/nwagner/local/lib64/python2.6/site-packages/Mayavi-3.3.1.dev_r24427-py2.6-linux-x86_64.egg/enthought/tvtk/tests/test_tvtk.py", 
line 190, in test_object_cache
     self.assertEqual(hash1 != hash(src), True)
AssertionError: False != True

----------------------------------------------------------------------
Ran 27 tests in 42.335s
(Continue reading)

Scott Sinclair | 1 Aug 11:29
Picon
Gravatar

Re: Trouble with runtests.py

> 2009/8/1 Nils Wagner <nwagner@...>:
> Hi all,
>
> I am using the latest svn version of mayavi.
> If I run runtest.py I get
> nwagner <at> linux-mogv:~/svn/Mayavi_3.1.1/Mayavi_3.1.1/enthought/mayavi/tests>
> ./runtests.py
> ----------------------------------------------------------------------
> Running TVTK tests.
> ...........................................................F.......................
> ----------------------------------------------------------------------
> Ran 83 tests in 60.84 seconds
>
> FAILED: there were 1 failures and 0 errors
> File:
> /home/nwagner/local/lib64/python2.6/site-packages/Mayavi-3.3.1.dev_r24427-py2.6-linux-x86_64.egg/enthought/tvtk/tests/test_tvtk.py
>
> .................F.........
> ======================================================================
> FAIL: Test if object cache works.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/home/nwagner/local/lib64/python2.6/site-packages/Mayavi-3.3.1.dev_r24427-py2.6-linux-x86_64.egg/enthought/tvtk/tests/test_tvtk.py",
> line 190, in test_object_cache
>     self.assertEqual(hash1 != hash(src), True)
> AssertionError: False != True
>
> ----------------------------------------------------------------------
> Ran 27 tests in 42.335s
(Continue reading)


Gmane