enthought

How do I update the dictionary of a mapped trait, after I've already constructed it?

ぐ巨炮叔叔 提交于 2020-01-24 01:08:25
问题 I need to update the dictionary of a mapped trait some time after initial trait creation. How do I do this? The following code: from traits.api import (HasTraits, Trait) class bar(HasTraits): zap = Trait("None", {"None": None}) def __init__(self): # In reality, determined programmatically at runtime. add_dict_entries = {"One": 1} new_dict = {"None": None} new_dict.update(add_dict_entries) self.zap = Trait("None", new_dict) theBar = bar() yields: Traceback (most recent call last): File "tst

Probing/sampling/interpolating VTK data using python TVTK or MayaVi

丶灬走出姿态 提交于 2020-01-22 10:00:13
问题 I would like to visualise a VTK data file (OpenFOAM output) using python. The plot I would like to make is a 1-d line plot of a quantity between two endpoints. To do so, the unstructured data should be interpolated on the points which lie between the two endpoints. I've used the package Mayavi to visualise the VTK data. At the mayavi webpage there is a description of probing a single value from a scalarfield. This function does not work on a VTK file. Also I've found a delaunay3d method (mlab

why cannot I use sp.signal by import scipy as sp? [duplicate]

谁说胖子不能爱 提交于 2020-01-14 14:39:50
问题 This question already has an answer here : scipy.special import issue (1 answer) Closed 4 years ago . I would like to use scipy.signal.lti and scipy.signal.impulse function to calculate the transfer function. I import the scipy module in the following way. import scipy as sp import numpy as np import matplotlib.pyplot as plt from math import * However, when I type the following scripts, tf = sp.signal.lti(numH, denH) The Kernel gives an error: ---> 10 tf = sp.signal.lti(numH, denH)

How to test if Canopy editor is open

青春壹個敷衍的年華 提交于 2020-01-14 02:50:09
问题 Is there a way to test if the Canopy editor is open/running that would work across platforms? On Mac/Unix, it seems to work to check for canopy.app.main in the output of "ps aux", but that is not possible on most Windows. I found a tasklist command that is similar, but it appears Canopy runs as a generic pythonw program. 回答1: At present, on all OSes, if Canopy is running, then there will be a text file process.lck in the configuration/preferences directory. The second line of the file is the

How can I wrap a non-Traits model for use with Python Traits?

喜你入骨 提交于 2020-01-13 19:19:48
问题 I would like to wrap a non-Traits model class for use with Python Traits. My goal is to write a Traits-based UI to manipulate an "external" model class. The external model class has been generated by SWIG and so I cannot add enthought.traits.api.HasTraits as an ancestor (I think, though I may be wrong). My current best attempt is from enthought.traits.api import HasStrictTraits, Property, Instance class ExternalModel(): foo = 'foo' class TraitsModel(HasStrictTraits): _e = Instance

Multiple kernels in Enthought Canopy

谁都会走 提交于 2020-01-11 06:32:33
问题 I previously worked with the EPD Python distribution using its Qt-console, where one of the most useful features was easily having multiple kernels in multiple tabs, when doing several calculations simultaneously. I recently got the "new" Enthought Canopy, which somehow tries to emulate MatLab, which might not be bad perse. Here comes the problem: How do I get multiple tabs with separated kernels with Canopy? For completeness, I am running Canopy 1.1.0 on Ubuntu-Gnome 13.04. 回答1: The Canopy

Does the EPD Free distribution use MKL?

你离开我真会死。 提交于 2020-01-05 07:38:22
问题 According to the Enthought website, the EPD Python distribution uses MKL for numpy and scipy. Does EPD Free also use MKL? If not does it use another library for BLAS/LAPACK? I am using EPD Free 7.3-2 Also, what library does the windows binary installer for numpy that can be found on scipy.org use? 回答1: The EPD Free 7.3 installers do not include MKL. The BLAS/LAPACK libraries which they use are ATLAS on Linux & Windows and Accelerate on OSX. 回答2: According to this table, EPD Free 7.3 does not

Connection behind proxy

旧街凉风 提交于 2020-01-03 05:16:10
问题 I have Enthought Canopy (version 1.2.0.1610) intalled on my system. I'm trying to login to the Enthought server. My system is Ubuntu 13.10 x64, and I'm behind a corporate proxy that uses NTLM authentication protocol. To access the Internet I'm using cntlm proxy server on my system. In the Enthought proxy settings I set up the proxy. And It passes test. But, when I try to login it does not login without any errors. I run Canopy from command line to see if there is any error output, and I got

Enthought canopy not running

允我心安 提交于 2020-01-03 04:59:04
问题 I installed Enthought Canopy onto my 64 bit windows box (Windows 7). Installed "successfully" except Canopy would not run at all from start menu. I tried running it from cmd and it still would not run. I checked c:\Users\user...Local and Roaming and found no error logs. I tried the Windows Vista and above with User Access Control (UAC) enabled, the msi installer trick but Canopy still didn't run either from start menu or cmd. There seems no help on this on the Enthought website, has anyone

Setting the working directory of IPython Shell to that of the python file being executed in Canopy

非 Y 不嫁゛ 提交于 2020-01-02 15:45:21
问题 I am new to IPython and I am using the Canopy distribution. The default value of the shell's working directory is /home/username. This is a bit painful, when I work on files which need other files present in the corresponding folder that I am working in. So, I always manually change it to folder in which the file (which I am trying to execute) is present. I found this relevant question, but my question is slightly different. Also, I couldn't understand the answer provided there really well.