El jueves, 21 de marzo de 2013 15:59:04 UTC+1, Robert Cimrman escribió:
On 03/21/2013 03:45 PM, Angel Go?i Moreno wrote:
>
>
> El jueves, 21 de marzo de 2013 14:52:57 UTC+1, Robert Cimrman escribi?:

>> After installing everything, I run $ ./simple.py
>>> examples/diffusion/poisson.py as the tutorial says. The file
>> cylinder.vtk is
>>> created. Then I run ./postproc.py cylinder.vtk but when I do so I get
>> the
>>> next error:
>>>
>>> *traits.trait_errors.TraitError: The 'current_scene' trait of an Engine
>>> instance must be a Scene or None, but a value of
>>> <enthought.mayavi.core.scene.Scene object at 0xc6ff6b0> <class
>>> 'enthought.mayavi.core.scene.Scene'> was specified.*
>>
>> Could you post the whole error message (if there is), so that we can see
>> the
>> line numbers?
>>
>
> /home/angel/Escritorio/PDE/etsproxy/enthought/__init__.py:7:
> DeprecationWarning: enthought namespace imports are deprecated
>    DeprecationWarning)
> Traceback (most recent call last):
>    File "./postproc.py", line 444, in <module>
>      main()
>    File "./postproc.py", line 437, in main
>      view = view_file(filenames, filter_names, options)
>    File "./postproc.py", line 250, in view_file
>      domain_specific=options.domain_specific)
>    File
> "/home/angel/Escritorio/PDEs/sfepy-master/sfepy/postprocess/viewer.py",
> line 837, in call_mlab
>      self.engine.current_scene = self.scene
>    File "/home/angel/Escritorio/PDE/traits/traits/trait_types.py", line
> 2724, in validate
>      self.validate_failed( object, name, value )
>    File "/home/angel/Escritorio/PDE/traits/traits/trait_types.py", line
> 2555, in validate_failed
>      self.error( object, name, value )
>    File "/home/angel/Escritorio/PDE/traits/traits/trait_handlers.py", line
> 170, in error
>      value )
> traits.trait_errors.TraitError: The 'current_scene' trait of an Engine
> instance must be a Scene or None, but a value of
> <enthought.mayavi.core.scene.Scene object at 0xa886cb0> <class
> 'enthought.mayavi.core.scene.Scene'> was specified.

Well, I do not really understand this error message - it says the trait has to
be Scene, and complains that it is enthought.mayavi.core.scene.Scene, which has
been exactly the same thing...

>>
>> What is yout Mayavi version?
>>
> 4.2.1

... in versions of mayavi <= 4.0.0. I cannot debug this easily, as I have the
lastest packaged version and installing mayavi's stack manually has been rather
painful. I guess you downgrading for the moment is equally inconvenient for
you, right? Maybe you could ask the Enthought guys directly
(enth...@enthought.com) what changed between 4.0.0 and 4.2.1 in handling
the current_scene' trait of an Engine.

Buf! I would rather not downgrade mayavi now that something works at least :-) I will email Enthought directly and will post here their reply. 

>>
>>>
>>> I can run mayavi first and then load the file cylinder.vtk but it shows
>> the
>>> cylinder all blue and not as in the tutorial online.
>>
>> So you used the surface module to see something, right? The click on the
>> file
>> name and change "Point scalars name" from "node_groups" to "t" and you
>> should
>> see the temperature distribution. Does it help?
>>
> It works!!

Ok, something works at least!

It does. Btw, is it the same thing? I mean, but drawing the file in this way, do I get the same info/result as with the postproc.py order? 

r.

Cheers,
A.