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 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 () /usr/lib/python2.7/site-packages/mayavi/tools/pipe_base.py in the_function(*args, **kwargs) /usr/lib/python2.7/site-packages/mayavi/tools/decorations.py in init(self, x, y, text, **kwargs) /usr/lib/python2.7/site-packages/mayavi/tools/pipebase.py in __init(self, parent, **kwargs) /usr/lib/python2.7/site-packages/traits/trait_types.pyc in create_default_value(self, *args, **kw) /usr/lib/python2.7/site-packages/mayavi/core/module.py in init(self, **traits) ---> 58 self.setuppipeline() /usr/lib/python2.7/site-packages/mayavi/modules/text.py in setup_pipeline(self) /usr/lib/python2.7/site-packages/traits/has_traits.pyc in trait_set(self, trait_change_notify, **traits) 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 |
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:
_______________________________________________ Enthought-Dev mailing list [hidden email] https://mail.enthought.com/mailman/listinfo/enthought-dev |
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:
_______________________________________________ Enthought-Dev mailing list [hidden email] https://mail.enthought.com/mailman/listinfo/enthought-dev |
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. Thanks for the update. I understand you're all very busy. I will be waiting. CHEN, Xing / 陈醒
_______________________________________________ Enthought-Dev mailing list [hidden email] https://mail.enthought.com/mailman/listinfo/enthought-dev |
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 |
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 |
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:
_______________________________________________ Enthought-Dev mailing list [hidden email] https://mail.enthought.com/mailman/listinfo/enthought-dev |
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 |
On Sun, Jul 8, 2012 at 10:45 PM, Gael Varoquaux <[hidden email]> wrote:
Which version is known to work? 5.8.0? Thanks. CHEN, Xing / 陈醒
_______________________________________________ Enthought-Dev mailing list [hidden email] https://mail.enthought.com/mailman/listinfo/enthought-dev |
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 |
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 / 陈醒
_______________________________________________ Enthought-Dev mailing list [hidden email] https://mail.enthought.com/mailman/listinfo/enthought-dev |
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 |
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:
_______________________________________________ Enthought-Dev mailing list [hidden email] https://mail.enthought.com/mailman/listinfo/enthought-dev |
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 |
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 |
Free forum by Nabble | Edit this page |