Erik Tollerud | 4 Jul 03:01

[Chaco] multiple modes of scatter selection/dynamically changing list of Instances

I'm developing an app that uses Chaco, and I've encountered a few
problems that I'm not clear on how to solve:

1. One of the Chaco plots involves a bunch of scatterplot points, and
I would like to be able to give the user the option to use either the
RangeSelection tool, the LassoSelection tool, or the ScatterInspector
tools to select points that a later operation will be performed upon.
Is it possible to have all of these operating simultaneously?  (e.g.
bound to different mouse buttons, or something like that?)

2. Once a set of points are selected, I would like the user to be able
to use a keystroke to perform operations on the points.  I understand
how to set up Buttons or Events to do this, but is there a simple way
to bind events to keystrokes?

3. The app also involves having a number of plots (instances of a
HasTraits object) that are contained in a list... I would like to be
able to dynamically update the View of the main app object so that if
more instances are added to the list, it will dynamically add an extra
panel to a particular Group in the View (or show a special panel if
they all vanish).  Right now I'm using the ListEditor with
use_notebook =True, which works OK, but I would like to be able to
have more than one of the list items visible at once, if possible.  Do
I need to implement a special Handler, or something?  I tried writing
a function that would generate a new View when the list is changed,
but I couldn't figure out how to get it to add items in the list. I
tried using Group(Item('lst.0',editor=IntanceEditor(),style=custom),Item('lst.0',editor=IntanceEditor(),style=custom)),
but that didn't work at all (the spaces where the Items were supposed
to be were empty and the UI didn't work at all).
(Continue reading)

Erik Tollerud | 4 Jul 02:36

[Traits] Subclassing nested container types.

Is there a way to subclass composite types of container traits and
keep all the validation intact?  That is, right now, I have a trait
that I initialize in the class as "List(Tuple(Int,Int))", that is, it
must be a list of 2-tuples that contain only integers.  I would like
to add an extra step of validation, though, that constrains
specifically what set of integers are allowed in the tuples, as well
as (maybe) the length of the list.  My natural thought was to make a
subclass of the List trait, but is there any way to subclass it that
will retain the checking for 2-tuples of only int type?
lin | 3 Jul 18:59

Help for change the color precision in imageplot with a colorbar

Hi, everyone,

        I met a problem in changing the color precision in imageplot 
with a colorbar corresponded.  As we know,  a color represents a range 
of values in the imageplot so I want to reduce the number of the 
colors.  The definition of this conception is in the ColorMapper which 
has an attribute, steps(value default is 256).  To change the color 
precision of a colorbar,  I can motiify "steps" to reduce the number of 
colors present in the colorbar, but the imageplot does not change when 
the colorbar color precision changed.  How to change the number of 
colors  representing in the imageplot?

Thanks  a lot for any help,

Lin
lin | 3 Jul 18:00

Help for a problem of chaco containers

Hi, everybody,

    I tried to put an image plot , a colorbar  and a title of colorbar 
into a HPlotContainer(blue one). In order to put the title of the 
colorbar in the top of the colorbar, I put the title of colorbar and the 
colorbar into a VPlotContainer(red one). I got the arrangement I want, 
but the result is not so perfect: there is a space in the right empty. I 
wonder how to eliminate the space in the right to make it look more pretty.

Thanks a lot for any help,

Lin

Attachment (test_container.py): text/x-python, 3044 bytes
_______________________________________________
Enthought-Dev mailing list
Enthought-Dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev
pankaj pandey | 3 Jul 16:00
Favicon

Different editor style in TupleEditor + few issues

Hi all,

I've been dabbling with enthought tools for some time now, its really great and
i'm thankful to all the developers.
I have a problem that i'm not able to figure out how to put a readonly text
field in a tuple. I think i need something like this

class A(HasTraits):
    #parameter,value,unit
    l = List(Tuple(String,Float,String))
    traits_view = View(Item('l', editor=ListEditor(mutable=False,
                    editor=TupleEditor(cols=3, editors=(TextEditor(),
                            TextEditor(evaluate=float), TextEditor())))))
a = A()
a.l.append(('Mach No',1.6,''))
a.l.append(('Temperature',380,'K'))
a.configure_traits()

What i want is that the user should not be able to edit the parameter and unit
of the tuple. I'm using list instead of defining the variables explicitly
because they are initialized from a different code at runtime. For example i
need something like
TupleEditor(editors=[...], styles=[...])
or maybe some better way to do this.

Also, i would like to suggest a change in the trait type of 
enthought.pyface.workbench.traits_ui_view.TraitsUIView.view
from Str to Any or something more appropriate (Str or View)
This is because something like below does not work currently

(Continue reading)

Zaven Arzoumanian | 3 Jul 15:45
Favicon

unintended notification recursion

Hi folks,

It seems I've coded myself into a corner.

See the attached partial screenshot of a panel from my Chaco-based
application. The various controls determine how a 2D dataset is binned
into a colormapped image. The point is to allow the user to choose the
number of bins, image boundaries, etc. The problem is that the user's
input for one trait has to change some of the other traits, which
triggers the notification handler in an endless loop.

I'm using extended traits names to register the handlers. This works
fine for the group labeled Filtering, but none of those traits depend
on each other. In the X and Y Imaging groups, changing the binning
boundaries for a fixed number of bins, for example, changes the bin
size. Each time the handler tries to adjust one of these traits
attributes, it gets called again, and I end up in an endless loop.

In hindsight, this should have been an obvious problem. What's less
obvious to me is how I can get around it. I've tried "unhooking" the
handler with the remove=True keyword in on_trait_change within the
handler, but that didn't work.

Any advice would be very welcome! If none of this makes any sense, I
can send a code snippet, but I'm pressed for time just before a trip
and was hoping someone had a quick solution.

Thanks!

Zaven
(Continue reading)

Range and Editor

Hi folks, 2 simple question:

1- How to get rid of the textbox in the Range editor
2- How to fix a RangeEditor style, for example, to a spinner or
xspinner using int ranges?

--

-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-----------------------------------------------------------------
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-----------------------------------------------------------------
_______________________________________________
Enthought-Dev mailing list
Enthought-Dev <at> mail.enthought.com
https://mail.enthought.com/mailman/listinfo/enthought-dev
David Martin | 2 Jul 22:18

Mayavi test_extract_grid_filter.py

Mayavi/enthought/mayavi/tests/test_extract_grid_filter has two tests 
which examine the bounds of 3 different GridPlane objects as the 
attributes of the ExtractGrid object to which they are registered are 
modified. When the bounds of the GridPlane objects are retrieved (ie. 
gpx.actor.actor.bounds) all values in the tuple returned are less than 
the expected values by 100.

For instance, the first assert is the following:
self.assertEqual(allclose(gpx.actor.actor.bounds, (100.0, 100.0, 100.0, 
200.0, 100.0, 200.0)), True)

gpx.actor.actor.bounds returns:
(0.0, 0.0, 0.0, 100.0, 0.0, 100.0)

The same behavior described above applies to the rest of the 
actor.actor.bounds calls in the file. Is this due to an intentional 
change in Mayavi/tvtk or is this an error?

-David
Szymon Stoma | 2 Jul 18:06

tvtk window camera restriction

Hello, 


is there an easy way to block the camera rotation? i am using the tvtk class to display the window (SplitApplicationWindow) with a DecoratedScene inside. i would like to allow the user only for all camera movements which preserve the view axis perpendicular to x,y plane. i would like to do it to simulate the 2d view. is there an elegant way to do it?

thank you for any ideas.
_______________________________________________
Enthought-Dev mailing list
Enthought-Dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev
reckoner | 2 Jul 16:15

Traits: Getting List(int) to report on removed or popped elements. Possible?

I am getting started with traits and I would like to use

class NodeList(HasTraits):
nodes = List(int)
<at> on_trait_change('nodes[]')
def _changed(self,name,new,old):
print 'Nodelist'

which works fine. however, when I do:

>> nl=NodeList(nodes=range(10))
>> nl.remove(3)

I would like to know which element in the list has been removed ( in this
example,'3'). how can I do this? On the other hand, when I do:

>> nl.append(3)

I CAN get Information that the element '3' has been added to the list
via the _changed() callback.

Then, how can I get nl.remove(3) and maybe even nl.pop() to report which
elements have been removed?

thanks in advance.

_______________________________________________
Enthought-Dev mailing list
Enthought-Dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev
Brian Zambrano | 1 Jul 23:54

easy_install ETS problem

Hi all,

I literally just got looking at ETS today, and wanted to begin exploring it a bit.  Unfortunately, it looks like the easy_install is broken, or more specifically, the insaller for Mayavi.   easy_install fails when it gets to Mayavi, and the Mayavi install fails when I try to install it alone.  I'm on OS X 10.5.7.

The error (which I've never seen in any python install) is:

Warning: distutils distribution has been initialized, it may be too late to add a subpackage enthought
error: Setup script exited with error: SandboxViolation: os.open('/var/folders/S4/S4v7nIuvHeWzArmtCCrq7U+++TI/-Tmp-/easy_install-xH_RkR/SciMath-3.0.3/temp/tmpNPTYq8/xGyjPx', 2818, 384) {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.

Any advice appreciated,
BZ

_______________________________________________
Enthought-Dev mailing list
Enthought-Dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev

Gmane