enthought

Python TraitsUI - how to control scrollbar position of a 'String' trait editor/view

泪湿孤枕 提交于 2019-12-11 07:22:17
问题 I'm using Traits 4 to build a simple interactive GUI application. This application will display a timestamped log of events in a dedicated part of the GUI. This log is currently stored as a String trait. The default editor (or View? Not sure on the exact nomenclature) for a String trait is a scrollable multi-line display widget. When the internal string value is changed, the widget updates to display the new value. If the length of the content exceeds the viewable size of the widget, then a

Change mlab quiver3d & surf data sources without clearing figure in traits script

久未见 提交于 2019-12-11 05:28:14
问题 I have a Traits and Mayavi script that presents an mlab scene and several traits editors. The editors affect what data is shown in a surface , quiver3d and legend (Scalar LUT Manager) by calling my drawing method. Each change triggers a clear figure and re-draw. Learning from the Mlab interactive dialog example the plot3d * uses mlab_source.set to change the data without clearing the figure and re-drawing. In update_plot(): if self.plot is None: self.plot = self.scene.mlab.plot3d(x, y, z, t,

Column widths with TabularAdapters?

牧云@^-^@ 提交于 2019-12-11 03:19:19
问题 Using Enthought Canopy's TraitsUI, I'm using TabularAdapters to display some Arrays, but they always produce evenly proportioned column widths...I'd like to make some widths smaller than others, but haven't found any simple way yet...Anyone have any suggestions? 回答1: One way to control the widths of the columns is to override the get_width() method of the TabularArrayAdapter . For example, import numpy as np from traits.api import HasTraits, Array from traitsui.api import View, Item,

ImportError: No module named site VIM and Enthought canopy

有些话、适合烂在心里 提交于 2019-12-11 01:48:31
问题 I was using vim and python perfectly fine till I upgrade to Maverick. Now I have a similar issue as here. When I remove remove canopy path from bash_profile and use default python path , vim works fine, otherwise I am getting the above error. You can also see me report on jedi-vim here UPDATE: Also it seems my default python path is no longer in /Library/Frameworks/Python.framework/Versions/2.7/bin $ which python /usr/bin/python 回答1: For anyone encountering this issue I resolved the problem

Mayavi: interpolate face colors in triangular_mesh

邮差的信 提交于 2019-12-10 19:43:53
问题 I have pieced together the following code to plot a triangular mesh with the colors specified by an additional scalar function: #! /usr/bin/env python import numpy as np from mayavi import mlab # Create cone n = 8 t = np.linspace(-np.pi, np.pi, n) z = np.exp(1j*t) x = z.real.copy() y = z.imag.copy() z = np.zeros_like(x) triangles = [(0, i, i+1) for i in range(n)] x = np.r_[0, x] y = np.r_[0, y] z = np.r_[1, z] t = np.r_[0, t] # These are the scalar values for each triangle f = np.mean(t[np

vtk.vtkRender() causes seg fault:11

你离开我真会死。 提交于 2019-12-10 14:30:18
问题 I have a python script, which I didn't write, that utilises the vtk module. It has worked on my old iMac and on my Linux machines. Trying it on my Macbook Pro with OS X Mavericks installed I get a seg fault during rendering. I have tracked down the error to a call to the vtkRender() method which causes the script to crash with seg fault 11. I literally have no idea how to go further and find out the exact cause of the bug (for instance, how do I step into a method call using pdb?), any ideas?

iPython notebook won't upgrade, always runs in v. 0.12

我们两清 提交于 2019-12-10 12:06:35
问题 I've had some issues with iPython notebook since installing it for the first time. I already had installed iPython via pip install, but then I decided to install Canopy Express to get all the packages and a easy-to-use package manager. I am on a MBP with latest Yosemite installed. When I run ipython notebook via. ipython notebook --pylab inline in a terminal, notebook starts up fine in Chrome. But, then i check the version of iPython with import IPython IPython.__version__ it says 0.12 --

enthought gdal/ogr not built with GEOS?

心不动则不痛 提交于 2019-12-10 11:56:02
问题 I'm using the academic version of enthought python for Windows. Most of ogr works, but not geometry methods like geometry.Buffer() or predicates like geometry1.crosses(geometry2). According to this: http://gdal.org/python/osgeo.ogr.Geometry-class.html#Crosses ogr needs to have been built with GEOS. Has anybody got these methods to work with Enthought? If not, can you suggest a Windows python binary where these are working? thanks, jim 回答1: Correct, there are many possible build configurations

adding nested HasTraits properties to a TraitsUI TView

天涯浪子 提交于 2019-12-10 11:42:18
问题 i have a main HasTraits class which contains several Instance's of other HasTraits objects. I would like to define an Item in the view of the main object which points to a trait of a nested object. for example: class Person(HasTraits): name = String() class Pet(HasTraits): name = String() class Family(HasTraits): father = Instance(Person,()) dog = Instance(Pet,()) view = View( Item('father.name'), Item('dog.name'), ) is this possible? thanks! 回答1: Somebody named Alex asked this question 1

IPython buffer and pagination in Enthought Canopy

若如初见. 提交于 2019-12-10 10:53:22
问题 I'm using Enthought's beta distribution of Python Canopy 0.9.1 on Windows 7. How do I increase the size of my IPython buffer. Also how do I pipe the output of a command through a paginator; output is currently unpaginated. If existing answers like How to increase the ipython qtconsole scrollback buffer limit or How to use Pipe in ipython will work, I don't know how to apply them to Windows. Thank you! 回答1: There's currently no preference or config option to increase the buffer limit currently