Prabhu Ramachandran wrote:
Francesco Poli wrote:
then left-click on the (now childless) Modules entry
and choose Visualize -> Modules -> ContourGridPlane from
menus:
* TVTK Scene 1
* PLOT3D:tiny.xyz, tiny.q
* Modules
* Surface
* PLOT3D:tiny.xyz, tiny.q
* Modules
* ContourGridPlane
At this point, as soon as I left-click on the ContourGridPlane
module, I get a debugger window (see attached screenshot inspector.png)
and cannot see any ContourGridPlane properties in the MayaVi
object editor pane...
OK, this is a bug that we are aware of but will take a little while to
get sorted out. Thanks for the report though.
I think I've found the problem and fixed it in the
enthought.traits.ui.wx_2.0.5 branch that I just made. The problem in
your case is that there is only one value of the scalar, so the high and
low limits are the same leading to the floating point division error.
Here is a patch you need to make to
enthought/traits/ui/wx/range_editor.py (where it is installed)
alternatively get this from the branch.
The bug should therefore be closed as far as upstream is concerned.
Varun already filed a ticket for improving the multi-block support which
we'll get to later.
cheers,
prabhu
Index: enthought/traits/ui/wx/range_editor.py
===================================================================
--- enthought/traits/ui/wx/range_editor.py (revision 18680)
+++ enthought/traits/ui/wx/range_editor.py (working copy)
@@ -515,7 +515,10 @@
except:
fvalue_text = ''
fvalue = low
- ivalue = int( (float( fvalue - low ) / (high - low)) * 10000 )
+ if high > low:
+ ivalue = int( (float( fvalue - low ) / (high - low)) * 10000 )
+ else:
+ ivalue = low
# Lower limit label:
label_lo = wx.StaticText( panel, -1, '999999' )
@@ -648,7 +651,10 @@
self._set_format()
self.control.label_lo.SetLabel( self._format % low )
self.control.label_hi.SetLabel( self._format % high )
- ivalue = int( (float( value - low ) / (high - low)) * 10000.0 )
+ if high > low:
+ ivalue = int( (float( value - low ) / (high - low)) * 10000 )
+ else:
+ ivalue = low
self.control.slider.SetValue( ivalue )
text = self._format % self.value
self.control.text.SetValue( text )