mlab.text fails

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

mlab.text fails

CHEN Xing

Hi,

I found that mlab.text becomes unusable after upgrade to 4.2. Is it a known problem? Thanks!

The report is also available at: https://github.com/enthought/mayavi/issues/35


from mayavi import mlab
mlab.text(0.1, 0.1, "test")

cause an error in MayaVi 4.2. (The code ran well before)

The error is pasted. Is it a bug?

/local_data/chenxing/capture/2012_06_05/ in ()
----> 1 mlab.text(0.1, 0.1, "asdfsf")

/usr/lib/python2.7/site-packages/mayavi/tools/pipe_base.py in the_function(*args, **kwargs)
35 def make_function(factory_class):
36 def the_function(*args, **kwargs):
---> 37 factory = factory_class(*args, **kwargs)
38 return factory._target
39

/usr/lib/python2.7/site-packages/mayavi/tools/decorations.py in init(self, x, y, text, **kwargs)
468 raise ValueError('Text positions should be in [0, 1] if no z'
469 'position is given')
--> 470 super(Text, self).init(None, **kwargs)
471 self._target.text = text
472 self._target.x_position = x

/usr/lib/python2.7/site-packages/mayavi/tools/pipebase.py in __init(self, parent, **kwargs)
142 self._do_redraw = not scene.disable_render
143 scene.disable_render = True
--> 144 if issubclass(self._target.
class_, Filter):
145 self._engine.add_filter(self._target, obj=parent)
146 else:

/usr/lib/python2.7/site-packages/traits/trait_types.pyc in create_default_value(self, *args, **kw)
2776 raise TraitError, 'Unable to locate class: ' + args[0]
2777
-> 2778 return klass( *args[1:], **kw )
2779
2780 #: fixme: Do we still need this method using the new style?...

/usr/lib/python2.7/site-packages/mayavi/core/module.py in init(self, **traits)
56
57 # Let the module setup its pipeline.

---> 58 self.setuppipeline()
59
60 def __get_pure_state
_(self):

/usr/lib/python2.7/site-packages/mayavi/modules/text.py in setup_pipeline(self)
156 actor.set(text_scale_mode='prop', width=0.4, height=1.0)
157 else:
--> 158 actor.set(scaled_text=True, width=0.4, height=1.0)
159
160 c = actor.position_coordinate

/usr/lib/python2.7/site-packages/traits/has_traits.pyc in trait_set(self, trait_change_notify, **traits)
1950 else:
1951 for name, value in traits.items():
-> 1952 setattr( self, name, value )
1953
1954 return self

TraitError: Cannot set the undefined 'scaled_text' attribute of a 'TextActor' object.



CHEN, Xing / 陈醒

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

CHEN Xing
Could somebody please give some ideas on this? I've been stuck here for nearly a month. mlab.text() seems to be a very basic function, but is really useful to annotate figures. The bug is also very easy to reproduce, just do this in MayaVi:
 from mayavi import mlab
 mlab.text(0.1, 0.1, "test")

Thanks!

CHEN, Xing / 陈醒


On Tue, Jul 3, 2012 at 9:19 PM, CHEN Xing <[hidden email]> wrote:

Hi,

I found that mlab.text becomes unusable after upgrade to 4.2. Is it a known problem? Thanks!

The report is also available at: https://github.com/enthought/mayavi/issues/35


from mayavi import mlab
mlab.text(0.1, 0.1, "test")

cause an error in MayaVi 4.2. (The code ran well before)

The error is pasted. Is it a bug?

/local_data/chenxing/capture/2012_06_05/ in ()
----> 1 mlab.text(0.1, 0.1, "asdfsf")

/usr/lib/python2.7/site-packages/mayavi/tools/pipe_base.py in the_function(*args, **kwargs)
35 def make_function(factory_class):
36 def the_function(*args, **kwargs):
---> 37 factory = factory_class(*args, **kwargs)
38 return factory._target
39

/usr/lib/python2.7/site-packages/mayavi/tools/decorations.py in init(self, x, y, text, **kwargs)
468 raise ValueError('Text positions should be in [0, 1] if no z'
469 'position is given')
--> 470 super(Text, self).init(None, **kwargs)
471 self._target.text = text
472 self._target.x_position = x

/usr/lib/python2.7/site-packages/mayavi/tools/pipebase.py in __init(self, parent, **kwargs)
142 self._do_redraw = not scene.disable_render
143 scene.disable_render = True
--> 144 if issubclass(self._target.
class_, Filter):
145 self._engine.add_filter(self._target, obj=parent)
146 else:

/usr/lib/python2.7/site-packages/traits/trait_types.pyc in create_default_value(self, *args, **kw)
2776 raise TraitError, 'Unable to locate class: ' + args[0]
2777
-> 2778 return klass( *args[1:], **kw )
2779
2780 #: fixme: Do we still need this method using the new style?...

/usr/lib/python2.7/site-packages/mayavi/core/module.py in init(self, **traits)
56
57 # Let the module setup its pipeline.

---> 58 self.setuppipeline()
59
60 def __get_pure_state
_(self):

/usr/lib/python2.7/site-packages/mayavi/modules/text.py in setup_pipeline(self)
156 actor.set(text_scale_mode='prop', width=0.4, height=1.0)
157 else:
--> 158 actor.set(scaled_text=True, width=0.4, height=1.0)
159
160 c = actor.position_coordinate

/usr/lib/python2.7/site-packages/traits/has_traits.pyc in trait_set(self, trait_change_notify, **traits)
1950 else:
1951 for name, value in traits.items():
-> 1952 setattr( self, name, value )
1953
1954 return self

TraitError: Cannot set the undefined 'scaled_text' attribute of a 'TextActor' object.



CHEN, Xing / 陈醒


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

Jonathan March
Hi Xing, I'm sorry that you've been having this trouble. Just to let you know, the two strongest mayavi experts, Prabhu and Gael, both have limited availability right now. If you don't get a response sooner, please feel free to ping again in a week or two. 
Jonathan

On Thu, Jul 5, 2012 at 2:14 PM, CHEN Xing <[hidden email]> wrote:
Could somebody please give some ideas on this? I've been stuck here for nearly a month. mlab.text() seems to be a very basic function, but is really useful to annotate figures. The bug is also very easy to reproduce, just do this in MayaVi:
 from mayavi import mlab
 mlab.text(0.1, 0.1, "test")

Thanks!

CHEN, Xing / 陈醒



On Tue, Jul 3, 2012 at 9:19 PM, CHEN Xing <[hidden email]> wrote:

Hi,

I found that mlab.text becomes unusable after upgrade to 4.2. Is it a known problem? Thanks!

The report is also available at: https://github.com/enthought/mayavi/issues/35


from mayavi import mlab
mlab.text(0.1, 0.1, "test")

cause an error in MayaVi 4.2. (The code ran well before)

The error is pasted. Is it a bug?

/local_data/chenxing/capture/2012_06_05/ in ()
----> 1 mlab.text(0.1, 0.1, "asdfsf")

/usr/lib/python2.7/site-packages/mayavi/tools/pipe_base.py in the_function(*args, **kwargs)
35 def make_function(factory_class):
36 def the_function(*args, **kwargs):
---> 37 factory = factory_class(*args, **kwargs)
38 return factory._target
39

/usr/lib/python2.7/site-packages/mayavi/tools/decorations.py in init(self, x, y, text, **kwargs)
468 raise ValueError('Text positions should be in [0, 1] if no z'
469 'position is given')
--> 470 super(Text, self).init(None, **kwargs)
471 self._target.text = text
472 self._target.x_position = x

/usr/lib/python2.7/site-packages/mayavi/tools/pipebase.py in __init(self, parent, **kwargs)
142 self._do_redraw = not scene.disable_render
143 scene.disable_render = True
--> 144 if issubclass(self._target.
class_, Filter):
145 self._engine.add_filter(self._target, obj=parent)
146 else:

/usr/lib/python2.7/site-packages/traits/trait_types.pyc in create_default_value(self, *args, **kw)
2776 raise TraitError, 'Unable to locate class: ' + args[0]
2777
-> 2778 return klass( *args[1:], **kw )
2779
2780 #: fixme: Do we still need this method using the new style?...

/usr/lib/python2.7/site-packages/mayavi/core/module.py in init(self, **traits)
56
57 # Let the module setup its pipeline.

---> 58 self.setuppipeline()
59
60 def __get_pure_state
_(self):

/usr/lib/python2.7/site-packages/mayavi/modules/text.py in setup_pipeline(self)
156 actor.set(text_scale_mode='prop', width=0.4, height=1.0)
157 else:
--> 158 actor.set(scaled_text=True, width=0.4, height=1.0)
159
160 c = actor.position_coordinate

/usr/lib/python2.7/site-packages/traits/has_traits.pyc in trait_set(self, trait_change_notify, **traits)
1950 else:
1951 for name, value in traits.items():
-> 1952 setattr( self, name, value )
1953
1954 return self

TraitError: Cannot set the undefined 'scaled_text' attribute of a 'TextActor' object.



CHEN, Xing / 陈醒


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

CHEN Xing
On Thu, Jul 5, 2012 at 12:27 PM, Jonathan March <[hidden email]> wrote:
Hi Xing, I'm sorry that you've been having this trouble. Just to let you know, the two strongest mayavi experts, Prabhu and Gael, both have limited availability right now. If you don't get a response sooner, please feel free to ping again in a week or two. 
Jonathan

Thanks for the update. I understand you're all very busy. I will be waiting.

CHEN, Xing / 陈醒
 

On Thu, Jul 5, 2012 at 2:14 PM, CHEN Xing <[hidden email]> wrote:
Could somebody please give some ideas on this? I've been stuck here for nearly a month. mlab.text() seems to be a very basic function, but is really useful to annotate figures. The bug is also very easy to reproduce, just do this in MayaVi:
 from mayavi import mlab
 mlab.text(0.1, 0.1, "test")

Thanks!

CHEN, Xing / 陈醒



On Tue, Jul 3, 2012 at 9:19 PM, CHEN Xing <[hidden email]> wrote:

Hi,

I found that mlab.text becomes unusable after upgrade to 4.2. Is it a known problem? Thanks!

The report is also available at: https://github.com/enthought/mayavi/issues/35


from mayavi import mlab
mlab.text(0.1, 0.1, "test")

cause an error in MayaVi 4.2. (The code ran well before)

The error is pasted. Is it a bug?

/local_data/chenxing/capture/2012_06_05/ in ()
----> 1 mlab.text(0.1, 0.1, "asdfsf")

/usr/lib/python2.7/site-packages/mayavi/tools/pipe_base.py in the_function(*args, **kwargs)
35 def make_function(factory_class):
36 def the_function(*args, **kwargs):
---> 37 factory = factory_class(*args, **kwargs)
38 return factory._target
39

/usr/lib/python2.7/site-packages/mayavi/tools/decorations.py in init(self, x, y, text, **kwargs)
468 raise ValueError('Text positions should be in [0, 1] if no z'
469 'position is given')
--> 470 super(Text, self).init(None, **kwargs)
471 self._target.text = text
472 self._target.x_position = x

/usr/lib/python2.7/site-packages/mayavi/tools/pipebase.py in __init(self, parent, **kwargs)
142 self._do_redraw = not scene.disable_render
143 scene.disable_render = True
--> 144 if issubclass(self._target.
class_, Filter):
145 self._engine.add_filter(self._target, obj=parent)
146 else:

/usr/lib/python2.7/site-packages/traits/trait_types.pyc in create_default_value(self, *args, **kw)
2776 raise TraitError, 'Unable to locate class: ' + args[0]
2777
-> 2778 return klass( *args[1:], **kw )
2779
2780 #: fixme: Do we still need this method using the new style?...

/usr/lib/python2.7/site-packages/mayavi/core/module.py in init(self, **traits)
56
57 # Let the module setup its pipeline.

---> 58 self.setuppipeline()
59
60 def __get_pure_state
_(self):

/usr/lib/python2.7/site-packages/mayavi/modules/text.py in setup_pipeline(self)
156 actor.set(text_scale_mode='prop', width=0.4, height=1.0)
157 else:
--> 158 actor.set(scaled_text=True, width=0.4, height=1.0)
159
160 c = actor.position_coordinate

/usr/lib/python2.7/site-packages/traits/has_traits.pyc in trait_set(self, trait_change_notify, **traits)
1950 else:
1951 for name, value in traits.items():
-> 1952 setattr( self, name, value )
1953
1954 return self

TraitError: Cannot set the undefined 'scaled_text' attribute of a 'TextActor' object.



CHEN, Xing / 陈醒


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

Didrik Pinte-2
In reply to this post by CHEN Xing
On 5 July 2012 21:14, CHEN Xing <[hidden email]> wrote:

> Could somebody please give some ideas on this? I've been stuck here for
> nearly a month. mlab.text() seems to be a very basic function, but is really
> useful to annotate figures. The bug is also very easy to reproduce, just do
> this in MayaVi:
>  from mayavi import mlab
>  mlab.text(0.1, 0.1, "test")
>
> Thanks!
>
> CHEN, Xing / 陈醒

Hi Xing,

I can't replicate the issue on my system (MacOS, EPD 7.2 and latest
Mayavi 4.2.1).

How did you upgrade Mayavi? Are you using EPD? A source installation?

-- Didrik
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

Gael Varoquaux
On Fri, Jul 06, 2012 at 11:23:10AM +0200, Didrik Pinte wrote:
> I can't replicate the issue on my system (MacOS, EPD 7.2 and latest
> Mayavi 4.2.1).

I think that the relevent information is: what is the VTK version? You
can retrieve it using::

    from tvtk.api import tvtk
    v = tvtk.Version()
    print v.vtk_version

Also, to help me fix the problem, can you give me the output of:

    a = tvtk.TextActor()
    a.print_traits()

Thanks,

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

CHEN Xing
Thank you very much for the update.

I'm a Linux user, and I updated Mayavi via Archlinux's AUR system. I believe I updated vtk before updating Mayavi.

The version of VTK is 5.10.0. The version of Mayavi is 4.2.0 (which is the latest tagged version on github).

Traits of a tvtk.TextActor(), there is a scaled_text_property, but no scaled_text_property.

a.scaled_text="adsfsdf" will raise a similar error:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
traits.trait_errors.TraitError: Cannot set the undefined 'scaled_text' attribute of a 'TextActor' object.

Hope that helps. Thanks.

_in_set:                     0
_vtk_obj:                    (vtkTextActor)0x49e2578
actual_position2_coordinate: <tvtk.tvtk_classes.coord...te object at 0x4e64350>
actual_position_coordinate:  <tvtk.tvtk_classes.coord...te object at 0x4e64350>
alignment_point:             0
allocated_render_time:       10.0
bounds:                      None
class_name:                  'vtkTextActor'
debug:                       0
debug_:                      0
dragable:                    1
dragable_:                   1
estimated_render_time:       0.0
global_warning_display:      1
global_warning_display_:     1
height:                      0.5
input:                       None
layer_number:                0
m_time:                      187
mapper:                      <tvtk.tvtk_classes.open_...2D object at 0x4e64350>
matrix:                      None
maximum_line_height:         1.0
minimum_size:                array([10, 10])
next_path:                   None
number_of_consumers:         0
number_of_paths:             1
orientation:                 0.0
pickable:                    1
pickable_:                   1
position:                    array([ 0.,  0.])
position2:                   array([ 0.5,  0.5])
position2_coordinate:        <tvtk.tvtk_classes.coord...te object at 0x4e64350>
position_coordinate:         <tvtk.tvtk_classes.coord...te object at 0x4e64350>
property:                    <tvtk.tvtk_classes.prope...2D object at 0x4e64350>
property_keys:               None
redraw_m_time:               187
reference_count:             1
render_time_multiplier:      1.0
scaled_text_property:        <tvtk.tvtk_classes.text_...ty object at 0x4e64350>
supports_selection:          False
text_property:               <tvtk.tvtk_classes.text_...ty object at 0x4e64350>
text_scale_mode:             'none'
use_border_align:            0
use_border_align_:           0
use_bounds:                  True
use_bounds_:                 1
visibility:                  1
visibility_:                 1
width:                       0.5



CHEN, Xing / 陈醒


On Fri, Jul 6, 2012 at 3:09 AM, Gael Varoquaux <[hidden email]> wrote:
On Fri, Jul 06, 2012 at 11:23:10AM +0200, Didrik Pinte wrote:
> I can't replicate the issue on my system (MacOS, EPD 7.2 and latest
> Mayavi 4.2.1).

I think that the relevent information is: what is the VTK version? You
can retrieve it using::

    from tvtk.api import tvtk
    v = tvtk.Version()
    print v.vtk_version

Also, to help me fix the problem, can you give me the output of:

    a = tvtk.TextActor()
    a.print_traits()

Thanks,

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

Gael Varoquaux
On Fri, Jul 06, 2012 at 01:25:53PM -0700, CHEN Xing wrote:
>    The version of VTK is 5.10.0.

That's why we cannot reproduce.

I'll try to find time to build it.

Cheers,

Gael
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

CHEN Xing

On Sun, Jul 8, 2012 at 10:45 PM, Gael Varoquaux <[hidden email]> wrote:
On Fri, Jul 06, 2012 at 01:25:53PM -0700, CHEN Xing wrote:
>    The version of VTK is 5.10.0.

That's why we cannot reproduce.

I'll try to find time to build it.
 
Which version is known to work? 5.8.0? Thanks.


CHEN, Xing / 陈醒

 

Cheers,

Gael
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

Gael Varoquaux
On Mon, Jul 09, 2012 at 12:38:03AM -0700, CHEN Xing wrote:
>      On Fri, Jul 06, 2012 at 01:25:53PM -0700, CHEN Xing wrote:
>      >    The version of VTK is 5.10.0.

>      That's why we cannot reproduce.

>      I'll try to find time to build it.

>     
>    Which version is known to work? 5.8.0? Thanks.

5.8.0 does work.

Gael
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

CHEN Xing
On Mon, Jul 9, 2012 at 12:41 AM, Gael Varoquaux <[hidden email]> wrote:
5.8.0 does work.

Thank you. I tried to compile VTK 5.8.0 and it works, except for a problem: if I do mlab.text before plotting anything, I will get an error pop up: 
   "No data: cannot use a Filter/Module/ModuleManager."
The text won't show up even if I plot something later. This wasn't a problem for previous mayavi.

Besides, the document on http://docs.enthought.com/mayavi/mayavi/mlab.html has a tiny bug, the command line to start ipython2 should be:
 ipython2 --gui=wx
two dashes are required for the latest ipython.

Also, it will be nice to see Mayavi working with VTK 5.10 :)

CHEN, Xing / 陈醒

 

Gael
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

Gael Varoquaux
On Mon, Jul 09, 2012 at 02:32:22PM -0700, CHEN Xing wrote:
>    Thank you. I tried to compile VTK 5.8.0 and it works, except for a
>    problem: if I do mlab.text before plotting anything, I will get an error
>    pop up: 
>       "No data: cannot use a Filter/Module/ModuleManager."
>    The text won't show up even if I plot something later. This wasn't a
>    problem for previous mayavi.

Actually, I do believe it was. It's a fundemental limitation of the way
the text module is architectured in mlab.

>    Besides, the document
>    on [2]http://docs.enthought.com/mayavi/mayavi/mlab.html has a tiny bug,
>    the command line to start ipython2 should be:
>     ipython2 --gui=wx
>    two dashes are required for the latest ipython.

OK, will fix.

>    Also, it will be nice to see Mayavi working with VTK 5.10 :)

Agreed. I am just unsure how to find time to deal with this on top of my
day work and a few other open source projects. Some people have been
giving me some helping hand. If you are reading this, thanks :)

G
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

CHEN Xing
You're right. I was using a work around, calling mlab.plot3d(0, 0, 0) first to make mlab.text work. The same trick still works.

Thank you for the help and good luck with your work! 

CHEN, Xing / 陈醒


On Mon, Jul 9, 2012 at 2:39 PM, Gael Varoquaux <[hidden email]> wrote:
On Mon, Jul 09, 2012 at 02:32:22PM -0700, CHEN Xing wrote:
>    Thank you. I tried to compile VTK 5.8.0 and it works, except for a
>    problem: if I do mlab.text before plotting anything, I will get an error
>    pop up: 
>       "No data: cannot use a Filter/Module/ModuleManager."
>    The text won't show up even if I plot something later. This wasn't a
>    problem for previous mayavi.

Actually, I do believe it was. It's a fundemental limitation of the way
the text module is architectured in mlab.

>    Besides, the document
>    on [2]http://docs.enthought.com/mayavi/mayavi/mlab.html has a tiny bug,
>    the command line to start ipython2 should be:
>     ipython2 --gui=wx
>    two dashes are required for the latest ipython.

OK, will fix.

>    Also, it will be nice to see Mayavi working with VTK 5.10 :)

Agreed. I am just unsure how to find time to deal with this on top of my
day work and a few other open source projects. Some people have been
giving me some helping hand. If you are reading this, thanks :)

G
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

Martin Luessi
In reply to this post by Gael Varoquaux
I can confirm that mlab.text() doesn't work with VTK 5.10.

The problem is the version comparison. Specifically, the code converts
the first 3 characters of the version string to float and then does a
comparison "VTK_VER > 5.1", which is False while it should be true. In
my opinion, using floats for version number is a bit crude and prone
to breaking (e.g. we have "float('5.8') > float('5.10')"). A possible
solution for this problem is in this branch:

https://github.com/mluessi/mayavi/tree/vtk510_version

On Mon, Jul 9, 2012 at 5:39 PM, Gael Varoquaux
<[hidden email]> wrote:
> On Mon, Jul 09, 2012 at 02:32:22PM -0700, CHEN Xing wrote:
>>    Thank you. I tried to compile VTK 5.8.0 and it works, except for a
>>    problem: if I do mlab.text before plotting anything, I will get an error
>>    pop up:
>>       "No data: cannot use a Filter/Module/ModuleManager."
>>    The text won't show up even if I plot something later. This wasn't a
>>    problem for previous mayavi.

Yes, it works if you plot something else first, e.g.,

mlab.test_barchart()
mlab.text(0.1, 0.1, "test")

> Actually, I do believe it was. It's a fundemental limitation of the way
> the text module is architectured in mlab.
>>    Besides, the document
>>    on [2]http://docs.enthought.com/mayavi/mayavi/mlab.html has a tiny bug,
>>    the command line to start ipython2 should be:
>>     ipython2 --gui=wx
>>    two dashes are required for the latest ipython.
>
> OK, will fix.
>
>>    Also, it will be nice to see Mayavi working with VTK 5.10 :)
>
> Agreed. I am just unsure how to find time to deal with this on top of my
> day work and a few other open source projects. Some people have been
> giving me some helping hand. If you are reading this, thanks :)

I tried running the tests and there are definitely some tests that
fail. Most notably there is a "double free or corruption" which causes
Python to abort when testing deep-copying the visualization (not sure
where yet).

I can continue looking into making Mayavi work with VTK 5.10
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.text fails

Gael Varoquaux
On Mon, Jul 09, 2012 at 06:08:08PM -0400, Martin Luessi wrote:
> The problem is the version comparison. Specifically, the code converts
> the first 3 characters of the version string to float and then does a
> comparison "VTK_VER > 5.1", which is False while it should be true. In
> my opinion, using floats for version number is a bit crude and prone
> to breaking (e.g. we have "float('5.8') > float('5.10')"). A possible
> solution for this problem is in this branch:

> https://github.com/mluessi/mayavi/tree/vtk510_version

Thank you Martin, this is a simple and elegant solution. Good catch for
the version number!

I am merging this in (with a small rebase). Thanks heaps.

> > Agreed. I am just unsure how to find time to deal with this on top of my
> > day work and a few other open source projects. Some people have been
> > giving me some helping hand. If you are reading this, thanks :)

> I tried running the tests and there are definitely some tests that
> fail. Most notably there is a "double free or corruption" which causes
> Python to abort when testing deep-copying the visualization (not sure
> where yet).

> I can continue looking into making Mayavi work with VTK 5.10

That would be definitely useful. And I'll try to look into your mlab.text
problem.

Cheers,

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev