From nwagner at mecha.uni-stuttgart.de Fri Aug 1 04:13:49 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 01 Aug 2003 10:13:49 +0200 Subject: [SciPy-user] interpolate Message-ID: <3F2A213D.BFBDCAD8@mecha.uni-stuttgart.de> Hi all, Let us consider a curve which is given by m points (x_1,y_1) ... (x_m,y_m). How can I find the first and second derivative of this curve in x_1,...,x_m ? A small example illustrating the solution to this task would be appreciated. Thanks in advance Nils BTW, the command interpolate.linear_1d in From barrett at stsci.edu Fri Aug 1 09:17:10 2003 From: barrett at stsci.edu (Paul Barrett) Date: Fri, 01 Aug 2003 09:17:10 -0400 Subject: [SciPy-user] interpolate In-Reply-To: <3F2A213D.BFBDCAD8@mecha.uni-stuttgart.de> References: <3F2A213D.BFBDCAD8@mecha.uni-stuttgart.de> Message-ID: <3F2A6856.1060002@stsci.edu> Nils Wagner wrote: > Hi all, > > Let us consider a curve which is given by m points (x_1,y_1) ... > (x_m,y_m). > How can I find the first and second derivative of this curve in > x_1,...,x_m ? > A small example illustrating the solution to this task would be > appreciated. > > Thanks in advance > > Nils I'd suggest using Neville's algorithm, which allows you to fit an exact polynomial of degree N-1 to a set of N points. Finding the first and second derivatives should then be straight forward. Usually it isn't necessary to fit all N points, but to take 2 (3) points on either side of the region that you want to interpolate and then fit the 4 (6) points using a 3rd (5th) order polynomial. I've attached a Python version of the algorithm. I learned about this algorithm a couple of years ago and have wondered how I did with out for so long. This is real forgotten gem as far as I'm concerned. Cheers, Paul -- Paul Barrett, PhD Space Telescope Science Institute Phone: 410-338-4475 ESS/Science Software Group FAX: 410-338-4767 Baltimore, MD 21218 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: neville.py URL: From nwagner at mecha.uni-stuttgart.de Fri Aug 1 09:35:58 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 01 Aug 2003 15:35:58 +0200 Subject: [SciPy-user] interpolate References: <3F2A213D.BFBDCAD8@mecha.uni-stuttgart.de> <3F2A6856.1060002@stsci.edu> Message-ID: <3F2A6CBE.824CB931@mecha.uni-stuttgart.de> Paul Barrett schrieb: > > Nils Wagner wrote: > > Hi all, > > > > Let us consider a curve which is given by m points (x_1,y_1) ... > > (x_m,y_m). > > How can I find the first and second derivative of this curve in > > x_1,...,x_m ? > > A small example illustrating the solution to this task would be > > appreciated. > > > > Thanks in advance > > > > Nils > > I'd suggest using Neville's algorithm, which allows you to fit an exact > polynomial of degree N-1 to a set of N points. Finding the first and > second derivatives should then be straight forward. Usually it isn't > necessary to fit all N points, but to take 2 (3) points on either side > of the region that you want to interpolate and then fit the 4 (6) points > using a 3rd (5th) order polynomial. I've attached a Python version of > the algorithm. > > I learned about this algorithm a couple of years ago and have wondered > how I did with out for so long. This is real forgotten gem as far as > I'm concerned. > > Cheers, > Paul > > -- > Paul Barrett, PhD Space Telescope Science Institute > Phone: 410-338-4475 ESS/Science Software Group > FAX: 410-338-4767 Baltimore, MD 21218 > > ------------------------------------------------------------------------ > Name: neville.py > neville.py Type: Plain Text (text/plain) > Encoding: 7bit Thank you for your reply. Finally, I have used interpolate.splrep and interpolate.splev. I have enclosed a short demo: from scipy import * from scipy.xplt import * import gui_thread x = arange(0,1,0.1) # # Original function # y = exp(-x/3.0) # # Analytical derivatives # ys = -exp(-x/3.0)/3.0 yss = +exp(-x/3.0)/9.0 # tck = interpolate.splrep(x,y) # # Spline # z=interpolate.splev(x,tck,0) # # First derivative # zs=interpolate.splev(x,tck,1) # # Second derivative # zss=interpolate.splev(x,tck,2) window(0) xplt.plot(x,y,'x',x,z,'ro') window(1) xplt.plot(x,ys,'x',x,zs,'ro') window(2) xplt.plot(x,yss,'x',x,zss,'ro') Nils From jtneuvon at cc.hut.fi Fri Aug 1 03:05:15 2003 From: jtneuvon at cc.hut.fi (Tuomas Neuvonen) Date: Fri, 1 Aug 2003 10:05:15 +0300 (EEST) Subject: [SciPy-user] pilutil.imresize and numarray Message-ID: Hi all, This code works before installing Numarray: ------ #!/usr/bin/env python from scipy import randn, pilutil def testpilutil(): arr = randn(10,10) arr2 = pilutil.imresize(arr,(20,20)) if __name__=='__main__': testpilutil() ----- And after installing Numarray, it fails: -------- Traceback (most recent call last): File "piltest.py", line 9, in ? testpil() File "piltest.py", line 6, in testpil arr2 = pilutil.imresize(arr,(20,20)) File "/usr/local/stow/scipy-0.2.0/lib/python2.2/site-packages/scipy/pilutil.py", line 234, in imresize im = toimage(arr) File "/usr/local/stow/scipy-0.2.0/lib/python2.2/site-packages/scipy/pilutil.py", line 116, in toimage image = Image.fromstring('L',shape,bytedata.tostring()) File "/usr/local/stow/scipy-0.2.0/lib/python2.2/site-packages/scipy_base/ppimport.py", line 212, in __getattr__ return getattr(module, name) AttributeError: 'module' object has no attribute 'fromstring' ---------- Why this happens? I understood that Numarray and Numeric could co-exist peacefully. Removing numarray resolves this problem. I'm using Python 2.2.2-6, Numeric 23.0-5, Scipy 0.2.0_alpha_196.4128 and numarray 0.5-3 on Debian testing. thanks, Tuomas Neuvonen From hebertodelrio at fastmail.fm Sat Aug 2 15:34:20 2003 From: hebertodelrio at fastmail.fm (Heberto del Rio) Date: Sat, 02 Aug 2003 15:34:20 -0400 Subject: [SciPy-user] ranlib? Message-ID: <420000.1059852860@localhost> Is there any way to replace the ranlib module (since it is only used as a pseudo random number generator) and replace it with a much better one: Mersenne Twister pseudo random number generator? Heberto +--------------------------------------------------------------------------+ | | | I am in the process of changing ISP, therefore my email address will | | | | change too. Please use the following email address in the future: | | | | hebertodelrio at fastmail.fm | | | +--------------------------------------------------------------------------+ From chris at fonnesbeck.org Sun Aug 3 17:02:19 2003 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Sun, 3 Aug 2003 17:02:19 -0400 Subject: [SciPy-user] scipy.stats on OSX Message-ID: There seems to be a platform-specific problem with the stats module within scipy. Specifically, many distributions do not work on OSX builds within distributions.py. For example, any value passed to gamma.pdf returns a NaN, rather than the expected likelihood value. I am using the latest cvs. cjf -- Christopher J. Fonnesbeck (chris at fonnesbeck dot org) GA Coop. Fish & Wildlife Research Unit, University of Georgia From cjw at sympatico.ca Tue Aug 5 11:03:58 2003 From: cjw at sympatico.ca (Colin J. Williams) Date: Tue, 05 Aug 2003 11:03:58 -0400 Subject: [SciPy-user] numarray.dot Message-ID: <3F2FC75E.2030907@sympatico.ca> This function appears to take only partial account of imaginary data, see the second exeution below.. I would have expected a complex element type in a ComplexArray instance. or a message that this type of input cannot be handled. Colin W. print 'version:', _sys.version import numarray as N z= N.dot([1, 2], [[3], [4]]) print 'z, type(z), z[0], z.type():', z, type(z), z[0], z.type() z= N.dot([1, 2], [[3j], [4]]) print 'z, type(z), z[0], z.type():', z, type(z), z[0], z.type() Results: version: 2.3c2 (#45, Jul 24 2003, 21:23:54) [MSC v.1200 32 bit (Intel)] z, type(z), z[0], z.type(): [11] 11 Int32 z, type(z), z[0], z.type(): [ 8.] 8.0 Float64 From jmiller at stsci.edu Tue Aug 5 11:37:47 2003 From: jmiller at stsci.edu (Todd Miller) Date: 05 Aug 2003 11:37:47 -0400 Subject: [SciPy-user] numarray.dot In-Reply-To: <3F2FC75E.2030907@sympatico.ca> References: <3F2FC75E.2030907@sympatico.ca> Message-ID: <1060097867.4239.9.camel@localhost.localdomain> You're quite correct about the bug in the output array type selection for numarray.dot. The current code dates to a time when numarray did not have support for complex numbers. Thanks for the input. Todd On Tue, 2003-08-05 at 11:03, Colin J. Williams wrote: > This function appears to take only partial account of imaginary data, > see the > second exeution below.. > > I would have expected a complex element type in a ComplexArray instance. > or a message that this type of input cannot be handled. > > Colin W. > > print 'version:', _sys.version > > import numarray as N > z= N.dot([1, 2], [[3], [4]]) > print 'z, type(z), z[0], z.type():', z, type(z), z[0], z.type() > > z= N.dot([1, 2], [[3j], [4]]) > print 'z, type(z), z[0], z.type():', z, type(z), z[0], z.type() > > Results: > > version: 2.3c2 (#45, Jul 24 2003, 21:23:54) [MSC v.1200 32 bit (Intel)] > z, type(z), z[0], z.type(): [11] 'numarray.numarraycore.NumArray'> 11 Int32 > z, type(z), z[0], z.type(): [ 8.] 'numarray.numarraycore.NumArray'> 8.0 Float64 > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- Todd Miller From jmiller at stsci.edu Tue Aug 5 11:50:57 2003 From: jmiller at stsci.edu (Todd Miller) Date: 05 Aug 2003 11:50:57 -0400 Subject: [SciPy-user] numarray.dot In-Reply-To: <1060097867.4239.9.camel@localhost.localdomain> References: <3F2FC75E.2030907@sympatico.ca> <1060097867.4239.9.camel@localhost.localdomain> Message-ID: <1060098656.4239.13.camel@localhost.localdomain> This problem is now fixed in numarray CVS. In case you'd like to try it yourself on numarray-0.6, the change looks like: Index: Lib/ufunc.py =================================================================== RCS file: /cvsroot/numpy/numarray/Lib/ufunc.py,v retrieving revision 1.60 diff -r1.60 ufunc.py 1872,1875c1872 < if artype != brtype: < return _nt.Float64 < else: < return artype --- > return max(artype, brtype) Thanks again, Todd On Tue, 2003-08-05 at 11:37, Todd Miller wrote: > You're quite correct about the bug in the output array type selection > for numarray.dot. The current code dates to a time when numarray did > not have support for complex numbers. > > Thanks for the input. > Todd > > On Tue, 2003-08-05 at 11:03, Colin J. Williams wrote: > > This function appears to take only partial account of imaginary data, > > see the > > second exeution below.. > > > > I would have expected a complex element type in a ComplexArray instance. > > or a message that this type of input cannot be handled. > > > > Colin W. > > > > print 'version:', _sys.version > > > > import numarray as N > > z= N.dot([1, 2], [[3], [4]]) > > print 'z, type(z), z[0], z.type():', z, type(z), z[0], z.type() > > > > z= N.dot([1, 2], [[3j], [4]]) > > print 'z, type(z), z[0], z.type():', z, type(z), z[0], z.type() > > > > Results: > > > > version: 2.3c2 (#45, Jul 24 2003, 21:23:54) [MSC v.1200 32 bit (Intel)] > > z, type(z), z[0], z.type(): [11] > 'numarray.numarraycore.NumArray'> 11 Int32 > > z, type(z), z[0], z.type(): [ 8.] > 'numarray.numarraycore.NumArray'> 8.0 Float64 > > > > > > _______________________________________________ > > SciPy-user mailing list > > SciPy-user at scipy.net > > http://www.scipy.net/mailman/listinfo/scipy-user -- Todd Miller From cjw at sympatico.ca Tue Aug 5 14:35:57 2003 From: cjw at sympatico.ca (Colin J. Williams) Date: Tue, 05 Aug 2003 14:35:57 -0400 Subject: [SciPy-user] numarray.dot In-Reply-To: <1060098656.4239.13.camel@localhost.localdomain> References: <3F2FC75E.2030907@sympatico.ca> <1060097867.4239.9.camel@localhost.localdomain> <1060098656.4239.13.camel@localhost.localdomain> Message-ID: <3F2FF90D.3090807@sympatico.ca> Todd, Many thanks for your speedy response. The line numbers don't tie with my ufunc.py and so I will await the formal release. I presume that the change applies to _matrixtype. Incidentally, I am exploring the feasibility of basing a Matrix class on NumArray, but find it difficult, in view of the use of factory functions, rather than the conventional instance constructors. Thanks again. Colin W. Todd Miller wrote: >This problem is now fixed in numarray CVS. In case you'd like to try it >yourself on numarray-0.6, the change looks like: > >Index: Lib/ufunc.py >=================================================================== >RCS file: /cvsroot/numpy/numarray/Lib/ufunc.py,v >retrieving revision 1.60 >diff -r1.60 ufunc.py >1872,1875c1872 >< if artype != brtype: >< return _nt.Float64 >< else: >< return artype >--- > > >> return max(artype, brtype) >> >> > > >Thanks again, >Todd > > >On Tue, 2003-08-05 at 11:37, Todd Miller wrote: > > >>You're quite correct about the bug in the output array type selection >>for numarray.dot. The current code dates to a time when numarray did >>not have support for complex numbers. >> >>Thanks for the input. >>Todd >> >>On Tue, 2003-08-05 at 11:03, Colin J. Williams wrote: >> >> >>>This function appears to take only partial account of imaginary data, >>>see the >>>second exeution below.. >>> >>>I would have expected a complex element type in a ComplexArray instance. >>>or a message that this type of input cannot be handled. >>> >>>Colin W. >>> >>>print 'version:', _sys.version >>> >>>import numarray as N >>>z= N.dot([1, 2], [[3], [4]]) >>>print 'z, type(z), z[0], z.type():', z, type(z), z[0], z.type() >>> >>>z= N.dot([1, 2], [[3j], [4]]) >>>print 'z, type(z), z[0], z.type():', z, type(z), z[0], z.type() >>> >>>Results: >>> >>>version: 2.3c2 (#45, Jul 24 2003, 21:23:54) [MSC v.1200 32 bit (Intel)] >>>z, type(z), z[0], z.type(): [11] >>'numarray.numarraycore.NumArray'> 11 Int32 >>>z, type(z), z[0], z.type(): [ 8.] >>'numarray.numarraycore.NumArray'> 8.0 Float64 >>> >>> >>>_______________________________________________ >>>SciPy-user mailing list >>>SciPy-user at scipy.net >>>http://www.scipy.net/mailman/listinfo/scipy-user >>> >>> From jmiller at stsci.edu Tue Aug 5 16:08:28 2003 From: jmiller at stsci.edu (Todd Miller) Date: 05 Aug 2003 16:08:28 -0400 Subject: [SciPy-user] numarray.dot In-Reply-To: <3F2FF90D.3090807@sympatico.ca> References: <3F2FC75E.2030907@sympatico.ca> <1060097867.4239.9.camel@localhost.localdomain> <1060098656.4239.13.camel@localhost.localdomain> <3F2FF90D.3090807@sympatico.ca> Message-ID: <1060114108.4239.40.camel@localhost.localdomain> On Tue, 2003-08-05 at 14:35, Colin J. Williams wrote: > Todd, > > Many thanks for your speedy response. You're welcome. Sorry this one was slower... > The line numbers don't tie with > my ufunc.py > and so I will await the formal release. I presume that the change > applies to _matrixtype. Yes. > > Incidentally, I am exploring the feasibility of basing a Matrix class on > NumArray, but > find it difficult, in view of the use of factory functions, rather than > the conventional > instance constructors. Well, subclassing is a little tricky, and we haven't done it that much yet ourselves. What's wrong with: import numarray.numarraycore as _nc import numarray.generic as _gen import numarray.linear_algebra as _la def _matrixize(result): return result def array(*args, **keys): return _matrixize(_nc.array(*args, **keys)) def fromlist(*args, **keys): return _matrixize(_nc.fromlist(*args, **keys)) def fromfile(*args, **keys): return _matrixize(_nc.fromfile(*args, **keys)) class Matrix(_nc.NumArray): def _reclassify(self, a): a.__class__ = self.__class__ return a def __mul__(self, other): return self._reclassify(_nc.dot(self, other)) def determinant(self): return _la.determinant(self) def inverse(self): return self._reclassify(_la.inverse(self)) Todd From jmiller at stsci.edu Tue Aug 5 16:15:33 2003 From: jmiller at stsci.edu (Todd Miller) Date: 05 Aug 2003 16:15:33 -0400 Subject: [SciPy-user] numarray.dot In-Reply-To: <1060114108.4239.40.camel@localhost.localdomain> References: <3F2FC75E.2030907@sympatico.ca> <1060097867.4239.9.camel@localhost.localdomain> <1060098656.4239.13.camel@localhost.localdomain> <3F2FF90D.3090807@sympatico.ca> <1060114108.4239.40.camel@localhost.localdomain> Message-ID: <1060114533.4239.43.camel@localhost.localdomain> On Tue, 2003-08-05 at 16:08, Todd Miller wrote: > def _matrixize(result): > return result > Oops, I got a little "happy" with the delete key. That should have read: def _matrixize(result): result.__class__ = Matrix return result -- Todd Miller From laytonjb at bellsouth.net Tue Aug 5 19:30:36 2003 From: laytonjb at bellsouth.net (Jeffrey B. Layton) Date: Tue, 05 Aug 2003 19:30:36 -0400 Subject: [SciPy-user] Newbie type questions Message-ID: <3F303E1C.8040406@bellsouth.net> Hello, I've played with Scipy off and on for a few months, but now I need to get serious. I am co-authoring an engineering book and will have a large number of examples in it. We are already using MATLAB (and Octave), but I have convinced my co-authors and perhaps the publishers to put Python/Scipy in there as well. This text is a graduate level text and the models in the book can be quite large and time-consuming. Towards this, we have an appendix where we explain the basics of MATLAB and Octave for those who need to brush up or who need a quick intro (enough to run the examples). I'm writing the companion appendix for Python/Scipy. So, I'm working through the examples. This leads me to my questions If I declare a complex matrix A, A=array([[complex(1,1),complex(2,2)],[complex(3,3),complex(4,4)]]) and I want to take the transpose, which I'm assuming to be the complex conjugate, I need to type AT=transpose(conjugate(A)) to get the actual complex conjugate. Is there an easier way to do this? A somewhat related question, if I declare a vector X, X=array([1,2,3]) and then try to take the transpose of it, Y=transpose(X) then X=Y. I sort of understand this since the shape of X is (3, ). Shouldn't the shape of X be (3,1)? (I'm sorry this is such a newbie question). Warning: I'm still working my way through the appendix and I'm re-reading the tutorials on the scipy website, so assume I'll be asking more questions =:) (I'll try not to be a pest). Thanks very much! Jeff From pearu at scipy.org Wed Aug 6 03:38:06 2003 From: pearu at scipy.org (Pearu Peterson) Date: Wed, 6 Aug 2003 10:38:06 +0300 (EEST) Subject: [SciPy-user] Newbie type questions In-Reply-To: <3F303E1C.8040406@bellsouth.net> Message-ID: On Tue, 5 Aug 2003, Jeffrey B. Layton wrote: > Hello, > > I've played with Scipy off and on for a few months, but now > I need to get serious. I am co-authoring an engineering book > and will have a large number of examples in it. We are already > using MATLAB (and Octave), but I have convinced my > co-authors and perhaps the publishers to put Python/Scipy in > there as well. This text is a graduate level text and the models > in the book can be quite large and time-consuming. > Towards this, we have an appendix where we explain the basics > of MATLAB and Octave for those who need to brush up or who > need a quick intro (enough to run the examples). I'm writing the > companion appendix for Python/Scipy. So, I'm working through > the examples. This leads me to my questions > If I declare a complex matrix A, > > A=array([[complex(1,1),complex(2,2)],[complex(3,3),complex(4,4)]]) A shorter Matrix version of that would be from scipy import * A=mat([[1+1j,2+2j],[3+3j,4+4j]]) > and I want to take the transpose, which I'm assuming to be the > complex conjugate, I need to type > > AT=transpose(conjugate(A)) > > to get the actual complex conjugate. Is there an easier way to do this? Yes, using mat from scipy, yo can do AT = A.H For instance, >>> A.H Matrix([[ 1.-1.j, 3.-3.j], [ 2.-2.j, 4.-4.j]]) > A somewhat related question, if I declare a vector X, > > X=array([1,2,3]) > > and then try to take the transpose of it, > > Y=transpose(X) > > then X=Y. This is true when using array. > I sort of understand this since the shape of X > is (3, ). Shouldn't the shape of X be (3,1)? Again, try mat: >>> X=mat([1,2,3]) >>> Y = X.T >>> X Matrix([ [1, 2, 3]]) >>> Y Matrix([[1], [2], [3]]) >>> X.shape (1, 3) >>> Y.shape (3, 1) HTH, Pearu From oliphant at ee.byu.edu Tue Aug 5 19:42:43 2003 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Tue, 05 Aug 2003 17:42:43 -0600 Subject: [SciPy-user] Newbie type questions References: <3F303E1C.8040406@bellsouth.net> Message-ID: <3F3040F3.3070609@ee.byu.edu> Jeffrey B. Layton wrote: > Hello, > > I've played with Scipy off and on for a few months, but now > I need to get serious. I am co-authoring an engineering book > and will have a large number of examples in it. We are already > using MATLAB (and Octave), but I have convinced my > co-authors and perhaps the publishers to put Python/Scipy in > there as well. This text is a graduate level text and the models > in the book can be quite large and time-consuming. > Towards this, we have an appendix where we explain the basics > of MATLAB and Octave for those who need to brush up or who > need a quick intro (enough to run the examples). I'm writing the > companion appendix for Python/Scipy. So, I'm working through > the examples. This leads me to my questions > If I declare a complex matrix A, > > A=array([[complex(1,1),complex(2,2)],[complex(3,3),complex(4,4)]]) > > and I want to take the transpose, which I'm assuming to be the > complex conjugate, I need to type > > AT=transpose(conjugate(A)) > > to get the actual complex conjugate. Is there an easier way to do this? > A somewhat related question, if I declare a vector X, > There is also a Matrix class which can be useful for matrix algorithms. For your example (assuming you have scipy): A = mat('[1+1j, 2+2j; 3+3j, 4+4j]') # notice the quotes AH = A.H # the conjugate transpose AT = A.T # just the tranpose AI = A.I # the inverse > X=array([1,2,3]) > > and then try to take the transpose of it, > > Y=transpose(X) > > then X=Y. I sort of understand this since the shape of X > is (3, ). Shouldn't the shape of X be (3,1)? (I'm sorry this is > such a newbie question). This is a typical mistake people with only Matlab experience make. I had this question years ago too. SciPy handles multi-dimensional arrays more naturally than Matlab so that there is a real difference between arrays and Matrices (thus the special subclass of arrays to handle just matrices). Most commands that you understand to work with matrices (2-d arrays) also have precise defintions for working with arrays. In this example X is a 1-dimensional array. Therefore it's transpose does nothing (there are not two dimensions to interchange). Notice that tranpose(X) will work if X is 4-dimensional. It's default behavior is to reverse the dimensions so that if X has a shape of (3,4,5,6) then tranpose(X) has a shape of (6,5,4,3). You can change this behavior by passing a second argument to transpose giving the permutation of the axes that you would like. Thus transpose(X,(2,3,0,1)) would have shape (5,6,3,4). Good luck, Feel free to ask more questions and if somebody has a moment they will be happy to respond. > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From cjw at sympatico.ca Wed Aug 6 16:19:58 2003 From: cjw at sympatico.ca (Colin J. Williams) Date: Wed, 06 Aug 2003 16:19:58 -0400 Subject: [SciPy-user] Sub-classing NumArray In-Reply-To: <1060114108.4239.40.camel@localhost.localdomain> References: <3F2FC75E.2030907@sympatico.ca> <1060097867.4239.9.camel@localhost.localdomain> <1060098656.4239.13.camel@localhost.localdomain> <3F2FF90D.3090807@sympatico.ca> <1060114108.4239.40.camel@localhost.localdomain> Message-ID: <3F3162EE.3040605@sympatico.ca> Todd, Thanks, your suggestions would likely deliver a Matrix class, I'll think some more about it The basic problems, as I see them, are: (1) I would like to handle real and complex matrices. (2) There are a number of things left out on the counter (as functions) which would probably be better hidden within the class instance. I wonder whether the NumArray could carry an extra attribute (_modeOfStorage). This could be set within NumArray.__init__, once the type of data has been determined. modeOfStorage might be interleaved or regular. Or, even simpler, _modeOfStorage could be determined from the elementType (now called type). If this were feasible, then there could probably be a NumArray class which handles real or complex data (and possibly bit data for Booleans). A scheme along the following lines might work: class NumArray(_numarray._numarray, _gen.NDArray): '''Fundamental Numeric Array shape The shape of the resulting NumArray. elementType The numerictype of each data element, e.g. Int32 ''' def __init__(self, data, shape=(), elementType=_nt.Any): # Choose the method for conversion, based on type(data): fromFile fromSimpleValue - this is passed on to fromList from List fromString fromArray - possibly this is deprecated, or will be when numarray is fully operational. Each of these would either raise an exception, indicating grief of some sort, or would return a 4tuple: i. memoryBuffer - a MemoryType, containing data ii. elementType - detemined either from data. or as specified to the constructor iii. shape - detemined either from data. or as specified to the constructor iv. itemSize - this may be redundant as it is probably deteminable from the memoryBuffer, since it is known to MemoryType.__repr__ _genNDArray.__init__(self, shape, itemsize) self._data= memoryBuffer self._type= elementType self._shape= shape self._itemsize= itemsize - this is probably redundant as it is given by elementType.bytes _validate(self) def _validate(self): " Primarily to validate sub-classes. " pass # An example of what validate might be for a Matrix sub-class def _validate(self): s= self.shape if len(s) == 1: # treat as a row vector s= (1, s[0]) self.resize(s) elif len(s) == 2: pass else: raise ValueError, 'data not compatible with Matrix - data:\n'+ self.__repr__() if \ # isinstance(self.shape, types.IntType) or \ len(self.shape) in (1, 2): return else: raise TypeError, 'Not a valid matrix' I've suggested dropping some parameters: buffer=None - this could, with a fromBuffer method, probably be entered as data. byteoffset=0 - perhaps there is a need for values other than zero bytestride=None - this apears to be calculable. byteorder=_sys.byteorder - this appears to be system related and thus the default would probably do. aligned=1 - I'm not sure what this indicates, is it also system related? Much of the code needed is likely already in numarraycore. Thus, basing NumArray more firmly on the Python class would appear to be feasible. Colin W. Todd Miller wrote: >On Tue, 2003-08-05 at 14:35, Colin J. Williams wrote: > >[snip] > > > >>Incidentally, I am exploring the feasibility of basing a Matrix class on >>NumArray, but >>find it difficult, in view of the use of factory functions, rather than >>the conventional >>instance constructors. >> >> > >Well, subclassing is a little tricky, and we haven't done it that much >yet ourselves. What's wrong with: > >import numarray.numarraycore as _nc >import numarray.generic as _gen >import numarray.linear_algebra as _la > >def _matrixize(result): > return result > >def array(*args, **keys): > return _matrixize(_nc.array(*args, **keys)) > >def fromlist(*args, **keys): > return _matrixize(_nc.fromlist(*args, **keys)) > >def fromfile(*args, **keys): > return _matrixize(_nc.fromfile(*args, **keys)) > >class Matrix(_nc.NumArray): > > def _reclassify(self, a): > a.__class__ = self.__class__ > return a > > def __mul__(self, other): > return self._reclassify(_nc.dot(self, other)) > > def determinant(self): > return _la.determinant(self) > > def inverse(self): > return self._reclassify(_la.inverse(self)) > > >Todd > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > > From laytonjb at bellsouth.net Wed Aug 6 20:19:34 2003 From: laytonjb at bellsouth.net (Jeffrey B. Layton) Date: Wed, 06 Aug 2003 20:19:34 -0400 Subject: [SciPy-user] Newbie type questions In-Reply-To: <3F3040F3.3070609@ee.byu.edu> References: <3F303E1C.8040406@bellsouth.net> <3F3040F3.3070609@ee.byu.edu> Message-ID: <3F319B16.8080208@bellsouth.net> Travis, Thanks for the response (you too Pearu!). I've got a follow-up below. > There is also a Matrix class which can be useful for matrix algorithms. > > For your example (assuming you have scipy): > > A = mat('[1+1j, 2+2j; 3+3j, 4+4j]') # notice the quotes > AH = A.H # the conjugate transpose > AT = A.T # just the tranpose > AI = A.I # the inverse What's the difference between using quotes and using brackets [] as Pearu suggested? BTW, I like the methods for computing the transpose. Is something like A.shape a method or a property of the mat class? (i.e. is computed when it's created or just when it's needed) Thanks! Jeff From oliphant at ee.byu.edu Thu Aug 7 13:07:56 2003 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Thu, 07 Aug 2003 11:07:56 -0600 Subject: [SciPy-user] Newbie type questions References: <3F303E1C.8040406@bellsouth.net> <3F3040F3.3070609@ee.byu.edu> <3F319B16.8080208@bellsouth.net> Message-ID: <3F32876C.8090108@ee.byu.edu> Jeffrey B. Layton wrote: > Travis, > > Thanks for the response (you too Pearu!). I've got a > follow-up below. > >> There is also a Matrix class which can be useful for matrix algorithms. >> >> For your example (assuming you have scipy): >> >> A = mat('[1+1j, 2+2j; 3+3j, 4+4j]') # notice the quotes >> AH = A.H # the conjugate transpose >> AT = A.T # just the tranpose >> AI = A.I # the inverse > > > > What's the difference between using quotes and using brackets [] > as Pearu suggested? BTW, I like the methods for computing the > transpose. Is something like A.shape a method or a property of > the mat class? (i.e. is computed when it's created or just when it's > needed) Using extra brackets is the "standard" way to create multi-dimensional arrays as it generates a list of lists which then gets converted to a 2D array. Using quotes only works with the "mat" approach and parallels Matlab's method of creating 2-d arrays (using commas and semicolons). Python itself will not translate semicolons in this way so the quotes are used to make it a string which can be handled by mat on it's own. -Travis From ggerber at sun.ac.za Thu Aug 7 15:35:07 2003 From: ggerber at sun.ac.za (Gerber G ) Date: Thu, 7 Aug 2003 21:35:07 +0200 Subject: [SciPy-user] Sparse matrices? Message-ID: <5CD3C38E1B0D774F9254A78617B148F0073A90@STBEVS02.stb.sun.ac.za> Hi, I am currently programming Finite Elements. Does scipy support sparse matrices? Regards, George From ugunt at em.uni-frankfurt.de Fri Aug 8 06:05:12 2003 From: ugunt at em.uni-frankfurt.de (Ulrich Guenther) Date: Fri, 8 Aug 2003 12:05:12 +0200 Subject: [SciPy-user] scipy AssertionError Message-ID: <200308081205.12084.ugunt@em.uni-frankfurt.de> On a linux installation of scipy I get an error when running scipy.test(): . ====================================================================== FAIL: check_basic (test_morestats.test_shapiro) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.2/site-packages/scipy/stats/tests/test_morestats.py", line 37, in check_basic assert_almost_equal(pw,0.52459925413131714,6) File "/usr/lib/python2.2/site-packages/scipy_test/testing.py", line 349, in assert_almost_equal assert round(abs(desired - actual),decimal) == 0, msg AssertionError: Items are not equal: DESIRED: 0.52459925413131714 ACTUAL: 0.52460002899169922 ---------------------------------------------------------------------- Ran 739 tests in 3.160s FAILED (failures=1) Where can this come from? My config: suse 8.2, kernel 2.4.20, python 2.2, gcc-3.3, lapack with atlas Ulrich From turner at lanl.gov Fri Aug 8 12:56:11 2003 From: turner at lanl.gov (John A. Turner) Date: Fri, 08 Aug 2003 10:56:11 -0600 Subject: [SciPy-user] build prob (and fix) on OSF Message-ID: <3F33D62B.6080503@lanl.gov> building 0.2.0-200.4161 on an Alpha running Tru64Unix 5.1 (also known as OSF1, and which sys.platform reports as osf1V5), ran into a failure after a huge ar command for LAPACK went hunting and found this bit in build_flib.py: if os.name == 'nt' or sys.platform[:4] == 'irix': # I (pearu) had the same problem on irix646 ... # I think we can make this "bunk" default as skip_ranlib # feature speeds things up. # XXX:Need to check if Digital compiler works here. # This is pure bunk... # Windows fails for long argument strings on the command line. # if objects is real long (> 2048 chars or so on my machine), # the command fails (cmd.exe /e:2048 on w2k). # for now we'll split linking into to steps which should work for objects = object_list[:] while objects: sure enough, changing the if test to: if os.name == 'nt' or sys.platform[:4] == 'irix' or sys.platform[:3] == 'osf': allowed me to get past that problem -John A. Turner Los Alamos National Lab Advanced Scientific Simulation, CCS-2 From turner at lanl.gov Fri Aug 8 12:59:13 2003 From: turner at lanl.gov (John A. Turner) Date: Fri, 08 Aug 2003 10:59:13 -0600 Subject: [SciPy-user] pointing to Numeric source Message-ID: <3F33D6E1.5010502@lanl.gov> I have Numeric installed in a non-standard place, so my SciPy build (0.2.0-200.4161) is failing with: building 'scipy_base.fastumath' extension cc -DNDEBUG -O -Olimit 1500 -I/usr/local/include/python2.2 -c /home/turner/Tools/src/Python/SciPy-0.2.0_alpha_200.4161/scipy_core/scipy_base/fastumathmodule.c -o build/temp.osf1-V5.1-alpha-2.2/fastumathmodule.o cc: Severe: /home/turner/Tools/src/Python/SciPy-0.2.0_alpha_200.4161/scipy_core/scipy_base/fastumathmodule.c, line 2: Cannot find file "Numeric/arrayobject.h" specified in #include directive. (noinclfilef) #include "Numeric/arrayobject.h" -^ error: command 'cc' failed with exit status 1 how can I tell setup.py where to look for the Numeric source? thx, -John A. Turner Los Alamos National Lab Advanced Scientific Simulation, CCS-2 From pearu at scipy.org Fri Aug 8 14:45:32 2003 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 8 Aug 2003 21:45:32 +0300 (EEST) Subject: [SciPy-user] pointing to Numeric source In-Reply-To: <3F33D6E1.5010502@lanl.gov> Message-ID: On Fri, 8 Aug 2003, John A. Turner wrote: > I have Numeric installed in a non-standard place, so my SciPy build > (0.2.0-200.4161) is failing with: > > building 'scipy_base.fastumath' extension > cc -DNDEBUG -O -Olimit 1500 -I/usr/local/include/python2.2 -c /home/turner/Tools/src/Python/SciPy-0.2.0_alpha_200.4161/scipy_core/scipy_base/fastumathmodule.c -o build/temp.osf1-V5.1-alpha-2.2/fastumathmodule.o > cc: Severe: /home/turner/Tools/src/Python/SciPy-0.2.0_alpha_200.4161/scipy_core/scipy_base/fastumathmodule.c, line 2: Cannot find file "Numeric/arrayobject.h" specified in #include directive. (noinclfilef) > #include "Numeric/arrayobject.h" > -^ > error: command 'cc' failed with exit status 1 > > how can I tell setup.py where to look for the Numeric source? Use python setup.py build_ext -I/path/to/dir build Pearu From turner at lanl.gov Fri Aug 8 16:16:23 2003 From: turner at lanl.gov (John A. Turner) Date: Fri, 08 Aug 2003 14:16:23 -0600 Subject: [SciPy-user] kiva build prob (was Re: pointing to Numeric source) In-Reply-To: References: Message-ID: <3F340517.6070301@lanl.gov> Pearu Peterson wrote: >>how can I tell setup.py where to look for the Numeric source? > > Use > python setup.py build_ext -I/path/to/dir build perfect - thanks next problem I ran into was during the "building 'kiva.agg._kiva' extension" phase: ld -shared -expect_unresolved * build/temp.osf1-V5.1-alpha-2.2/_kiva.o build/temp.osf1-V5.1-alpha-2.2/agg_rendering_buffer.o build/temp.osf1-V5.1-alpha-2.2/agg_image_transform.o build/temp.osf1-V5.1-alpha-2.2/agg_affine_matrix.o build/temp.osf1-V5.1-alpha-2.2/agg_scanline_u8.o build/temp.osf1-V5.1-alpha-2.2/agg_gsv_text.o build/temp.osf1-V5.1-alpha-2.2/agg_arrowhead.o build/temp.osf1-V5.1-alpha-2.2/agg_arc.o build/temp.osf1-V5.1-alpha-2.2/agg_gen_smooth_poly1.o build/temp.osf1-V5.1-alpha-2.2/agg_gen_stroke.o build/temp.osf1-V5.1-alpha-2.2/agg_curves.o build/temp.osf1-V5.1-alpha-2.2/agg_gen_markers_term.o build/temp.osf1-V5.1-alpha-2.2/agg_sqrt_tables.o build/temp.osf1-V5.1-alpha-2.2/agg_gen_clip_polygon.o build/temp.osf1-V5.1-alpha-2.2/agg_rasterizer.o build/temp.osf1-V5.1-alpha-2.2/agg_path_storage.o build/temp.osf1-V5.1-alpha-2.2/agg_bspline.o build/temp.osf1-V5.1-alpha-2.2/agg_gen_dash.o build/temp.osf1-V5.1-alpha-2.2/agg_rounded_rect.o build/temp.osf1-V5.1-alpha-2.2/weav e_imp.o build/temp.osf1-V5.1-alpha-2.2/agg_gen_contour.o -Lbuild/temp.osf1-V5.1-alpha-2.2 -lc_misc -lcephes -lrootfind -o build/lib.osf1-V5.1-alpha-2.2/kiva/agg/_kiva.so ld: Can't open: build/temp.osf1-V5.1-alpha-2.2/_kiva.o (No such file or directory) thanks again - I can usually figure out build problems like these myself, but I'm finding the SciPy build process to be rather... complex... thx... -John From ugunt at em.uni-frankfurt.de Thu Aug 7 19:43:35 2003 From: ugunt at em.uni-frankfurt.de (Ulrich Guenther) Date: Fri, 8 Aug 2003 01:43:35 +0200 Subject: [SciPy-user] scipy AssertionError Message-ID: <200308080143.36779.ugunt@em.uni-frankfurt.de> On a linux installation of scipy I get an error when running scipy.test(): . ====================================================================== FAIL: check_basic (test_morestats.test_shapiro) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.2/site-packages/scipy/stats/tests/test_morestats.py", line 37, in check_basic assert_almost_equal(pw,0.52459925413131714,6) File "/usr/lib/python2.2/site-packages/scipy_test/testing.py", line 349, in assert_almost_equal assert round(abs(desired - actual),decimal) == 0, msg AssertionError: Items are not equal: DESIRED: 0.52459925413131714 ACTUAL: 0.52460002899169922 ---------------------------------------------------------------------- Ran 739 tests in 3.160s FAILED (failures=1) Where can this come from? My config: suse 8.2, kernel 2.4.20, python 2.2, gcc-3.3, lapack with atlas Ulrich From "oliphant." at ee.byu.edu Fri Aug 8 13:24:17 2003 From: "oliphant." at ee.byu.edu (Travis Oliphant) Date: Fri, 08 Aug 2003 11:24:17 -0600 Subject: [SciPy-user] scipy AssertionError In-Reply-To: <200308081205.12084.ugunt@em.uni-frankfurt.de> References: <200308081205.12084.ugunt@em.uni-frankfurt.de> Message-ID: <3F33DCC1.8090704@ee.byu.edu> Ulrich Guenther wrote: > On a linux installation of scipy > I get an error when running scipy.test(): > . > ====================================================================== > FAIL: check_basic (test_morestats.test_shapiro) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/usr/lib/python2.2/site-packages/scipy/stats/tests/test_morestats.py", > line 37, in check_basic > assert_almost_equal(pw,0.52459925413131714,6) > File "/usr/lib/python2.2/site-packages/scipy_test/testing.py", line 349, in > assert_almost_equal > assert round(abs(desired - actual),decimal) == 0, msg > AssertionError: > Items are not equal: > DESIRED: 0.52459925413131714 > ACTUAL: 0.52460002899169922 > This is not an error, you have an older version of scipy than the current CVS which is too strict in its testing. The two numbers are quite close but not six decimal places. -Travis O. > ---------------------------------------------------------------------- > Ran 739 tests in 3.160s > > FAILED (failures=1) > > > Where can this come from? > > My config: suse 8.2, kernel 2.4.20, python 2.2, gcc-3.3, lapack with atlas > > Ulrich > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From "oliphant." at ee.byu.edu Fri Aug 8 15:12:39 2003 From: "oliphant." at ee.byu.edu (Travis Oliphant) Date: Fri, 08 Aug 2003 13:12:39 -0600 Subject: [SciPy-user] Sparse matrices? In-Reply-To: <5CD3C38E1B0D774F9254A78617B148F0073A90@STBEVS02.stb.sun.ac.za> References: <5CD3C38E1B0D774F9254A78617B148F0073A90@STBEVS02.stb.sun.ac.za> Message-ID: <3F33F627.7050007@ee.byu.edu> Gerber G wrote: > Hi, > > I am currently programming Finite Elements. Does scipy support sparse matrices? > The answer is yes, but only in an "alpha" state and there are some licensing issues. For this reason you have to check SciPy out from CVS to get it. The sparse matrix support is functional but has not been rigorously tested (I think I'm one of the only people that has ever used it). It is based on SPARSKIT from Yousaf Saad (which is GPL'd causing some licensing difficulty because SciPy does not want to include GPL software with it's redistribution restrictions) and SuperLU1.1 (I'm in the process of upgrading to SuperLU2.0) which has a segmentation fault problem I encountered on "larger" matrices. There is also a weak wrapper around UMFPACK2.2 (which needs to be upgraded to UMFPACK4.1) that I and others have used to solve larger Finite Element problems. If you would like to help with the development of the sparse package let me know. Best, Travis Oliphant From ugunt at em.uni-frankfurt.de Fri Aug 8 00:34:32 2003 From: ugunt at em.uni-frankfurt.de (Ulrich Guenther) Date: Fri, 8 Aug 2003 06:34:32 +0200 Subject: [SciPy-user] scipy AssertionError Message-ID: <200308080634.33015.ugunt@em.uni-frankfurt.de> On a linux installation of scipy I get an error when running scipy.test(): . ====================================================================== FAIL: check_basic (test_morestats.test_shapiro) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.2/site-packages/scipy/stats/tests/test_morestats.py", line 37, in check_basic assert_almost_equal(pw,0.52459925413131714,6) File "/usr/lib/python2.2/site-packages/scipy_test/testing.py", line 349, in assert_almost_equal assert round(abs(desired - actual),decimal) == 0, msg AssertionError: Items are not equal: DESIRED: 0.52459925413131714 ACTUAL: 0.52460002899169922 ---------------------------------------------------------------------- Ran 739 tests in 3.160s FAILED (failures=1) Where can this come from? My config: suse 8.2, kernel 2.4.20, python 2.2, gcc-3.3, lapack with atlas Ulrich From ggerber at sun.ac.za Sat Aug 9 06:34:10 2003 From: ggerber at sun.ac.za (Gerber G ) Date: Sat, 9 Aug 2003 12:34:10 +0200 Subject: [SciPy-user] Sparse matrices? Message-ID: <5CD3C38E1B0D774F9254A78617B148F0073A94@STBEVS02.stb.sun.ac.za> I am still (fairly) new to python, therefore unless the wrapping process is quite mechanical, I would be of little use. eorge -----Original Message----- From: Travis Oliphant [mailto:"oliphant."@ee.byu.edu] Sent: Fri 8/8/2003 9:12 PM To: scipy-user at scipy.net Cc: Subject: Re: [SciPy-user] Sparse matrices? Gerber G wrote: > Hi, > > I am currently programming Finite Elements. Does scipy support sparse matrices? > The answer is yes, but only in an "alpha" state and there are some licensing issues. For this reason you have to check SciPy out from CVS to get it. The sparse matrix support is functional but has not been rigorously tested (I think I'm one of the only people that has ever used it). It is based on SPARSKIT from Yousaf Saad (which is GPL'd causing some licensing difficulty because SciPy does not want to include GPL software with it's redistribution restrictions) and SuperLU1.1 (I'm in the process of upgrading to SuperLU2.0) which has a segmentation fault problem I encountered on "larger" matrices. There is also a weak wrapper around UMFPACK2.2 (which needs to be upgraded to UMFPACK4.1) that I and others have used to solve larger Finite Element problems. If you would like to help with the development of the sparse package let me know. Best, Travis Oliphant _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3206 bytes Desc: not available URL: From eni at Mathematik.Uni-Marburg.de Mon Aug 11 13:35:11 2003 From: eni at Mathematik.Uni-Marburg.de (Eni Mustafaraj) Date: Mon, 11 Aug 2003 19:35:11 +0200 Subject: [SciPy-user] scipy.gplt versus IPython.GnuplotRuntime Message-ID: <3F37D3CF.5060502@informatik.uni-marburg.de> Hello, I am interested in dynamically generating plot images for web-pages. I looked first at Chaco, but its non-interactive functionalities are not very well documented, and so I turned to scipy.gplt, having previously worked with gnuplot and Gnuplot.py (from Sourceforge). I found scipy.gplt very easy to work with, and it is fine to have a direct output of PNG (exactly what I need), but the whole thing is rather slow (see the test below). Afterwards, reading through the Scipy-users archive I found out about the IPython.GnuplotRuntime, tried it out, and it's great to see that it handles some of the deficiencies of Gnuplot.py, and is so fast compared to scipy.gplt. I just tested the following two examples with "profile" (in the same Windows box, with Python 2.2.3): # Example 1 from scipy import gplt import Numeric def myPlot_1(): x = Numeric.arange(0,10,.1) y = Numeric.sin(x) gplt.plot(x,y, 'with linespoints lt 3 pt 6') gplt.title('Plotting with gplt') gplt.output('test_1.png', 'png color') # Example 2 import Numeric import IPython.GnuplotRuntime def myPlot_3(): gp = IPython.GnuplotRuntime.gp Data = IPython.GunplotRuntime.Data x = Numeric.arange(0,10,.1) y = Numeric.sin(x) gp('set title "Plotting with IPython.GnuplotRuntime"') gp.plot(Data(x,y,with='linespoints lt 3 pt 6')) gp.hardcopy('test_3.ps', enhanced=1, color=1) The results: >>> profile.run('myPlot_1()') >>> 306 function calls in 2.507 CPU seconds >>> profile.run('myPlot_3()') >>> IE *** Your version of Gnuplot appears not to have mouse support. 82 function calls in 0.201 CPU seconds So, I have a couple of questions: 1) Why is scipy.gplt so much slower than IPython.GnuplotRuntime? Well, I see it is calling a lot more functions, but why should it be this way, since the result is going to be the same in both examples (except that one produces a PNG and the other a Postscript, but the slowness persists even when no output file is requested). 2) How to suppress the gnuplot window for both packages? ( since only the file ouptut is interesting) 3) Can IPython.GnuplotRuntime also output a PNG file? How? Thanks for helping, and keep doing the wornderful job! Eni From fperez at colorado.edu Mon Aug 11 13:53:19 2003 From: fperez at colorado.edu (Fernando Perez) Date: Mon, 11 Aug 2003 11:53:19 -0600 Subject: [SciPy-user] scipy.gplt versus IPython.GnuplotRuntime In-Reply-To: <3F37D3CF.5060502@informatik.uni-marburg.de> References: <3F37D3CF.5060502@informatik.uni-marburg.de> Message-ID: <3F37D80F.7000708@colorado.edu> Eni Mustafaraj wrote: > 2) How to suppress the gnuplot window for both packages? ( since only > the file ouptut is interesting) When using ipython, just pass the filename='yourfile.eps' argument _directly_ to the plot() routine. If you do that, no output window is ever generated. I've attached here a simple example of how to use the ipython gnuplot support for scripting plot generation. If you want, I can send you vastly more complicated examples. > 3) Can IPython.GnuplotRuntime also output a PNG file? How? It could, if I coded it :) Consider it a feature request. Since I basically just 'fixed' what I found to be small annoyances of the original Gnuplot.py for my own use, I didn't go into making any extensions for other types of output. And eps happens to be the kind of output I always use, so I just left it at that. But nothing prevents from adding png output support. Right now, your request goes unfortunately to the bottom of the list. But if you have the time/energy to code it yourself, feel free to send me a patch and I'll gladly include it in the next release. Best, f. -------------- next part -------------- A non-text attachment was scrubbed... Name: gnuplot_example.tgz Type: application/unix-tar Size: 4783 bytes Desc: not available URL: From ugunt at em.uni-frankfurt.de Mon Aug 11 18:43:00 2003 From: ugunt at em.uni-frankfurt.de (Ulrich Guenther) Date: Tue, 12 Aug 2003 00:43:00 +0200 Subject: [SciPy-user] SciPy-user] scipy AssertionError Message-ID: <200308120043.00208.ugunt@em.uni-frankfurt.de> FIrst I am sorry for posting this 3 times. I got a message that I am not a member of the lists yet twice. Now I don't know how to answer my oen post. Anyhow. I arbitrarily changed assert_almost_equal(pw,0.52459925413131714,6) to assert_almost_equal(pw,0.52459925413131714,5) Now it passes all tests. And all are much faster than the same functions in Numeric. This shows that there is some small roundoff error in test_shapiro(unittest.TestCase) I would use it carefully. BTW I also succeeded to compile the whole package with linpack and atlas under SuSE 8.2. I will post instructions after my vacation. If there is a lot of demand I can try an rpm. Ulrich From eni at Mathematik.Uni-Marburg.de Tue Aug 12 04:15:29 2003 From: eni at Mathematik.Uni-Marburg.de (Eni Mustafaraj) Date: Tue, 12 Aug 2003 10:15:29 +0200 Subject: [SciPy-user] scipy.gplt versus IPython.GnuplotRuntime In-Reply-To: <3F37D80F.7000708@colorado.edu> References: <3F37D3CF.5060502@informatik.uni-marburg.de> <3F37D80F.7000708@colorado.edu> Message-ID: <3F38A221.4030503@informatik.uni-marburg.de> Fernando Perez wrote: > I've attached here a simple example of how to use the ipython gnuplot > support for scripting plot generation. If you want, I can send you > vastly more complicated examples. Thanks for the example. It gives me the idea. Only a small correction was needed for my gnuplot installation Instead of the command: "set style line .... " , the command "set linestyle ...." was necessary, otherwise it did not work. > 3) Can IPython.GnuplotRuntime also output a PNG file? How? > > It could, if I coded it :) Consider it a feature request. > ... > Right now, your request goes unfortunately to the bottom of the list. > But if you have the time/energy to code it yourself, feel free to send > me a patch and I'll gladly include it in the next release. Well, if I knew how to do it :-). Nevertheless, I tried it the usual way, and it seems to work ( I forget sometimes to try first the simplest solution). >> import IPython.GnuplotRuntime as GP >> gp = GP.gp >> gp(""" set term png color set output "test.png" set nokey set grid mxtics mytics """) >> gp.plot(GP.Data(x,y, with='linespoints lt 3 lw 3 pt 6')) And indeed the PNG file is created. The only problem, which has nothing to do with your package, is that in Windows, the "linewidth" command does not appear to have effect on the window terminal and the PNG output, but it works only for a postscript output. regards, Eni From ptak at pha.jhu.edu Wed Aug 13 11:53:33 2003 From: ptak at pha.jhu.edu (Andrew Ptak) Date: Wed, 13 Aug 2003 11:53:33 -0400 (EDT) Subject: [SciPy-user] 3D scatter plots In-Reply-To: <20030715170001.15241.42787.Mailman@scipy.org> Message-ID: Hello, I need to a make a simple 3D scatter plot. Does anybody have a favorite method for this, obviously preferably using Python since right now my data is in Numeric arrays. Being able to have upper-limits for one of the axes would be a big plus also (altough I can work around that easily if I can draw lines). It seems like most 3D plotting tools (not surprisingly) emphasize mainly volume and surface visualization. Thanks, Andy Ptak From lawnmowerman_0 at yahoo.com Wed Aug 13 15:31:40 2003 From: lawnmowerman_0 at yahoo.com (Jun Sung) Date: Wed, 13 Aug 2003 12:31:40 -0700 (PDT) Subject: [SciPy-user] strange error with win32 build for py21 Message-ID: <20030813193140.25875.qmail@web42003.mail.yahoo.com> Dear experts: I am getting very strange error with SciPy-0.2.0-alpha. All multiplication involving array (array*scalar) coerces fractions into 0's. I have tracked the error down to fastumath module in scipy_base. For example: >>> import Numeric >>> x=Numeric.arange(11.) >>> x*.5 array([ 0. , 0.5, 1. , 1.5, 2. , 2.5, 3. , 3.5, 4. , 4.5, 5. ]) >>> import scipy_base.fastumath >>> x*.5 array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]) Furthermore, as seen in "scipy_base/limits.py" , when two arrays with float typecodes are multiplied, Python throws an ArithmeticError: Integer overflow in multiply. Should I bother with the C code or is there an obvious clue I need to get. Thanks, in advance. /js --------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez at colorado.edu Thu Aug 14 17:29:12 2003 From: fperez at colorado.edu (Fernando Perez) Date: Thu, 14 Aug 2003 15:29:12 -0600 Subject: [SciPy-user] Why is weave.inline()/blitz++ code 3 times slower than innerproduct()? Message-ID: <3F3BFF28.7020900@colorado.edu> Hi all, I think one of the strongest points in favor of python for scientific computing is the ability to write low-level code, when necessary, which can perform on-par with hand-rolled Fortran. In the past, I've been very pleased using weave's inline() tool, which relies on blitz for manipulating Numpy arrays with an very clean and convenient syntax. This is important, because manipulating multidimensional Numeric arrays in C is rather messy, and the resulting code isn't exactly an example of readability. Blitz arrays end up looking just like regular arrays, using (i,j,k) instead of [i][j][k] for indexing. Recently, I needed to do an operation which turned out to be pretty much what Numpy's innerproduct() does. I'd forgotten about innerproduct(), so I just wrote my own using inline(). Later I saw innerproduct(), and decided to compare the results. I'm a little worried by what I found, and I'd like to hear some input from the experts on this problem. I've attached all the necessary code to run my tests, in case someone is willing to do it and take a look. In summary, I found some things which concern me (a README is included in the .tgz with more info): - the blitz code, whether via inline() or a purely hand-written extension, is ~2.5 to 3 times slower than innerproduct(). Considering that this code is specialized to a few sizes and data types, this comes as a big surprise. If the only way to get maximum performance with Numpy arrays is to write by hand to the full low-level api, I know that many people will shy away from python for a certain class of projects. I truly hope I'm missing something here. - There is a significant numerical discrepancy between the two approaches (blitz vs numpy). In an innerproduct operation over 7000 entries, the discrepancy is O(1e-10) (in l2 norm). This is more than I'm comfortable with, but perhaps I'm being naive or optimistic. I view the ability to get blitzed code which performs on par with Fortran as a very important aspect of python's suitability for large-scale project where every last bit of performance matters, but where one still wants to have the ability to work with a reasonably clean syntax. I hope I'm just misusing some tools and not faced with a fundamental limitation. By the way, I'll come to Scipy'03 with many more questions/concerns along these lines, and I think it would be great to have some discussions on these issues there with the experts. Thanks in advance. Cheers, f. -------------- next part -------------- A non-text attachment was scrubbed... Name: py_inner.tgz Type: application/unix-tar Size: 6059 bytes Desc: not available URL: From kern at caltech.edu Thu Aug 14 20:22:41 2003 From: kern at caltech.edu (Robert Kern) Date: Thu, 14 Aug 2003 17:22:41 -0700 Subject: [SciPy-user] Why is weave.inline()/blitz++ code 3 times slower than innerproduct()? In-Reply-To: <3F3BFF28.7020900@colorado.edu> References: <3F3BFF28.7020900@colorado.edu> Message-ID: <20030815002241.GA20957@taliesen.caltech.edu> On Thu, Aug 14, 2003 at 03:29:12PM -0600, Fernando Perez wrote: > Hi all, [snip] > - the blitz code, whether via inline() or a purely hand-written extension, > is ~2.5 to 3 times slower than innerproduct(). Considering that this code > is specialized to a few sizes and data types, this comes as a big surprise. > If the only way to get maximum performance with Numpy arrays is to write by > hand to the full low-level api, I know that many people will shy away from > python for a certain class of projects. I truly hope I'm missing something > here. I tried your code with g++ 3.3.1, Python 2.3, Numeric 23.0, CVS SciPy on Debian Linux (kernel 2.4.21), Athlon XP 2100, 512 MB RAM. I tried to minimize other processes running. My results with your pristine code aren't nearly as consistent as yours. As a test, I tried doing the same timings with the standard module timeit.py (slightly modified to pass in the same arrays for each case). I obtained the most repeatable (no pun intended) results by using the Timer.repeat method. I used it to measure the time it took to run the code 10 times, then repeated that measurement three times. According to the timeit.py docs, the minimum of those three measurements is probably closest to the minimum running time on the machine. By default on non-Windows platforms, timeit.py uses time.time for its clock. I repeated the test with inner.clock. Except for the ndim=2 handwritten case, the times are looking more realistic, but neither inline nor handwritten code seems to clearly win over NumPy. Attached are my_results10min3 (10 reps, minimum of 3 trials, time.time) and my_results10min3_rusage (10 reps, minimum of 3 trials, inner.clock). I see the same numerical errors as you, so they are not included in the output here. In short, try more repetitions and see if you can reproduce the consistently 2.5-3 times slower results. -- Robert Kern kern at caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -------------- next part -------------- In timings, t/t_numpy is -1 if t_numpy==0 (too small to measure) ndim 1 size 7000 Type t(s) t/t_numpy NumPy 7.13062298298 hand 7.40015399456 1.04 inline 7.06557095051 0.99 ndim 2 size 500 Type t(s) t/t_numpy NumPy 2.37221598625 hand 17.6259549856 7.43 inline 2.09143197536 0.88 ndim 3 size 100 Type t(s) t/t_numpy NumPy 11.7430689335 hand 15.2072480917 1.29 inline 11.7263020277 1.00 ndim 4 size 35 Type t(s) t/t_numpy NumPy 7.2849919796 hand 8.51563000679 1.17 inline 7.25194501877 1.00 ndim 5 size 20 Type t(s) t/t_numpy NumPy 11.2177408934 hand 10.9473650455 0.98 inline 11.210021019 1.00 ndim 6 size 13 Type t(s) t/t_numpy NumPy 12.1791609526 hand 13.3315039873 1.09 inline 12.1484740973 1.00 -------------- next part -------------- In timings, t/t_numpy is -1 if t_numpy==0 (too small to measure) ndim 1 size 7000 Type t(s) t/t_numpy NumPy 6.57 hand 6.86 1.04 inline 6.48 0.99 ndim 2 size 500 Type t(s) t/t_numpy NumPy 1.93 hand 8.42 4.36 inline 2.0 1.04 ndim 3 size 100 Type t(s) t/t_numpy NumPy 11.43 hand 14.93 1.31 inline 11.38 1.00 ndim 4 size 35 Type t(s) t/t_numpy NumPy 6.65 hand 6.82 1.03 inline 3.01 0.45 ndim 5 size 20 Type t(s) t/t_numpy NumPy 10.53 hand 10.73 1.02 inline 10.51 1.00 ndim 6 size 13 Type t(s) t/t_numpy NumPy 9.83 hand 7.72 0.79 inline 11.56 1.18 From fperez at colorado.edu Thu Aug 14 20:42:23 2003 From: fperez at colorado.edu (Fernando Perez) Date: Thu, 14 Aug 2003 18:42:23 -0600 Subject: [SciPy-user] Why is weave.inline()/blitz++ code 3 times slower than innerproduct()? In-Reply-To: <20030815002241.GA20957@taliesen.caltech.edu> References: <3F3BFF28.7020900@colorado.edu> <20030815002241.GA20957@taliesen.caltech.edu> Message-ID: <3F3C2C6F.5050401@colorado.edu> Robert Kern wrote: > I tried your code with g++ 3.3.1, Python 2.3, Numeric 23.0, CVS SciPy on > Debian Linux (kernel 2.4.21), Athlon XP 2100, 512 MB RAM. I tried to > minimize other processes running. For reference, I'm using a stock RedHat9 installation (python 2.2.2, gcc 3.2.2) with Numpy 22.0 and scipy from CVS of july 9th. The hardware is a Pentium 4 at 2.8 Ghz with 1 Gb of RAM. > My results with your pristine code aren't nearly as consistent as yours. > > As a test, I tried doing the same timings with the standard module > timeit.py (slightly modified to pass in the same arrays for each case). > I obtained the most repeatable (no pun intended) results by using the > Timer.repeat method. I used it to measure the time it took to run the > code 10 times, then repeated that measurement three times. According to > the timeit.py docs, the minimum of those three measurements is probably > closest to the minimum running time on the machine. By default on > non-Windows platforms, timeit.py uses time.time for its clock. I > repeated the test with inner.clock. inner.clock uses rusage just to avoid wraparound effects, which only matters for long-running codes. For short runs, it should give similar results to time.time (under *nix). > Except for the ndim=2 handwritten case, the times are looking more > realistic, but neither inline nor handwritten code seems to clearly win > over NumPy. Funny. I don't quite understand why the n=2 case is so bloody slow in the hand-written case. The dimensionality dispatch is a single switch() statement in C++. This should be a hell of a lot faster than all the sophisticated magic which inline() does to dispatch, and which is done in pure python to boot. Plus, the up-front overhead in the C++ generated by inline() is _far_ bigger than what my hand-written code has. This one still puzzles me to no end. I actually wrote my code by taking one of inline's auto-generated .cpp files, and stripping out everything but the core. All checks, try/catch blocks, everything is gone. And now the code is slower! I don't get it. > Attached are my_results10min3 (10 reps, minimum of 3 trials, time.time) > and my_results10min3_rusage (10 reps, minimum of 3 trials, inner.clock). > > I see the same numerical errors as you, so they are not included in the > output here. > > In short, try more repetitions and see if you can reproduce the > consistently 2.5-3 times slower results. I've ran my tests many many times, and the 2.5-3 results have been consistent (I've been pounding on this since Monday). I'm wondering if the key difference here is gcc. You're using 3.3.1, I'm using 3.2.2, and blitz code taxes a compiler's templating abilities pretty hard. At any rate, I greatly appreciate your input. At least knowing that _someone_ can get the performance right makes me sleep much better. Right now I'm not in production mode yet, so the performance problem isn't a real issue. But it will be later, so I need to know that there's a solution ahead. Basically if I say to my boss, "there's an unpassable factor of 3 loss in performance unless we code to the very low-level APIs", I'll be learning Fortran77 soon. And for me, that's a short road to the asylum ;) Again, many thanks for running these tests. Regards, Fernando. From fperez at colorado.edu Thu Aug 14 22:15:31 2003 From: fperez at colorado.edu (Fernando Perez) Date: Thu, 14 Aug 2003 20:15:31 -0600 Subject: [SciPy-user] Why is weave.inline()/blitz++ code 3 times slower than innerproduct()? In-Reply-To: <3F3C2C6F.5050401@colorado.edu> References: <3F3BFF28.7020900@colorado.edu> <20030815002241.GA20957@taliesen.caltech.edu> <3F3C2C6F.5050401@colorado.edu> Message-ID: <3F3C4243.8070203@colorado.edu> Fernando Perez wrote: > I'm wondering if the key difference here is gcc. You're using 3.3.1, I'm > using 3.2.2, and blitz code taxes a compiler's templating abilities pretty hard. Indeed, the compiler seems to be a key player in this little saga. Here are some more test results, ran on the same machine with the following compiler configurations: 1. CXX = g++ CXXFLAGS = -DNDEBUG -O3 -Wstrict-prototypes -fPIC 2. CXX = icc (Intel C++ compiler) CXXFLAGS = -O3 -xW (All optimizations for Pentium4 on, including SSE2) 3. And finally with icc and no optimizations. I only print the ratios of running times between the hand-written and the Numeric codes, since I didn't fiddle with changing compilers for inline(). G++ -O3 Icc -O3 Icc (no optim) ndim:1-size:7000 Type t/t_npy t/t_npy t/t_npy hand 2.89 3.81 2.9 ndim:2-size:500 hand 2.83 4.64 4.49 ndim:3-size:100 hand 2.94 5.43 5.28 ndim:4-size:35 hand 2.71 5.68 6 ndim:5-size:20 hand 2.41 6.36 6.14 ndim:6-size:13 hand 2.54 6.44 6.48 As you can see, icc doesn't exactly shine on these tests :) (and from R. Kern's data, it would fare even worse against g++ 3.3.1, which has much better numbers than my 3.2.2). Cheers, f. From eric at enthought.com Fri Aug 15 13:33:21 2003 From: eric at enthought.com (eric jones) Date: Fri, 15 Aug 2003 12:33:21 -0500 Subject: [SciPy-user] ANN: Job posting -- developer position available Message-ID: <00a001c36353$55c9f4c0$8901a8c0@ERICDESKTOP> Hey group, We have a developer position open here at Enthought, and I thought I'd see if anyone is interested. The posting is below. There is also a tech writer and HCI opening listed on the website: http://www.enthought.com/careers.html thanks! eric Position: Python Developer Type: Full-Time Enthought, Inc. is a technology startup in the Austin, TX area that is looking for a motivated Python Developer to join our development team. Responsibilities include developing and deploying scientific applications within the Fortune 500. Our size and prospects provide significant opportunity for growth and advancement for Enthought employees. Candidates should have the following qualifications: - BS or MS in Computer Science or Engineering or other scientific field - 3+ years experience in the software industry - Experience developing solutions in the following languages: - Python - C/C++ - User interface design experience - Developing and deploying custom solutions for clients - Excellent verbal and written communication skills Ideal candidates will also demonstrate the following skills: - Use of the wxPython user interface library - Experience with Geophysics applications - Experience in the fields of statistics, linear algebra and calculus Please send resumes to jobs at enthought.com. ---------------------------------------------- eric jones 515 Congress Ave www.enthought.com Suite 1614 512 536-1057 Austin, Tx 78701 From vlad.popovici at epfl.ch Sun Aug 17 09:22:27 2003 From: vlad.popovici at epfl.ch (vlad.popovici at epfl.ch) Date: Sun, 17 Aug 2003 15:22:27 +0200 Subject: [SciPy-user] tests failed (failures=3, errors=2) Message-ID: <1061126547.3f3f819386076@imapwww.epfl.ch> Hi all, I have just build the last version of SciPy on my Linux2 box and a few tests failed. It seems they are related to the precision of operations. Here are the details of my installation: SciPy: 0.2.0_alpha_200.4161 Machine: SuSE 8.2 Pro, Linux 2.4.20-4GB on P4 Python: 2.3 build with gcc3.3 Libraries: optimized ATLAS+LAPACK, Numeric 23.1, numarray 0.6.1, f2py 2.35. 229-1505 Error messages: ====================================================================== ERROR: check_chebyc (test_basic.test_chebyc) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.3/site-packages/scipy/special/tests/test_basic. py", line 214, in check_chebyc chebc = chebyc(1)(.2) File "/usr/local/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 398, in chebyc p = p * 2.0/p(2) File "/usr/local/lib/python2.3/site-packages/scipy_base/polynomial.py", line 445, in __getattr__ raise KeyError KeyError ====================================================================== ERROR: check_chebys (test_basic.test_chebys) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.3/site-packages/scipy/special/tests/test_basic. py", line 220, in check_chebys chebs = chebys(1)(.2) File "/usr/local/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 429, in chebys p = p * (n+1.0)/p(2) File "/usr/local/lib/python2.3/site-packages/scipy_base/polynomial.py", line 445, in __getattr__ raise KeyError KeyError ====================================================================== FAIL: check_basic (test_morestats.test_shapiro) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.3/site-packages/scipy/stats/tests/test_morestats. py", line 37, in check_basic assert_almost_equal(pw,0.52459925413131714,6) File "/usr/local/lib/python2.3/site-packages/scipy_test/testing.py", line 349, in assert_almost_equal assert round(abs(desired - actual),decimal) == 0, msg AssertionError: Items are not equal: DESIRED: 0.52459925413131714 ACTUAL: 0.52460002899169922 ====================================================================== FAIL: check_random_complex (test_decomp.test_cholesky) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.3/site-packages/scipy/linalg/tests/test_decomp. py", line 273, in check_random_complex assert_array_almost_equal(cholesky(a),c) File "/usr/local/lib/python2.3/site-packages/scipy_test/testing.py", line 405, in assert_array_almost_equal assert alltrue(ravel(reduced)),\ AssertionError: Arrays are not almost equal: ====================================================================== FAIL: check_simple_complex (test_decomp.test_cholesky) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python2.3/site-packages/scipy/linalg/tests/test_decomp. py", line 247, in check_simple_complex assert_array_almost_equal(cholesky(a),c) File "/usr/local/lib/python2.3/site-packages/scipy_test/testing.py", line 405, in assert_array_almost_equal assert alltrue(ravel(reduced)),\ AssertionError: Arrays are not almost equal: ---------------------------------------------------------------------- Ran 753 tests in 106.078s FAILED (failures=3, errors=2) Is this a problem related to SciPy/Python or to the underlying libraries (lapack,...)? Thanks, Vlad From chris at fonnesbeck.org Sun Aug 17 09:33:15 2003 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Sun, 17 Aug 2003 09:33:15 -0400 Subject: [SciPy-user] multivariate normal Message-ID: <5B2C219C-D0B7-11D7-97AC-000A956FDAC0@fonnesbeck.org> I notice that distributions.py in scipy.stats only deals with univariate distributions. Does anyone know where there are python libraries that provide multivariate pdfs? I'm developing some Markov chain Monte Carlo code using simpy and scipy, and need access to multivariate normal likelihood functions. Thanks, Chris -- Christopher J. Fonnesbeck (chris at fonnesbeck dot org) GA Coop. Fish & Wildlife Research Unit, University of Georgia From rossini at blindglobe.net Sun Aug 17 21:07:21 2003 From: rossini at blindglobe.net (A.J. Rossini) Date: Sun, 17 Aug 2003 18:07:21 -0700 Subject: [SciPy-user] multivariate normal In-Reply-To: <5B2C219C-D0B7-11D7-97AC-000A956FDAC0@fonnesbeck.org> (Christopher Fonnesbeck's message of "Sun, 17 Aug 2003 09:33:15 -0400") References: <5B2C219C-D0B7-11D7-97AC-000A956FDAC0@fonnesbeck.org> Message-ID: <85wudb7oza.fsf@blindglobe.net> Christopher Fonnesbeck writes: > I notice that distributions.py in scipy.stats only deals with > univariate distributions. Does anyone know where there are python > libraries that provide multivariate pdfs? I'm developing some Markov > chain Monte Carlo code using simpy and scipy, and need access to > multivariate normal likelihood functions. Should be pretty easy to generate by appropriately applying the covariance matrix plus shift for any mean effect to a vector of univariate normals. best, -tony -- A.J. Rossini rossini at u.washington.edu http://www.analytics.washington.edu/ Biomedical and Health Informatics University of Washington Biostatistics, SCHARP/HVTN Fred Hutchinson Cancer Research Center UW : FAX=206-543-3461 | moving soon to a permanent office FHCRC: 206-667-7025 FAX=206-667-4812 | Voicemail is pretty sketchy/use Email CONFIDENTIALITY NOTICE: This e-mail message and any attachments may be confidential and privileged. If you received this message in error, please destroy it and notify the sender. Thank you. From t.wolfanger at tlt.de Mon Aug 18 07:54:05 2003 From: t.wolfanger at tlt.de (Thomas Wolfanger) Date: 18 Aug 2003 13:54:05 +0200 Subject: [SciPy-user] SciPy Debian package from http://jrfonseca.dyndns.org/debian Message-ID: <1061207645.1186.12.camel@wonb> Hallo all, I'm using linux/debian testing, python 2.2.3+ and tried to install SciPy from Jose Fonsecas debian repository (python-scipy_0.2.0+alpha144.4350-1_i386.deb). The following error occurs when using scipy: Python 2.2.3+ (#1, Jul 5 2003, 11:04:18) [GCC 3.3.1 20030626 (Debian prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from scipy.integrate import odeint Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.2/site-packages/scipy_base/ppimport.py", line 222, in __getattr__ module = self._ppimport_importer() File "/usr/lib/python2.2/site-packages/scipy_base/ppimport.py", line 190, in _ppimport_importer raise PPImportError,\ scipy_base.ppimport.PPImportError: Traceback (most recent call last): File "/usr/lib/python2.2/site-packages/scipy_base/ppimport.py", line 200, in _ppimport_importer module = __import__(name,None,None,['*']) File "/usr/lib/python2.2/site-packages/scipy/integrate/__init__.py", line 10, in ? from quadpack import * File "/usr/lib/python2.2/site-packages/scipy/integrate/quadpack.py", line 7, in ? import MLab ImportError: No module named MLab What am I missing there? Greetings, Thomas From lawnmowerman_0 at yahoo.com Mon Aug 18 17:41:06 2003 From: lawnmowerman_0 at yahoo.com (Jun Sung) Date: Mon, 18 Aug 2003 14:41:06 -0700 (PDT) Subject: [SciPy-user] strange error with win32 build for py21 Message-ID: <20030818214106.29093.qmail@web42006.mail.yahoo.com> Dear experts: ? I am getting very strange error with SciPy-0.2.0-alpha. All multiplication involving array (array*scalar) coerces fractions into 0's. I have tracked the error down to fastumath module in scipy_base. ? For example: >>> import Numeric >>> x=Numeric.arange(11.) >>> x*.5 array([ 0. ,? 0.5,? 1. ,? 1.5,? 2. ,? 2.5,? 3. ,? 3.5,? 4. ,? 4.5,? 5. ]) >>> import scipy_base.fastumath >>> x*.5 array([ 0.,? 0.,? 0.,? 0.,? 0.,? 0.,? 0.,? 0.,? 0.,? 0.,? 0.]) ? ? Furthermore,?as seen in?"scipy_base/limits.py" , when two arrays with float typecodes are multiplied,?Python throws an ArithmeticError: Integer overflow in multiply. ? Should I bother with the C code or is there an obvious clue I need to get. Thanks, in advance. /js __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com From ferrell at diablotech.com Mon Aug 18 19:14:24 2003 From: ferrell at diablotech.com (Robert Ferrell) Date: Mon, 18 Aug 2003 23:14:24 -0000 (GMT) Subject: [SciPy-user] SciPy, IPython, XEmacs & Windows Message-ID: <4219.128.165.144.120.1061248464.squirrel@webmail.pair.com> I'm using Python on W2K. So far I've been using Cygwin, and XEmacs, and now IPython. I'd really like to use SciPy. However, I notice that the SciPy binary distribution for W2K/Cygwin is quite a bit behind the native W2K distribution. What's more, I'm starting to work with folks who would rather not have to have Cygwin installed. So, I'm looking at using the native W2K binaries for Python, SciPy etc... Is there a way to run the native W2K Python & SciPy (as installed from the cool Enthought mega-installer) with IPython in an XEmacs shell? I can't seem to get this to work. It's not an IPython issue, in the sense that I can't get just plain W2K-native python to run in an XEmacs shell. Also, am I likely to get myself in lots of trouble if I have both a native Python and a Cygwin Python on the same machine? thanks, -robert From oliphant at ee.byu.edu Mon Aug 18 19:18:49 2003 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Mon, 18 Aug 2003 17:18:49 -0600 Subject: [SciPy-user] multivariate normal In-Reply-To: <5B2C219C-D0B7-11D7-97AC-000A956FDAC0@fonnesbeck.org> References: <5B2C219C-D0B7-11D7-97AC-000A956FDAC0@fonnesbeck.org> Message-ID: <3F415ED9.30704@ee.byu.edu> Christopher Fonnesbeck wrote: > I notice that distributions.py in scipy.stats only deals with univariate > distributions. Does anyone know where there are python libraries that > provide multivariate pdfs? I'm developing some Markov chain Monte Carlo > code using simpy and scipy, and need access to multivariate normal > likelihood functions. > The multivariate normal is supported >>> info(stats.multivariate_normal) multivariate_normal(mean, cov, size=None) returns an array containing multivariate normally distributed random numbers with specified mean and covariance. mean must be a 1 dimensional array. cov must be a square two dimensional array with the same number of rows and columns as mean has elements. The first form returns a single 1-D array containing a multivariate normal. The second form returns an array of shape (m, n, ..., cov.shape[0]). In this case, output[i,j,...,:] is a 1-D array containing a multivariate normal. -Travis O. From fperez at colorado.edu Mon Aug 18 20:41:35 2003 From: fperez at colorado.edu (Fernando Perez) Date: Mon, 18 Aug 2003 18:41:35 -0600 Subject: [SciPy-user] SciPy, IPython, XEmacs & Windows In-Reply-To: <4219.128.165.144.120.1061248464.squirrel@webmail.pair.com> References: <4219.128.165.144.120.1061248464.squirrel@webmail.pair.com> Message-ID: <3F41723F.9040605@colorado.edu> Robert Ferrell wrote: > I'm using Python on W2K. So far I've been using Cygwin, and XEmacs, and > now IPython. I'd really like to use SciPy. However, I notice that the > SciPy binary distribution for W2K/Cygwin is quite a bit behind the native > W2K distribution. What's more, I'm starting to work with folks who would > rather not have to have Cygwin installed. So, I'm looking at using the > native W2K binaries for Python, SciPy etc... > > Is there a way to run the native W2K Python & SciPy (as installed from the > cool Enthought mega-installer) with IPython in an XEmacs shell? I can't > seem to get this to work. It's not an IPython issue, in the sense that I > can't get just plain W2K-native python to run in an XEmacs shell. Sorry but I'm not a Windows user, so I can't quite comment. But ipython is supposed to work under XEmacs very well, so please report any other behavior as a bug. Uner Linux, I can use ipython as my emacs-python shell just fine (keep in mind, you need recent python-emacs packages, provided in the ipython download area). Best, f From fperez at colorado.edu Mon Aug 18 20:41:35 2003 From: fperez at colorado.edu (Fernando Perez) Date: Mon, 18 Aug 2003 18:41:35 -0600 Subject: [SciPy-user] SciPy, IPython, XEmacs & Windows In-Reply-To: <4219.128.165.144.120.1061248464.squirrel@webmail.pair.com> References: <4219.128.165.144.120.1061248464.squirrel@webmail.pair.com> Message-ID: <3F41723F.9040605@colorado.edu> Robert Ferrell wrote: > I'm using Python on W2K. So far I've been using Cygwin, and XEmacs, and > now IPython. I'd really like to use SciPy. However, I notice that the > SciPy binary distribution for W2K/Cygwin is quite a bit behind the native > W2K distribution. What's more, I'm starting to work with folks who would > rather not have to have Cygwin installed. So, I'm looking at using the > native W2K binaries for Python, SciPy etc... > > Is there a way to run the native W2K Python & SciPy (as installed from the > cool Enthought mega-installer) with IPython in an XEmacs shell? I can't > seem to get this to work. It's not an IPython issue, in the sense that I > can't get just plain W2K-native python to run in an XEmacs shell. Sorry but I'm not a Windows user, so I can't quite comment. But ipython is supposed to work under XEmacs very well, so please report any other behavior as a bug. Uner Linux, I can use ipython as my emacs-python shell just fine (keep in mind, you need recent python-emacs packages, provided in the ipython download area). Best, f From ferrell at diablotech.com Mon Aug 18 23:07:23 2003 From: ferrell at diablotech.com (ferrell at diablotech.com) Date: Mon, 18 Aug 2003 21:07:23 -0600 Subject: [SciPy-user] SciPy, IPython, XEmacs & Windows In-Reply-To: <3F41723F.9040605@colorado.edu> References: <4219.128.165.144.120.1061248464.squirrel@webmail.pair.com> <3F41723F.9040605@colorado.edu> Message-ID: <16193.37995.363892.553600@prometheus.ta52.lanl.gov> Fernando Perez writes: > Robert Ferrell wrote: > > I'm using Python on W2K. So far I've been using Cygwin, and XEmacs, and > > now IPython. I'd really like to use SciPy. However, I notice that the > > SciPy binary distribution for W2K/Cygwin is quite a bit behind the native > > W2K distribution. What's more, I'm starting to work with folks who would > > rather not have to have Cygwin installed. So, I'm looking at using the > > native W2K binaries for Python, SciPy etc... > > > > Is there a way to run the native W2K Python & SciPy (as installed from the > > cool Enthought mega-installer) with IPython in an XEmacs shell? I can't > > seem to get this to work. It's not an IPython issue, in the sense that I > > can't get just plain W2K-native python to run in an XEmacs shell. > > Sorry but I'm not a Windows user, so I can't quite comment. But ipython is > supposed to work under XEmacs very well, so please report any other behavior > as a bug. > > Uner Linux, I can use ipython as my emacs-python shell just fine (keep in > mind, you need recent python-emacs packages, provided in the ipython download > area). With cygwin on Windows, ipython works great in XEmacs, just as you say. Also, very smooth install. thanks, -robert From Marco.LaRosa at csiro.au Mon Aug 18 23:50:33 2003 From: Marco.LaRosa at csiro.au (Marco.LaRosa at csiro.au) Date: Tue, 19 Aug 2003 13:50:33 +1000 Subject: [SciPy-user] Getting X, Y coordinates from Chaco plots Message-ID: Hi all, I am using chaco and I can't figure out how to get the X coordinate of the cursor. Deriving from a PlotWindow, the following line gives me the cursor. plot.set(cursor_type = 'index') What I want now is to use the cursor to select a value from the plot and return control to the calling class. Can that be done? How? TIA Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marco.LaRosa at csiro.au Tue Aug 19 00:18:22 2003 From: Marco.LaRosa at csiro.au (Marco.LaRosa at csiro.au) Date: Tue, 19 Aug 2003 14:18:22 +1000 Subject: [SciPy-user] Getting X, Y coordinates from Chaco plots Message-ID: Hi all, I just figured out how to get the X Y coordinates from the window. However, I also just realised that that's not what I need. Consider this: I have a plot window which displays (obviously enough) 1 plot. What I want is to let the user pick a point on the plot and return the value of the x axis at that point (e.g 1, 10, 400 etc). I can get the width of the window itself. I can get the x, y coordinates of the point selected. However, I don't know how to get the starting x,y coordinates of the actual plot itself. Does anyone know how to do this? Alternately, is there a direct way of returning the value of the axis at the point that the user selects? TIA, Marco. P.S. To the authors of chaco. Awesome package!!!! -----Original Message----- From: Marco.LaRosa at csiro.au [mailto:Marco.LaRosa at csiro.au] Sent: Tuesday, 19 August 2003 1:51 PM To: scipy-user at scipy.net Subject: [SciPy-user] Getting X, Y coordinates from Chaco plots Hi all, I am using chaco and I can't figure out how to get the X coordinate of the cursor. Deriving from a PlotWindow, the following line gives me the cursor. plot.set(cursor_type = 'index') What I want now is to use the cursor to select a value from the plot and return control to the calling class. Can that be done? How? TIA Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez at colorado.edu Tue Aug 19 01:08:11 2003 From: fperez at colorado.edu (Fernando Perez) Date: Mon, 18 Aug 2003 23:08:11 -0600 Subject: [SciPy-user] SciPy, IPython, XEmacs & Windows In-Reply-To: <16193.37995.363892.553600@prometheus.ta52.lanl.gov> References: <4219.128.165.144.120.1061248464.squirrel@webmail.pair.com> <3F41723F.9040605@colorado.edu> <16193.37995.363892.553600@prometheus.ta52.lanl.gov> Message-ID: <3F41B0BB.90809@colorado.edu> ferrell at diablotech.com wrote: > > Sorry but I'm not a Windows user, so I can't quite comment. But ipython is > > supposed to work under XEmacs very well, so please report any other behavior > > as a bug. > > > > Uner Linux, I can use ipython as my emacs-python shell just fine (keep in > > mind, you need recent python-emacs packages, provided in the ipython download > > area). > > With cygwin on Windows, ipython works great in XEmacs, just as you > say. Also, very smooth install. Glad to hear that. Please keep in mind that there's a nasty bug with generators in the current ipython (they get called twice under some circumstances, such as in list comprehensions). I'm working on a fix, but it's in the core, in one of the trickier parts of the code. Just a heads up. Best, f From fperez at colorado.edu Tue Aug 19 01:08:11 2003 From: fperez at colorado.edu (Fernando Perez) Date: Mon, 18 Aug 2003 23:08:11 -0600 Subject: [SciPy-user] SciPy, IPython, XEmacs & Windows In-Reply-To: <16193.37995.363892.553600@prometheus.ta52.lanl.gov> References: <4219.128.165.144.120.1061248464.squirrel@webmail.pair.com> <3F41723F.9040605@colorado.edu> <16193.37995.363892.553600@prometheus.ta52.lanl.gov> Message-ID: <3F41B0BB.90809@colorado.edu> ferrell at diablotech.com wrote: > > Sorry but I'm not a Windows user, so I can't quite comment. But ipython is > > supposed to work under XEmacs very well, so please report any other behavior > > as a bug. > > > > Uner Linux, I can use ipython as my emacs-python shell just fine (keep in > > mind, you need recent python-emacs packages, provided in the ipython download > > area). > > With cygwin on Windows, ipython works great in XEmacs, just as you > say. Also, very smooth install. Glad to hear that. Please keep in mind that there's a nasty bug with generators in the current ipython (they get called twice under some circumstances, such as in list comprehensions). I'm working on a fix, but it's in the core, in one of the trickier parts of the code. Just a heads up. Best, f From chris at fonnesbeck.org Tue Aug 19 14:01:11 2003 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Tue, 19 Aug 2003 14:01:11 -0400 Subject: [SciPy-user] Re: SciPy-user digest, Vol 1 #472 - 10 msgs In-Reply-To: <20030819170001.22253.18494.Mailman@scipy.org> Message-ID: <1E094770-D26F-11D7-933F-000A956FDAC0@fonnesbeck.org> The module rv.py supplies multivariate normal random deviates, but neither the pdf, cdf nor ppf like the univariate distributions in distributions.py. I've cooked up something myself, but its a bit slow. Looks like some f2py may be in order. C. On Tuesday, August 19, 2003, at 01:00 PM, scipy-user-request at scipy.net wrote: > The multivariate normal is supported > >>>> info(stats.multivariate_normal) > multivariate_normal(mean, cov, size=None) > > returns an array containing multivariate normally distributed random > numbers with specified mean and covariance. > > mean must be a 1 dimensional array. cov must be a square two > dimensional > array with the same number of rows and columns as mean has elements. > > The first form returns a single 1-D array containing a multivariate > normal. > > The second form returns an array of shape (m, n, ..., cov.shape[0]). > In this case, output[i,j,...,:] is a 1-D array containing a > multivariate > normal. > -- Christopher J. Fonnesbeck (chris at fonnesbeck dot org) GA Coop. Fish & Wildlife Research Unit, University of Georgia From J.Ferguson at dta.mil.nz Tue Aug 19 21:22:52 2003 From: J.Ferguson at dta.mil.nz (John A Ferguson) Date: Wed, 20 Aug 2003 13:22:52 +1200 Subject: [SciPy-user] Python2.3 Scipy Binary Package for Windows ? Message-ID: Hello, Does anyone know where or when a scipy binatry package for python2.3 on Windows is/will be available. If not can anyone offer any advice on building from source. I have had a look at the various sets of instructions at the scipy site and, quite frankly, they scare me silly :). However I'm prepared to give it a go. Are there any particular gotcha's I should look out for. Cheers, John From nwagner at mecha.uni-stuttgart.de Wed Aug 20 08:10:52 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 20 Aug 2003 14:10:52 +0200 Subject: [SciPy-user] Interactive handling in scipy Message-ID: <3F43654C.12B453C2@mecha.uni-stuttgart.de> Dear experts, Let us assume, that we have a vector say a with n elements. The user should specify a certain element out of this array. How can I realize this task in scipy.? for i in arange(0,n): print i, a[i] print 'Choose a numer 0 <= i > j Continue computation with the user specified element w[j] Any suggestion ? Thanks in advance. Nils From nwagner at mecha.uni-stuttgart.de Wed Aug 20 09:54:22 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 20 Aug 2003 15:54:22 +0200 Subject: [SciPy-user] xplt.plot --> eps file Message-ID: <3F437D8E.E21C2F48@mecha.uni-stuttgart.de> Hi all, is it possible to redirect the output of xplt.plot into an eps-file ? A small example would be appreciated. Nils From fperez at colorado.edu Wed Aug 20 22:12:03 2003 From: fperez at colorado.edu (Fernando Perez) Date: Wed, 20 Aug 2003 20:12:03 -0600 Subject: [SciPy-user] Why is weave.inline()/blitz++ code 3 times slower than innerproduct()? In-Reply-To: <20030815002241.GA20957@taliesen.caltech.edu> References: <3F3BFF28.7020900@colorado.edu> <20030815002241.GA20957@taliesen.caltech.edu> Message-ID: <3F442A73.40502@colorado.edu> Robert Kern wrote: > I tried your code with g++ 3.3.1, Python 2.3, Numeric 23.0, CVS SciPy on > Debian Linux (kernel 2.4.21), Athlon XP 2100, 512 MB RAM. I tried to > minimize other processes running. > > My results with your pristine code aren't nearly as consistent as yours. Actually, I think I understood what happened. Your test times are actually very long, much more than I expected for your hardware. Then I realized that you have half as much ram as I do, so you ended up in swap all the time. So the actual computational differences got washed out by swap time. This would also explain the inconsistencies you saw, which I didn't: depending on how much had to be swapped out, the times would change a lot. I downloaded g++ 3.3.1 and reran my tests, and while things improved a bit, I still see the hand-written code about 2.5 times slower than Numpy's innerproduct() function. If this is a fundamental limitation of the blitz approach, I'll be real unhappy. I've re-included the timing.py script, modified to use a single parameter: how much memory to use. The default is 300Mb, you can make it smaller. I'd greatly appreciate it if you could repeat these tests and let me know what you get. All the other code stays the same, so you can just type ./timing.py and send me the output :) If anyonelse is willing to run these tests, I've also included the full tarball. I'd be grateful for input on this. For someone with scipy installed, it's as simple as tar xzf py_inner.tgz cd py_inner make ./timing.py [M] -- for using M Mbytes of RAM, optional. Default is 300 Then, ./timing.py [M] a second time so that all the auto-building time from inline() calls doesn't happen. Thanks for any assistance. Regards, Fernando. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: timing.py URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: py_inner.tgz Type: application/unix-tar Size: 7259 bytes Desc: not available URL: From oliphant at ee.byu.edu Wed Aug 20 23:49:19 2003 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Wed, 20 Aug 2003 21:49:19 -0600 Subject: [SciPy-user] xplt.plot --> eps file In-Reply-To: <3F437D8E.E21C2F48@mecha.uni-stuttgart.de> References: <3F437D8E.E21C2F48@mecha.uni-stuttgart.de> Message-ID: <3F44413F.6050805@ee.byu.edu> Nils Wagner wrote: > Hi all, > > is it possible to redirect the output of xplt.plot into an eps-file ? > A small example would be appreciated. If you never want to open a display then you do this: xplt.window(display='',hcp='somefile.ps',legends=0) # must end in .ps # plotting commands here # e.g. xplt.plot(rand(100)) xplt.hcp() xplt.hcp_finish() # The file is now somefile.ps you can rename it to somefile.eps if you 3 # wish. If you want to see the results first then plot normally and use xplt.eps('somefile') to get the .eps file From nwagner at mecha.uni-stuttgart.de Thu Aug 21 03:34:05 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 21 Aug 2003 09:34:05 +0200 Subject: [SciPy-user] Greek symbols for labels in xplt.xlabel Message-ID: <3F4475EC.4EB485B7@mecha.uni-stuttgart.de> Dear experts, Is it possible to use greek symbols for labels in xplt ? For example, In gnuplot one can use something like set ylabel 'Real part {/Symbol n}_r' set term postscript eps enhanced 20 Any suggestion ? Nils From oliphant at ee.byu.edu Thu Aug 21 02:54:04 2003 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 21 Aug 2003 00:54:04 -0600 Subject: [SciPy-user] Greek symbols for labels in xplt.xlabel In-Reply-To: <3F4475EC.4EB485B7@mecha.uni-stuttgart.de> References: <3F4475EC.4EB485B7@mecha.uni-stuttgart.de> Message-ID: <3F446C8C.1040400@ee.byu.edu> Nils Wagner wrote: > Dear experts, > > Is it possible to use greek symbols for labels in xplt ? > > For example, In gnuplot one can use something like > > set ylabel 'Real part {/Symbol n}_r' > set term postscript eps enhanced 20 > > Any suggestion ? > Yes, All text commands in xplt allow some simple formatting. Greek characters: prepend with a ! so xplt.xlabel('!a!b') should produce alpha beta (you have to know the letter equivalent of the Greek symbol you want) xplt.xlabel('!a!b!c!d!e!f!g!h!i!j!k!l!m!n!o!p!q!r!s!t!u!v!w!x!y!z') should give you an idea of these. Subscripts: embed in '_' xplt.xlabel('H_2_O') Superscripts: embed in '^' xplt.xlabel('x^2^+y^2') Look at xplt.xlabel('!l^2^ !n_2_^2^+3') -Travis O. > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From nwagner at mecha.uni-stuttgart.de Thu Aug 21 04:06:09 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 21 Aug 2003 10:06:09 +0200 Subject: [SciPy-user] Change the size of dots in xplt.plot Message-ID: <3F447D71.6CC5D432@mecha.uni-stuttgart.de> Dear experts, How can I modify the size of the dots in xplt.plot(x,sin(x),'dot') ? Nils From nwagner at mecha.uni-stuttgart.de Thu Aug 21 04:41:12 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 21 Aug 2003 10:41:12 +0200 Subject: [SciPy-user] ylabel disappears in the eps file Message-ID: <3F4485A8.EBF8E60B@mecha.uni-stuttgart.de> Dear experts, When I redirect the output pf xplt.plot to an eps file via xplt.eps the ylabel disappears in the eps file. A small example is illustrating this behaviour. Any idea ? Thanks in advance. Nils from scipy import * from scipy.xplt import * import gui_thread x = arange(0,pi,0.1) xplt.plot(x,sin(x),'dot',x,sin(x),'dash''r') xplt.xlabel('x') xplt.ylabel('y') xplt.eps('somefile') From ferrell at diablotech.com Thu Aug 21 11:04:44 2003 From: ferrell at diablotech.com (Robert Ferrell) Date: Thu, 21 Aug 2003 15:04:44 -0000 (GMT) Subject: [SciPy-user] Tracking wave pulse Message-ID: <1799.128.165.144.120.1061478284.squirrel@webmail.pair.com> I need to track the peak of pulse traveling in one dimension. It seems likely that others have had to do something similar, so before I code something up, does anyone have suggestion for how to do this, possibly with pointer to code already avaialble? thanks, -robert From oliphant at ee.byu.edu Thu Aug 21 14:20:53 2003 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Thu, 21 Aug 2003 12:20:53 -0600 Subject: [SciPy-user] ylabel disappears in the eps file References: <3F4485A8.EBF8E60B@mecha.uni-stuttgart.de> Message-ID: <3F450D85.2040906@ee.byu.edu> Nils Wagner wrote: > Dear experts, > > When I redirect the output pf xplt.plot to an eps file via xplt.eps > the ylabel disappears in the eps file. A small example is illustrating > this > behaviour. > > Any idea ? > > Thanks in advance. > > Nils > > > from scipy import * > from scipy.xplt import * > import gui_thread > x = arange(0,pi,0.1) > xplt.plot(x,sin(x),'dot',x,sin(x),'dash''r') > xplt.xlabel('x') > xplt.ylabel('y') > xplt.eps('somefile') > I've noticed this too. Something changed when gist was upgraded recently to support windows. The good news is that the ylabel is still there --- it's just being masked by an incorrect bounding box. The bad news is that right now I don't know how to fix it except by manually changing the bounding box to be a little wider on the left. Increase the lower left bounding box number by about 14 points and you should be o.k. -Travis O. From dmorrill at enthought.com Thu Aug 21 15:47:04 2003 From: dmorrill at enthought.com (David C. Morrill) Date: Thu, 21 Aug 2003 14:47:04 -0500 Subject: [SciPy-user] New release of Python 2.2.3 (Enthought Edition) available Message-ID: <002701c3681d$0360c640$8201a8c0@dellbert> Just thought we would give everyone a head's up that a new release of Python 2.2.3 (Enthought Edition) is available for download at: http://www.enthought.com The main changes in this release are improvements to the chaco and kiva packages. In particular, this is the first release of chaco that uses the new kiva "agg" (Anti_Grain) driver that supports: - Faster rendering speeds. - Anti-aliasing of lines and text. - Alpha channel support for colors (i.e. transparency). - Improved chaco and traits documentation formatting (generated using the new pydoh package). Enjoy! The Python guys at enthought -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliphant at ee.byu.edu Thu Aug 21 16:48:34 2003 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Thu, 21 Aug 2003 14:48:34 -0600 Subject: [SciPy-user] Interactive handling in scipy References: <3F43654C.12B453C2@mecha.uni-stuttgart.de> Message-ID: <3F453022.7000203@ee.byu.edu> Nils Wagner wrote: > Dear experts, > > Let us assume, that we have a vector say a with n elements. > The user should specify a certain element out of this array. > How can I realize this task in scipy.? > > for i in arange(0,n): > > print i, a[i] > > print 'Choose a numer 0 <= i > User input >> j > Python handles this most easily using raw_input. >>> info(raw_input) raw_input([prompt]) -> string Read a string from standard input. The trailing newline is stripped. If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError. On Unix, GNU readline is used if enabled. The prompt string, if given, is printed without a trailing newline before reading. If you want to get real fancy you can play with Python's tty module and do all kinds of crazy things. >>> help(tty) for more information. -Travis O. From ferrell at diablotech.com Thu Aug 21 16:55:47 2003 From: ferrell at diablotech.com (Robert Ferrell) Date: Thu, 21 Aug 2003 20:55:47 -0000 (GMT) Subject: [SciPy-user] Roots of Bessel Message-ID: <3753.128.165.144.120.1061499347.squirrel@webmail.pair.com> What is a good way (in SciPy) to find (some of) the roots of J0 (Bessel function of first kind)? thanks, -robert From oliphant at ee.byu.edu Thu Aug 21 17:28:37 2003 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Thu, 21 Aug 2003 15:28:37 -0600 Subject: [SciPy-user] Change the size of dots in xplt.plot References: <3F447D71.6CC5D432@mecha.uni-stuttgart.de> Message-ID: <3F453985.2050804@ee.byu.edu> Nils Wagner wrote: > Dear experts, > > How can I modify the size of the dots in xplt.plot(x,sin(x),'dot') ? > Not easily. xplt supports a limited number of markers ('*', 'x', 'o', '+', '.') are the ones I remember. (the d and t in your example are being ignored) You can of course draw whatever size circles you like using raw plot commands. I just noticed that the raw xplt.plg command aslso accepts the msize argument which seems to be able to make the dots bigger (but not really smaller) --- you need the current cvs to use the new msize keyword. To compile on Unix make sure and comment out the addition of chaco (I guess it's not compiling right now on Unix) in the setup.py file. -Travis O. > Nils > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From oliphant at ee.byu.edu Thu Aug 21 18:30:54 2003 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Thu, 21 Aug 2003 16:30:54 -0600 Subject: [SciPy-user] Roots of Bessel References: <3753.128.165.144.120.1061499347.squirrel@webmail.pair.com> Message-ID: <3F45481E.3060100@ee.byu.edu> Robert Ferrell wrote: > What is a good way (in SciPy) to find (some of) the roots of J0 (Bessel > function of first kind)? >>> info(special.jn_zeros) jn_zeros(n, nt) Compute nt zeros of the Bessel function Jn(x). So to find the first 10 zeros, enter: >>> special.jn_zeros(0,10) array([ 2.4048, 5.5201, 8.6537, 11.7915, 14.9309, 18.0711, 21.2116, 24.3525, 27.4935, 30.6346]) -Travis O. From ferrell at diablotech.com Fri Aug 22 00:37:05 2003 From: ferrell at diablotech.com (ferrell at diablotech.com) Date: Thu, 21 Aug 2003 22:37:05 -0600 Subject: [SciPy-user] Roots of Bessel In-Reply-To: <3F45481E.3060100@ee.byu.edu> References: <3753.128.165.144.120.1061499347.squirrel@webmail.pair.com> <3F45481E.3060100@ee.byu.edu> Message-ID: <16197.40433.919737.243284@prometheus.ta52.lanl.gov> Travis E. Oliphant writes: > > Robert Ferrell wrote: > > What is a good way (in SciPy) to find (some of) the roots of J0 (Bessel > > function of first kind)? > > >>> info(special.jn_zeros) > jn_zeros(n, nt) > > Compute nt zeros of the Bessel function Jn(x). > > So to find the first 10 zeros, enter: > > >>> special.jn_zeros(0,10) > array([ 2.4048, 5.5201, 8.6537, 11.7915, 14.9309, 18.0711, > 21.2116, 24.3525, 27.4935, 30.6346]) Thanks. I thought I had seen this at one time, but couldn't recall how to find it. -r From nwagner at mecha.uni-stuttgart.de Fri Aug 22 03:10:01 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Aug 2003 09:10:01 +0200 Subject: [SciPy-user] Change the size of dots in xplt.plot References: <3F447D71.6CC5D432@mecha.uni-stuttgart.de> <3F453985.2050804@ee.byu.edu> Message-ID: <3F45C1C9.C213F72F@mecha.uni-stuttgart.de> "Travis E. Oliphant" schrieb: > > Nils Wagner wrote: > > Dear experts, > > > > How can I modify the size of the dots in xplt.plot(x,sin(x),'dot') ? > > > > Not easily. xplt supports a limited number of markers ('*', 'x', 'o', > '+', '.') are the ones I remember. (the d and t in your example are > being ignored) > > You can of course draw whatever size circles you like using raw plot > commands. > > I just noticed that the raw xplt.plg command aslso accepts the msize > argument which seems to be able to make the dots bigger (but not really > smaller) --- you need the current cvs to use the new msize keyword. To > compile on Unix make sure and comment out the addition of chaco (I guess > it's not compiling right now on Unix) in the setup.py file. > > -Travis O. > > > Nils Travis, Thank you very much for your useful hints. Which lines exactly are responsible for chaco in the setup.py file ? chaco_packages = ['chaco','kiva','traits','freetype'] chaco_packages = [os.path.join('Lib_chaco',p) for p in chaco_packages] Can I simply add sparse to the standard_packages to use it ? standard_packages = ['io','linalg', 'special','signal','stats', 'interpolate','integrate','optimize', 'cow','ga','fftpack'] # 'cluster','cow','ga','fftpack'] Nils > > > > _______________________________________________ > > SciPy-user mailing list > > SciPy-user at scipy.net > > http://www.scipy.net/mailman/listinfo/scipy-user > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From nwagner at mecha.uni-stuttgart.de Fri Aug 22 03:14:56 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Aug 2003 09:14:56 +0200 Subject: [SciPy-user] Interactive handling in scipy References: <3F43654C.12B453C2@mecha.uni-stuttgart.de> <3F453022.7000203@ee.byu.edu> Message-ID: <3F45C2F0.74FB5152@mecha.uni-stuttgart.de> "Travis E. Oliphant" schrieb: > > Nils Wagner wrote: > > Dear experts, > > > > Let us assume, that we have a vector say a with n elements. > > The user should specify a certain element out of this array. > > How can I realize this task in scipy.? > > > > for i in arange(0,n): > > > > print i, a[i] > > > > print 'Choose a numer 0 <= i > > > User input >> j > > > > Python handles this most easily using raw_input. > > >>> info(raw_input) > raw_input([prompt]) -> string > > Read a string from standard input. The trailing newline is stripped. > If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError. > On Unix, GNU readline is used if enabled. The prompt string, if given, > is printed without a trailing newline before reading. > > If you want to get real fancy you can play with Python's tty module and > do all kinds of crazy things. > > >>> help(tty) > > for more information. > > -Travis O. > It seems to me, that this module is not available here. Python 2.1.2 (#1, Feb 25 2002, 18:04:21) [GCC 2.95.3 20010315 (SuSE)] on linux2 Type "copyright", "credits" or "license" for more information. >>> help (tty) Traceback (most recent call last): File "", line 1, in ? NameError: name 'help' is not defined >>> from scipy import * >>> help(tty) Traceback (most recent call last): File "", line 1, in ? NameError: name 'tty' is not defined Am I mssing something ? Nils > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From kern at caltech.edu Fri Aug 22 02:32:09 2003 From: kern at caltech.edu (Robert Kern) Date: Thu, 21 Aug 2003 23:32:09 -0700 Subject: [SciPy-user] Interactive handling in scipy In-Reply-To: <3F45C2F0.74FB5152@mecha.uni-stuttgart.de> References: <3F43654C.12B453C2@mecha.uni-stuttgart.de> <3F453022.7000203@ee.byu.edu> <3F45C2F0.74FB5152@mecha.uni-stuttgart.de> Message-ID: <20030822063209.GA18660@taliesen.caltech.edu> On Fri, Aug 22, 2003 at 09:14:56AM +0200, Nils Wagner wrote: [snip] > It seems to me, that this module is not available here. > > Python 2.1.2 (#1, Feb 25 2002, 18:04:21) > [GCC 2.95.3 20010315 (SuSE)] on linux2 > Type "copyright", "credits" or "license" for more information. > >>> help (tty) > Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'help' is not defined > >>> from scipy import * > >>> help(tty) > Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'tty' is not defined > > Am I mssing something ? It's a standard module, not from scipy. >>> import tty >>> help(tty) > Nils -- Robert Kern kern at caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From nwagner at mecha.uni-stuttgart.de Fri Aug 22 03:45:06 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Aug 2003 09:45:06 +0200 Subject: [SciPy-user] Extension of who(globals()) Message-ID: <3F45CA02.235ED1FF@mecha.uni-stuttgart.de> Dear experts, Is it somehow possible to extent who(globals()) to a scalar ? Nils From pearu at scipy.org Fri Aug 22 03:15:37 2003 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 22 Aug 2003 10:15:37 +0300 (EEST) Subject: [SciPy-user] Change the size of dots in xplt.plot In-Reply-To: <3F45C1C9.C213F72F@mecha.uni-stuttgart.de> Message-ID: On Fri, 22 Aug 2003, Nils Wagner wrote: > Which lines exactly are responsible for chaco in the setup.py file ? To disable chaco comment the following line separate_packages += chaco_package in scipy/setup.py file. Pearu From nwagner at mecha.uni-stuttgart.de Fri Aug 22 04:38:38 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Aug 2003 10:38:38 +0200 Subject: [SciPy-user] variable (undetermined at initialization) dimension of an array ? Message-ID: <3F45D68E.A80A57C1@mecha.uni-stuttgart.de> Dear experts, Is it possible to create an array, where the dimension is undefined at the beginning ? Nils From pearu at scipy.org Fri Aug 22 05:45:06 2003 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 22 Aug 2003 12:45:06 +0300 (EEST) Subject: [SciPy-user] variable (undetermined at initialization) dimension of an array ? In-Reply-To: <3F45D68E.A80A57C1@mecha.uni-stuttgart.de> Message-ID: On Fri, 22 Aug 2003, Nils Wagner wrote: > Is it possible to create an array, where the dimension is undefined at > the beginning ? It depends on what are the applications of such an array. For arrays that dimensions ought to be truely undefined you can implement your own array class. On the other hand, have you looked at the resize method of a Numeric array: >>> from Numeric import * >>> a=array([]) >>> a.shape (0,) >>> a.resize((4,)) >>> a.shape (4,) >>> a.resize((2,)) >>> a.shape (2,) Note that you cannot use `a` slices before calling the resize method. Pearu From nwagner at mecha.uni-stuttgart.de Fri Aug 22 07:32:05 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Aug 2003 13:32:05 +0200 Subject: [SciPy-user] variable (undetermined at initialization) dimensionof an array ? References: Message-ID: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> Pearu Peterson schrieb: > > On Fri, 22 Aug 2003, Nils Wagner wrote: > > > Is it possible to create an array, where the dimension is undefined at > > the beginning ? > > It depends on what are the applications of such an array. > > For arrays that dimensions ought to be truely undefined you > can implement your own array class. > > On the other hand, have you looked at the resize method > of a Numeric array: > > >>> from Numeric import * > >>> a=array([]) > >>> a.shape > (0,) > >>> a.resize((4,)) > >>> a.shape > (4,) > >>> a.resize((2,)) > >>> a.shape > (2,) > > Note that you cannot use `a` slices before calling > the resize method. > > Pearu > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user from scipy import * a=array([]) ic = 0 eps = 1.e-10 f = 1.0 i = 0 while f < eps: ic = ic + 1 a.resize((ic,)) a[i] = somevalue i = i + 1 # f will be changed somehow in this loop print a Is this an effective way to implement it ? From nwagner at mecha.uni-stuttgart.de Fri Aug 22 07:41:46 2003 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Aug 2003 13:41:46 +0200 Subject: [SciPy-user] variable (undetermined at initialization)dimensionof an array ? References: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> Message-ID: <3F46017A.B0237837@mecha.uni-stuttgart.de> Nils Wagner schrieb: > > Pearu Peterson schrieb: > > > > On Fri, 22 Aug 2003, Nils Wagner wrote: > > > > > Is it possible to create an array, where the dimension is undefined at > > > the beginning ? > > > > It depends on what are the applications of such an array. > > > > For arrays that dimensions ought to be truely undefined you > > can implement your own array class. > > > > On the other hand, have you looked at the resize method > > of a Numeric array: > > > > >>> from Numeric import * > > >>> a=array([]) > > >>> a.shape > > (0,) > > >>> a.resize((4,)) > > >>> a.shape > > (4,) > > >>> a.resize((2,)) > > >>> a.shape > > (2,) > > > > Note that you cannot use `a` slices before calling > > the resize method. > > > > Pearu > > > > _______________________________________________ > > SciPy-user mailing list > > SciPy-user at scipy.net > > http://www.scipy.net/mailman/listinfo/scipy-user > > from scipy import * > a=array([]) > ic = 0 > eps = 1.e-10 > f = 1.0 > i = 0 > while f < eps: > ic = ic + 1 > a.resize((ic,)) > a[i] = somevalue > i = i + 1 > > # f will be changed somehow in this loop > > print a > > Is this an effective way to implement it ? > It should be while f > eps: ! > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From pearu at scipy.org Fri Aug 22 06:53:54 2003 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 22 Aug 2003 13:53:54 +0300 (EEST) Subject: [SciPy-user] variable (undetermined at initialization) dimensionof an array ? In-Reply-To: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> Message-ID: On Fri, 22 Aug 2003, Nils Wagner wrote: > from scipy import * > a=array([]) > ic = 0 > eps = 1.e-10 > f = 1.0 > i = 0 > while f < eps: > ic = ic + 1 > a.resize((ic,)) > a[i] = somevalue > i = i + 1 > > # f will be changed somehow in this loop > > print a > > Is this an effective way to implement it ? Using Python lists might provide a cleaner code: a = [] while f References: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> Message-ID: <20030822111820.GA12396@taliesen.caltech.edu> On Fri, Aug 22, 2003 at 01:32:05PM +0200, Nils Wagner wrote: [snip] > from scipy import * > a=array([]) > ic = 0 > eps = 1.e-10 > f = 1.0 > i = 0 > while f < eps: > ic = ic + 1 > a.resize((ic,)) > a[i] = somevalue > i = i + 1 > > # f will be changed somehow in this loop > > print a > > Is this an effective way to implement it ? If speed is critical, yeah, that would work (although, I would use "a[-1] = somevalue" instead of keeping track of another incrementer variable in this specific case). If clarity rather than speed is important, then I would recommend just appending to a list and creating the array from the list. But resizing seems to be faster. E.g. from scipy import * a = [] eps = 1.e-10 f = 1.0 while f > eps: a.append(somevalue) a = array(a) -- Robert Kern kern at caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From ferrell at diablotech.com Fri Aug 22 09:23:36 2003 From: ferrell at diablotech.com (ferrell at diablotech.com) Date: Fri, 22 Aug 2003 07:23:36 -0600 Subject: [SciPy-user] variable (undetermined at initialization) dimensionof an array ? In-Reply-To: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> References: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> Message-ID: <16198.6488.900923.706367@prometheus.ta52.lanl.gov> Nils Wagner writes: > from scipy import * > a=array([]) > ic = 0 > eps = 1.e-10 > f = 1.0 > i = 0 > while f < eps: > ic = ic + 1 > a.resize((ic,)) > a[i] = somevalue > i = i + 1 > > # f will be changed somehow in this loop > > print a > > Is this an effective way to implement it ? I would think that in this case you'd want to create a as a list, and then after the loop create the array. The experts may need to correct me, but I expect that the resize will cause a copy of the data each iteration. If you use a list that copy won't be done. After the loop you can then copy the contents of the list to an array. aList = [] while f < eps: aList += [somevalue] a = array(aList) -robert From oliphant at ee.byu.edu Fri Aug 22 12:07:06 2003 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Fri, 22 Aug 2003 10:07:06 -0600 Subject: [SciPy-user] Roots of Bessel In-Reply-To: <16197.40433.919737.243284@prometheus.ta52.lanl.gov> References: <3753.128.165.144.120.1061499347.squirrel@webmail.pair.com> <3F45481E.3060100@ee.byu.edu> <16197.40433.919737.243284@prometheus.ta52.lanl.gov> Message-ID: <3F463FAA.2050303@ee.byu.edu> ferrell at diablotech.com wrote: > Travis E. Oliphant writes: > > > > Robert Ferrell wrote: > > > What is a good way (in SciPy) to find (some of) the roots of J0 (Bessel > > > function of first kind)? > > > > >>> info(special.jn_zeros) > > jn_zeros(n, nt) > > > > Compute nt zeros of the Bessel function Jn(x). > > > > So to find the first 10 zeros, enter: > > > > >>> special.jn_zeros(0,10) > > array([ 2.4048, 5.5201, 8.6537, 11.7915, 14.9309, 18.0711, > > 21.2116, 24.3525, 27.4935, 30.6346]) > > Thanks. I thought I had seen this at one time, but couldn't recall > how to find it. >>> info(special) or >>> help(special) will give you a list of most of the functions in that modulue -Travis O. From oliphant at ee.byu.edu Fri Aug 22 12:12:59 2003 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Fri, 22 Aug 2003 10:12:59 -0600 Subject: [SciPy-user] variable (undetermined at initialization) dimensionof an array ? In-Reply-To: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> References: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> Message-ID: <3F46410B.7020702@ee.byu.edu> Nils Wagner wrote: > > from scipy import * > a=array([]) > ic = 0 > eps = 1.e-10 > f = 1.0 > i = 0 > while f < eps: > ic = ic + 1 > a.resize((ic,)) > a[i] = somevalue > i = i + 1 > > # f will be changed somehow in this loop > > print a > > Is this an effective way to implement it ? > This will work but you are causing a lot of overhead by reallocating the array on each pass. It would be better to allocate larger chunks or use list processing and later convert to an array: List Processing: a = [] while f < eps: ic = ic + 1 a.append(somevalue) i = i+1 a = array(a) Allocating larger chunks (better handled in a class that allocates large chunks of memory and then keeps track of when it's time to allocate a new chunk). -Travis O. From kern at caltech.edu Fri Aug 22 19:12:29 2003 From: kern at caltech.edu (Robert Kern) Date: Fri, 22 Aug 2003 16:12:29 -0700 Subject: [SciPy-user] variable (undetermined at initialization) dimensionof an array ? In-Reply-To: <3F46410B.7020702@ee.byu.edu> References: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> <3F46410B.7020702@ee.byu.edu> Message-ID: <20030822231228.GA12728@taliesen.caltech.edu> On Fri, Aug 22, 2003 at 10:12:59AM -0600, Travis Oliphant wrote: > Nils Wagner wrote: > > > >from scipy import * > >a=array([]) > >ic = 0 > >eps = 1.e-10 > >f = 1.0 > >i = 0 > >while f < eps: > > ic = ic + 1 > > a.resize((ic,)) > > a[i] = somevalue > > i = i + 1 > > > ># f will be changed somehow in this loop > > > >print a > > > >Is this an effective way to implement it ? > > > > This will work but you are causing a lot of overhead by reallocating the > array on each pass. It would be better to allocate larger chunks or use > list processing and later convert to an array: > > > List Processing: > > a = [] > while f < eps: > ic = ic + 1 > a.append(somevalue) > i = i+1 > a = array(a) I timed both of these approaches. Resizing is faster than appending-then-arraying (but if you can leave it as a list, that's even better). > Allocating larger chunks (better handled in a class that allocates large > chunks of memory and then keeps track of when it's time to allocate a > new chunk). This runs almost as fast as resizing every time. Testing for reallocation every time eats away at what you save by not copying memory every time. Hmm. Maybe if I run psyco over it... > -Travis O. -- Robert Kern kern at caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From kern at caltech.edu Sat Aug 23 05:11:20 2003 From: kern at caltech.edu (Robert Kern) Date: Sat, 23 Aug 2003 02:11:20 -0700 Subject: [SciPy-user] variable (undetermined at initialization) dimensionof an array ? In-Reply-To: <20030822231228.GA12728@taliesen.caltech.edu> References: <3F45FF35.9EC6545B@mecha.uni-stuttgart.de> <3F46410B.7020702@ee.byu.edu> <20030822231228.GA12728@taliesen.caltech.edu> Message-ID: <20030823091120.GA5055@taliesen.caltech.edu> On Fri, Aug 22, 2003 at 04:12:29PM -0700, Robert Kern wrote: [snip - appending to lists vs. resizing Numeric arrays] > I timed both of these approaches. Resizing is faster than > appending-then-arraying (but if you can leave it as a list, that's even > better). > > > Allocating larger chunks (better handled in a class that allocates large > > chunks of memory and then keeps track of when it's time to allocate a > > new chunk). > > This runs almost as fast as resizing every time. Testing for reallocation > every time eats away at what you save by not copying memory every time. And the standard array module beats the pants off any of these methods. import array import Numeric a = array.array("l") for i in xrange(100000): a.append(i) a = Numeric.fromstring(a) The standard array module uses the same over-allocation of memory that list objects do, and it is very good at what it does. It always overallocates proportional to the length of the array, so it tends to reallocate less than it would if it always reallocated at fixed intervals. Since these array objects also expose a buffer interface, we can get a Numeric array very quickly. And best of all, it does it in C and you don't have to do any bookkeeping yourself. I thought I'd never touch that module since I found NumPy... -- Robert Kern kern at caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From b747_999 at yahoo.com Mon Aug 25 13:29:33 2003 From: b747_999 at yahoo.com (neal) Date: Mon, 25 Aug 2003 10:29:33 -0700 (PDT) Subject: [SciPy-user] newbie problems Message-ID: <20030825172933.4807.qmail@web40311.mail.yahoo.com> hi ive read some of the intro docs and this looks like a great system. i tried to do a source install because i dont have redhat 7 but slackware 9 though something might have been munged. from the tutorial by oliphant: In [1]: from scipy import * In [2]: from scipy.special import * In [3]: def addsubtract(a,b): ...: if a > b: ...: return a - b ...: else: ...: return a + b ...: In [4]: vec_addsubstract = special.general_function(addsubtract) In [5]: vec_addsubtract([0,3,6,9],[1,3,5,7]) --------------------------------------------------------------------------- NameError Traceback (most recent call last) /home/bob/ NameError: name 'vec_addsubtract' is not defined im having similar problems with integration. however other parts of the tutorial work ok. when running the self-test, i get errors in test_basic.test_chebyc, in cholesky: check_chebys, check_random_complex, check_simple_complex, and in test_shapiro check_basic. does this mean there was some serious problem with my installation? looking forward to getting going with this software. ive spent time writing numerical codes in c++ (too verbose, and newer techniques seem less readable) and mathematica (concise but slow), so scipy promises to be a great solution. -gong ps perhaps some mention that fftw3 doesn't install yet with scipy would be nice in the install notes... i spent a bit of time trying to figure out what was wrong... __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com From fperez at colorado.edu Mon Aug 25 14:18:40 2003 From: fperez at colorado.edu (Fernando Perez) Date: Mon, 25 Aug 2003 12:18:40 -0600 Subject: [SciPy-user] newbie problems In-Reply-To: <20030825172933.4807.qmail@web40311.mail.yahoo.com> References: <20030825172933.4807.qmail@web40311.mail.yahoo.com> Message-ID: <3F4A5300.9070603@colorado.edu> neal wrote: > In [4]: vec_addsubstract = special.general_function(addsubtract) > > In [5]: vec_addsubtract([0,3,6,9],[1,3,5,7]) See how the two vec... words above are different in length? They're probably spelled differently ;) Cheers, f. From eric at enthought.com Mon Aug 25 18:31:01 2003 From: eric at enthought.com (Eric Jones) Date: Mon, 25 Aug 2003 17:31:01 -0500 (CDT) Subject: [SciPy-user] ANN: SciPy'03 is getting close! Message-ID: <20030825223101.1280D1057@www.enthought.com> Hey Group, Just wanted to send out another reminder about SciPy'03 which will be held at Cal Tech on September 11th and 12th. Information about the workshop is available on its home page: http://www.scipy.org/site_content/scipy03/ The schedule for the workshop is available at: http://www.scipy.org/site_content/scipy03/scipy03sched.htm Online registration is also open: https://www.enthought.com/scipy03/ Currently, their are around 50 people registered. Please register as soon as possible if you plan on attending so that we have an accurate count for food, etc. thanks! eric From ariciputi at pito.com Tue Aug 26 11:23:07 2003 From: ariciputi at pito.com (Andrea Riciputi) Date: Tue, 26 Aug 2003 17:23:07 +0200 Subject: [SciPy-user] About SciPy '03 Workshop. Message-ID: <31B19289-D7D9-11D7-B4AB-000393933E4E@pito.com> Hi there, I've read Scipy '03 workshop announce and I'm very interested in the topics that will be discussed. On the other side I live in Italy (Europe) and I can't come to Pasadena to attend to the workshop. I think many other Python/SciPy users have the same problem and I wondering if it would be possible to put online something like a workshop's proceeding, obviously after the workshop's end. Perhaps preparing a "real" proceding would turn in a time-comsuming task, but, in my mind, just a web page to download all the presetations (PDF form, please) would be a great help for users like me and it wouldn't be to much time-consuming for the workshop's organization team. Any comment? Thanks, Andrea. --- Andrea Riciputi "Science is like sex: sometimes something useful comes out, but that is not the reason we are doing it" -- (Richard Feynman) From jdhunter at ace.bsd.uchicago.edu Tue Aug 26 11:26:43 2003 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue, 26 Aug 2003 10:26:43 -0500 Subject: [SciPy-user] ANN: matplotlib 0.21 -- matlab compatible plotting in python Message-ID: Announcing matplotlib 0.21 -- http://matplotlib.sourceforge.net/ Matplotlib is a pure python plotting library designed to bring publication quality plotting to python with a syntax familiar to matlab users. Matplotlib uses pygtk for plotting, and has been tested on linux, UNIX and Microsoft Windows. Features include multiple figures and subplots, anti-aliased fonts, multiple style and color line plots, histograms, scatter plots, interactive control of plots, and more. matplotlib uses Numeric, with extensive use of data clipping, and so is suitable for use with interactive plotting of large data sets. What's new in matplotlib 0.21 Deprecation warnings fixed -- Several users reported deprecation warnings with python2.3 and pygtk 1.99.18. These were all related to passing floats rather than ints to gtk drawing commands. These have been cleaned up and none of the examples generate wanings. Let me know if you get some! Improved interactive shell -- Jon Anderson posted an improved GTK shell to the pygtk mailing list. Using this no longer requires that pygtk have threading built in. See interactive2.py. Use this if you want to make plots interactively from the python shell. Specifying colors -- You can now specify colors with color format strings, RGB tuples, or hex strings as in html. See color_demo.py Figure text -- All text in matplotlib has previously been in axis (data) coordinates. Sometimes it's helpful to be able to specify text in figure (relative) coordinates. Now figures also have text. When you scroll interactively, axis text moves with the data, figure text is fixed. This is also useful for making a figure title when you have multiple columns of subplots. See figtext.py Flicker free updates -- All drawing is done to a pixmap and then updated. This allows flicker free updates of the figure. You can use this, for example, to build a system monitor, which continuously shows system resources such as RAM, CPU, etc... See system_monitor.py for a demo. From travis at enthought.com Tue Aug 26 12:11:53 2003 From: travis at enthought.com (Travis N. Vaught) Date: Tue, 26 Aug 2003 11:11:53 -0500 Subject: [SciPy-user] About SciPy '03 Workshop. In-Reply-To: <31B19289-D7D9-11D7-B4AB-000393933E4E@pito.com> Message-ID: <05a701c36bec$c70b8260$a201a8c0@tvlaptop> Andrea, I completely agree. In spite of good intentions last year, we were only able to consolidate (most of) the lightning talk slides for posting to the web. http://www.scipy.org/site_content/scipy02/presentations I hope to have more complete coverage of the presentation material posted to the web after this year's workshop. Best Regards, Travis > -----Original Message----- > From: scipy-user-admin at scipy.net [mailto:scipy-user-admin at scipy.net] On > Behalf Of Andrea Riciputi > Sent: Tuesday, August 26, 2003 9:23 AM > To: scipy-user at scipy.net > Subject: [SciPy-user] About SciPy '03 Workshop. > > Hi there, > I've read Scipy '03 workshop announce and I'm very interested in the > topics that will be discussed. On the other side I live in Italy > (Europe) and I can't come to Pasadena to attend to the workshop. I > think many other Python/SciPy users have the same problem and I > wondering if it would be possible to put online something like a > workshop's proceeding, obviously after the workshop's end. > > Perhaps preparing a "real" proceding would turn in a time-comsuming > task, but, in my mind, just a web page to download all the presetations > (PDF form, please) would be a great help for users like me and it > wouldn't be to much time-consuming for the workshop's organization team. > > Any comment? > > Thanks, > Andrea. > > --- > Andrea Riciputi > > "Science is like sex: sometimes something useful comes out, > but that is not the reason we are doing it" -- (Richard Feynman) > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From eric at enthought.com Tue Aug 26 14:16:25 2003 From: eric at enthought.com (Eric Jones) Date: Tue, 26 Aug 2003 13:16:25 -0500 (CDT) Subject: [SciPy-user] About SciPy '03 Workshop. Message-ID: <20030826181625.0C6091054@www.enthought.com> Hey Andrea, Sounds like a good idea. How about this: I will try and round up as many presentations as possible at the conference if someone else will handle putting them on the web at scipy.org. Any takers? eric Andrea Riciputi wrote .. > Hi there, > I've read Scipy '03 workshop announce and I'm very interested in the > topics that will be discussed. On the other side I live in Italy > (Europe) and I can't come to Pasadena to attend to the workshop. I > think many other Python/SciPy users have the same problem and I > wondering if it would be possible to put online something like a > workshop's proceeding, obviously after the workshop's end. > > Perhaps preparing a "real" proceding would turn in a time-comsuming > task, but, in my mind, just a web page to download all the presetations > (PDF form, please) would be a great help for users like me and it > wouldn't be to much time-consuming for the workshop's organization team. > > Any comment? > > Thanks, > Andrea. > > --- > Andrea Riciputi > > "Science is like sex: sometimes something useful comes out, > but that is not the reason we are doing it" -- (Richard Feynman) > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From msajec at tqs.com Wed Aug 27 19:01:00 2003 From: msajec at tqs.com (Sajec, Mike TQO) Date: Wed, 27 Aug 2003 16:01:00 -0700 Subject: [SciPy-user] wxplt histogram + normal fit function (histfit) Message-ID: <2E5FEA6E71B22B46BBD13D126F71920902970150@STARBURST.tqs.com> I wrote this function to create histograms with normal fits, and thought it may be useful to other scipy users. It requires matplotlib for the normal pdf function (http://matplotlib.sourceforge.net/). Here it is: Best Regards, Mike #*************************************************************************** **** # Module: tqplots.py # Author: Mike Sajec # Date: 8-13-03 # # Change Log: # 8-13-03 - added first function: histfit #*************************************************************************** **** from matplotlib import mlab from scipy import * from chaco import * from chaco import wxplt as plt import RandomArray as ra def histfit(data): """histfit(data) data = a 1-dimensional list or numpy array of numbers""" #data for testing... #data = ra.normal(0,3,100) mu = mlab.mean(data) sigma = mlab.std(data) mhist = mlab.hist(data) xhist = mhist[1] yhist = mhist[0] #put xhist & yhist into a list of tuple pairs histvalues=[] for ii in range(len(xhist)): histvalues.append((xhist[ii],yhist[ii])) histplot = plt.PlotValue(histvalues, type='bar') f1 = plt.figure() f1.canvas.add(histplot) plt.hold() # Plot the normal fit curve xnormfit = arange(mu-4*sigma,mu+4*sigma,(8*sigma/100)) ynormfit = mlab.normpdf(xnormfit,mu,sigma) # ynormfit = ynormfit/max(ynormfit)*max(yhist) #normalize #put xnormfit & ynormfit into a list of tuple pairs fitvalues=[] for ii in range(len(xnormfit)): fitvalues.append((xnormfit[ii],ynormfit[ii])) fitplot = plt.PlotValue(fitvalues,type='line') f1.canvas.add(fitplot) #Plot the limits #plt.plot((mu-4*sigma)*ones(2),[0,max(yhist)]) # plot lower spec limit #plt.plot((mu+4*sigma)*ones(2),[0,max(yhist)]) # plot upper spec limit return f1 From korry at users.sourceforge.net Thu Aug 28 06:21:08 2003 From: korry at users.sourceforge.net (K.KISHIMOTO) Date: Thu, 28 Aug 2003 19:21:08 +0900 Subject: [SciPy-user] ANN: PAIDA-3.0a1 Message-ID: <5721A5EE-D941-11D7-AC83-0050E4205D7B@users.sourceforge.net> Announcing PAIDA-3.0a1 (No GUI) http://paida.sourceforge.net/ PIDA is a Python implementation of AIDA (Abstract Interface for Data Analysis). I'm NOT a member of the AIDA project, but I have developed PAIDA for my use. The goals of the AIDA (http://aida.freehep.org/) project are to define abstract interfaces for common physics analysis objects, such as - histogram - ntuple - cloud - profile - fitter - IO etc. PAIDA uses SciPy in its core, and is planning to use Chaco or another technology for GUIs. Let me know of any bugs and suggestions. Have fun! K. KISHIMOTO korry at users.sourceforge.net From ferrell at diablotech.com Thu Aug 28 14:55:49 2003 From: ferrell at diablotech.com (Robert Ferrell) Date: Thu, 28 Aug 2003 18:55:49 -0000 (GMT) Subject: [SciPy-user] xml.dom.minidom broken Message-ID: <2280.128.165.144.120.1062096949.squirrel@webmail.pair.com> The distribution of xml.dom.minidom in SciPy seems to be broken. I think this is not unique to SciPy, but rather common to all the Python distributions. The solution I'm using is to build PyXML myself. Has any one else encountered this problem? thanks, -robert From joe at enthought.com Thu Aug 28 15:55:04 2003 From: joe at enthought.com (Joe Cooper) Date: Thu, 28 Aug 2003 14:55:04 -0500 Subject: [SciPy-user] scipy.org mail server going down for upgrades Message-ID: <3F4E5E18.5010108@enthought.com> Hi all, The scipy mail server will be taken down in just a few minutes for a system upgrade. Service should resume in under an hour, assuming no problems. Thanks! From joe at enthought.com Thu Aug 28 19:28:42 2003 From: joe at enthought.com (Joe Cooper) Date: Thu, 28 Aug 2003 18:28:42 -0500 Subject: [SciPy-user] SciPy.org upgrades complete Message-ID: <3F4E902A.4000807@enthought.com> Hi all, The work on scipy.org is complete, and everything should be back up and running normally. If you spot problems with mail, Zope, or the roundup bug tracker, let me know. Thanks! From pajer at iname.com Fri Aug 29 18:44:55 2003 From: pajer at iname.com (Gary Pajer) Date: Fri, 29 Aug 2003 18:44:55 -0400 Subject: [SciPy-user] Matlab refugee needs pointers References: <5721A5EE-D941-11D7-AC83-0050E4205D7B@users.sourceforge.net> Message-ID: <000f01c36e7f$2b19a9f0$01fd5644@playroom> I've been poking around the source, and I've discovered lots of stuff for which I can find no further documentation. For example, fstack() and vstack(). Are there any docs beyond the docstrings or the tutorial on the website? How 'bout a list of functions? In particular, I see mention of what looks like special index keywords c_ and r_ I can't figure out what they do, but if they help appending columns and rows, they would be useful. Can someone clue me in on r_ and c_ ... or point me to the docs that I haven't yet found? TIA, Gary From vibrations at cetlink.net Sat Aug 30 11:06:10 2003 From: vibrations at cetlink.net (SGD) Date: Sat, 30 Aug 2003 11:06:10 -0400 Subject: [SciPy-user] tutorial problems Message-ID: <000001c36f08$52d247c0$e737c6d1@whiterhino2> HI, I'm new to scipy and seem to have run into a problem with the plotting tutorial available from the scipy site. When I follow the directions for gplt, every thing seems to work ok, but as I get to the plt module, python crashes. Using a wx based shell like pyshell works great every time. When I'm using the dos shell or pythonwin it seem to crash at the line plt.plot ((1,2,3)). import gui_thread from scipy import plt plt.plot((1,2,3)) Crash as soon as plt.plot((1,2,3)) is passed to the interpiter. Could this be a problem with the gui_thread or something else? Can anyone help with this? Thanks From laytonjb at bellsouth.net Sat Aug 30 11:33:24 2003 From: laytonjb at bellsouth.net (Jeffrey B. Layton) Date: Sat, 30 Aug 2003 11:33:24 -0400 Subject: [SciPy-user] Couple of Matrix() questions Message-ID: <3F50C3C4.9060301@bellsouth.net> Good morning! I've got a couple of quick questions regarding the matrix() class (mat() class?). Anyway, I want to erase a column or a row of a two-dimensional matrix. I create the matrix using, >>> A=mat('[0,3,2];[5,1,2];[9,-6,7]') and I want to blank the second column using something like the following (complete with error message), >>> A[:,1]=[] Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 184, in __setitem__ self.array[index] = value How do I blank (or set to zero) the appropriate slice of the matrix? My second question is how to concatenate matrices create with mat(). I tried the following (complete with error messages), >>> A=mat('[0,1];[2,3]') >>> B=mat('[4,5];[6,7]') >>> C=mat('[8,9];[10,11]') >>> D=mat('[12,13];[14,15]') >>> E=mat('[A,B];[C,D]') Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 69, in __init__ data = _convert_from_string(data) File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 36, in _convert_from_string newrow.extend(map(_eval,temp)) File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 24, in _eval return eval(astr.translate(_table,_todelete)) File "", line 0 ^ SyntaxError: unexpected EOF while parsing >>> E=[A,B; C,D] File "", line 1 E=[A,B; C,D] I know this is a holdover from Matlab, but I would like to get is the following, E=[0, 1, 4 ,5; 2, 3, 6, 7; 8, 9, 12, 13; 10, 11, 14, 15] How do I do this in scipy? TIA! Jeff From pajer at iname.com Sat Aug 30 19:38:14 2003 From: pajer at iname.com (Gary Pajer) Date: Sat, 30 Aug 2003 19:38:14 -0400 Subject: [SciPy-user] tutorial problems References: <000001c36f08$52d247c0$e737c6d1@whiterhino2> Message-ID: <001901c36f4f$c83d83c0$01fd5644@playroom> It's a problem with something. It's been brought up here before, but it hasn't generated any response. Since things work fine using PyShell, perhaps it's a low priority issue. Another thing that doesn't work right is chaco.tkplt. It fails the same way on both of my systems: WinXP and WinNT I have to take the attitude that since I can't code C, I can't complain. Someday I'm sure all will be fixed. > HI, > I'm new to scipy and seem to have run into a problem with the plotting > tutorial available from the scipy site. When I follow the directions for > gplt, every thing seems to work ok, but as I get to the plt module, > python crashes. Using a wx based shell like pyshell works great every > time. When I'm using the dos shell or pythonwin it seem to crash at the > line plt.plot ((1,2,3)). > > import gui_thread > from scipy import plt > plt.plot((1,2,3)) > > Crash as soon as plt.plot((1,2,3)) is passed to the interpiter. Could > this be a problem with the gui_thread or something else? > > Can anyone help with this? > > Thanks > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From pearu at scipy.org Sun Aug 31 08:19:54 2003 From: pearu at scipy.org (Pearu Peterson) Date: Sun, 31 Aug 2003 15:19:54 +0300 (EEST) Subject: [SciPy-user] Couple of Matrix() questions In-Reply-To: <3F50C3C4.9060301@bellsouth.net> Message-ID: On Sat, 30 Aug 2003, Jeffrey B. Layton wrote: > Good morning! > > I've got a couple of quick questions regarding the > matrix() class (mat() class?). Anyway, I want to erase > a column or a row of a two-dimensional matrix. I > create the matrix using, > > >>> A=mat('[0,3,2];[5,1,2];[9,-6,7]') > > and I want to blank the second column using > something like the following (complete with error > message), > How do I blank (or set to zero) the appropriate slice of > the matrix? >>> A[:,1] = [0]*3 >>> A Matrix([[0, 0, 2], [5, 0, 2], [9, 0, 7]]) > My second question is how to concatenate matrices > create with mat(). I tried the following (complete with > error messages), > > >>> A=mat('[0,1];[2,3]') > >>> B=mat('[4,5];[6,7]') > >>> C=mat('[8,9];[10,11]') > >>> D=mat('[12,13];[14,15]') > I know this is a holdover from Matlab, but I would like > to get is the following, > > E=[0, 1, 4 ,5; > 2, 3, 6, 7; > 8, 9, 12, 13; > 10, 11, 14, 15] > > How do I do this in scipy? I hope there would be a better way but Numeric.concatenate does the job: >>> E=mat(concatenate([concatenate([A,B],axis=1),concatenate([C,D],axis=1)])) >>> E Matrix([[ 0, 1, 4, 5], [ 2, 3, 6, 7], [ 8, 9, 12, 13], [10, 11, 14, 15]]) Regards, Pearu From WILLIAM.GRIFFIN at asu.edu Sun Aug 31 09:40:20 2003 From: WILLIAM.GRIFFIN at asu.edu (William Griffin) Date: Sun, 31 Aug 2003 06:40:20 -0700 Subject: [SciPy-user] tutorial problems Message-ID: <3996AE5EBEF964418D80953BDCABFF5685B2DF@ex1.asurite.ad.asu.edu> I have had the same problem with tkplt in WinXP and Win2000. I can get chaco to work if I use PyCrust, and it works very well if I use it interactively, but I've not been able to get it to work reliably in module form. I can usually correct the problem with chaco but with tkplt, I've not been successful. The next time I work with either, I'll post the error messages. I figured that I was the only one not able to get it workly properly! bill -----Original Message----- From: Gary Pajer [mailto:pajer at iname.com] Sent: Sat 8/30/2003 4:38 PM To: scipy-user at scipy.net Cc: Subject: Re: [SciPy-user] tutorial problems It's a problem with something. It's been brought up here before, but it hasn't generated any response. Since things work fine using PyShell, perhaps it's a low priority issue. Another thing that doesn't work right is chaco.tkplt. It fails the same way on both of my systems: WinXP and WinNT I have to take the attitude that since I can't code C, I can't complain. Someday I'm sure all will be fixed. > HI, > I'm new to scipy and seem to have run into a problem with the plotting > tutorial available from the scipy site. When I follow the directions for > gplt, every thing seems to work ok, but as I get to the plt module, > python crashes. Using a wx based shell like pyshell works great every > time. When I'm using the dos shell or pythonwin it seem to crash at the > line plt.plot ((1,2,3)). > > import gui_thread > from scipy import plt > plt.plot((1,2,3)) > > Crash as soon as plt.plot((1,2,3)) is passed to the interpiter. Could > this be a problem with the gui_thread or something else? > > Can anyone help with this? > > Thanks > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 5734 bytes Desc: not available URL: From laytonjb at bellsouth.net Sun Aug 31 10:27:52 2003 From: laytonjb at bellsouth.net (Jeffrey B. Layton) Date: Sun, 31 Aug 2003 10:27:52 -0400 Subject: [SciPy-user] Couple of Matrix() questions In-Reply-To: References: Message-ID: <3F5205E8.30808@bellsouth.net> Pearu, Thanks for the help! I've got a follow-up below. >> My second question is how to concatenate matrices >>create with mat(). I tried the following (complete with >>error messages), >> >> >>> A=mat('[0,1];[2,3]') >> >>> B=mat('[4,5];[6,7]') >> >>> C=mat('[8,9];[10,11]') >> >>> D=mat('[12,13];[14,15]') >> >> >>I know this is a holdover from Matlab, but I would like >>to get is the following, >> >>E=[0, 1, 4 ,5; >> 2, 3, 6, 7; >> 8, 9, 12, 13; >> 10, 11, 14, 15] >> >>How do I do this in scipy? >> >> > >I hope there would be a better way but Numeric.concatenate does the job: > > > >>>>E=mat(concatenate([concatenate([A,B],axis=1),concatenate([C,D],axis=1)])) >>>>E >>>> >>>> >Matrix([[ 0, 1, 4, 5], > [ 2, 3, 6, 7], > [ 8, 9, 12, 13], > [10, 11, 14, 15]]) > This is terrible! There should definitely be a better way to do this. People doing control analysis or anything requiring large linear system built up from smaller systems (e.g. FEM, BEM, etc.) would like to do this. Is the function [ ] an overloaded function from Scipy that it can process the matrix class? It would be very nice to add the concatenation capability to it. I guess another way would be to create E of the appropriate size and then copy A, B, C, and D into the appropriate locations. Is there a way to create E using mat() that initializes the matrix to zero? While I'm on the topic, is there a good place for mat() documentation, specifically a tutorial? I did try the following: >>> Adum=mat('[0,0;0,0]') >>> print Adum Matrix([[0, 0], [0, 0]]) >>> E=mat('[Adum,Adum];[Adum,Adum]') Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 69, in __init__ data = _convert_from_string(data) File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 36, in _convert_from_string newrow.extend(map(_eval,temp)) File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 24, in _eval return eval(astr.translate(_table,_todelete)) File "", line 0 ^ SyntaxError: unexpected EOF while parsing I think this should work. Amy I way off base here? TIA! Jeff From kern at caltech.edu Sun Aug 31 11:09:58 2003 From: kern at caltech.edu (Robert Kern) Date: Sun, 31 Aug 2003 08:09:58 -0700 Subject: [SciPy-user] Couple of Matrix() questions In-Reply-To: <3F5205E8.30808@bellsouth.net> References: <3F5205E8.30808@bellsouth.net> Message-ID: <20030831150958.GA3792@taliesen.caltech.edu> On Sun, Aug 31, 2003 at 10:27:52AM -0400, Jeffrey B. Layton wrote: [Pearu] > >>>>E=mat(concatenate([concatenate([A,B],axis=1),concatenate([C,D],axis=1)])) > >>>>E > >>>> > >>>> > >Matrix([[ 0, 1, 4, 5], > > [ 2, 3, 6, 7], > > [ 8, 9, 12, 13], > > [10, 11, 14, 15]]) [Jeffrey] > This is terrible! There should definitely be a better way to do this. > People doing control analysis or anything requiring large linear > system built up from smaller systems (e.g. FEM, BEM, etc.) would > like to do this. Is the function [ ] an overloaded function from Scipy > that it can process the matrix class? It would be very nice to add the > concatenation capability to it. I'm not sure what you mean here. [] isn't a function, but a Python language literal that creates a list. It isn't overloadable. Anyways, try this function: def matcat(matrices): return mat(concatenate([concatenate(row, axis=1) for row in matrices])) E = matcat([[A,B],[C,D]]) > I guess another way would be to create E of the appropriate size and > then copy A, B, C, and D into the appropriate locations. Is there a > way to create E using mat() that initializes the matrix to zero? mat(zeros((2,2))) > While > I'm on the topic, is there a good place for mat() documentation, > specifically a tutorial? Not to my knowledge. Reading the source can help sometimes. > I did try the following: > > >>> Adum=mat('[0,0;0,0]') > >>> print Adum > Matrix([[0, 0], > [0, 0]]) > >>> E=mat('[Adum,Adum];[Adum,Adum]') > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 69, in > __init__ > data = _convert_from_string(data) > File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 36, in > _convert_from_string > newrow.extend(map(_eval,temp)) > File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 24, in > _eval > return eval(astr.translate(_table,_todelete)) > File "", line 0 > > ^ > SyntaxError: unexpected EOF while parsing > > I think this should work. Amy I way off base here? A little bit. Notice the _todelete argument to the translate method. That argument deletes all characters from the string that aren't part of a numeric literal. Besides, the Matrix constructor doesn't pass along the vars() from which it was called, so Adum wouldn't be defined where the string gets eval'd anyways. > TIA! > > Jeff -- Robert Kern kern at caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From pajer at iname.com Sun Aug 31 11:25:18 2003 From: pajer at iname.com (Gary Pajer) Date: Sun, 31 Aug 2003 11:25:18 -0400 Subject: [SciPy-user] Couple of Matrix() questions References: <3F5205E8.30808@bellsouth.net> Message-ID: <000d01c36fd4$162f89f0$01fd5644@playroom> I think I have similar questions. I, too, am a pilgrim from Matlab. I haven't found the answer, but look at the source for .../scipy_base/shape_base.py and you'll find vstack() and hstack() and some other stuff that might help. I haven't groked these entirely. Also see .../scipy_base/index_tricks.py There's a class in there called concatenator, along with instances r_ and c_. If you figure out what it does, let me know. It looks promising, but I can't figure it out. -Gary ----- Original Message ----- From: "Jeffrey B. Layton" To: Sent: Sunday, August 31, 2003 10:27 AM Subject: Re: [SciPy-user] Couple of Matrix() questions > Pearu, > > Thanks for the help! I've got a follow-up below. > > >> My second question is how to concatenate matrices > >>create with mat(). I tried the following (complete with > >>error messages), > >> > >> >>> A=mat('[0,1];[2,3]') > >> >>> B=mat('[4,5];[6,7]') > >> >>> C=mat('[8,9];[10,11]') > >> >>> D=mat('[12,13];[14,15]') > >> > >> > >>I know this is a holdover from Matlab, but I would like > >>to get is the following, > >> > >>E=[0, 1, 4 ,5; > >> 2, 3, 6, 7; > >> 8, 9, 12, 13; > >> 10, 11, 14, 15] > >> > >>How do I do this in scipy? > >> > >> > > > >I hope there would be a better way but Numeric.concatenate does the job: > > > > > > > >>>>E=mat(concatenate([concatenate([A,B],axis=1),concatenate([C,D],axis=1)]) ) > >>>>E > >>>> > >>>> > >Matrix([[ 0, 1, 4, 5], > > [ 2, 3, 6, 7], > > [ 8, 9, 12, 13], > > [10, 11, 14, 15]]) > > > > This is terrible! There should definitely be a better way to do this. > People doing control analysis or anything requiring large linear > system built up from smaller systems (e.g. FEM, BEM, etc.) would > like to do this. Is the function [ ] an overloaded function from Scipy > that it can process the matrix class? It would be very nice to add the > concatenation capability to it. > > I guess another way would be to create E of the appropriate size and > then copy A, B, C, and D into the appropriate locations. Is there a > way to create E using mat() that initializes the matrix to zero? While > I'm on the topic, is there a good place for mat() documentation, > specifically a tutorial? > > I did try the following: > > >>> Adum=mat('[0,0;0,0]') > >>> print Adum > Matrix([[0, 0], > [0, 0]]) > >>> E=mat('[Adum,Adum];[Adum,Adum]') > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 69, in > __init__ > data = _convert_from_string(data) > File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 36, in > _convert_from_string > newrow.extend(map(_eval,temp)) > File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 24, in > _eval > return eval(astr.translate(_table,_todelete)) > File "", line 0 > > ^ > SyntaxError: unexpected EOF while parsing > > I think this should work. Amy I way off base here? > > TIA! > > Jeff > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From laytonjb at bellsouth.net Sun Aug 31 11:40:04 2003 From: laytonjb at bellsouth.net (Jeffrey B. Layton) Date: Sun, 31 Aug 2003 11:40:04 -0400 Subject: [SciPy-user] Couple of Matrix() questions In-Reply-To: <20030831150958.GA3792@taliesen.caltech.edu> References: <3F5205E8.30808@bellsouth.net> <20030831150958.GA3792@taliesen.caltech.edu> Message-ID: <3F5216D4.5020706@bellsouth.net> Robert Kern wrote: >On Sun, Aug 31, 2003 at 10:27:52AM -0400, Jeffrey B. Layton wrote: > >[Pearu] > > >>>>>>E=mat(concatenate([concatenate([A,B],axis=1),concatenate([C,D],axis=1)])) >>>>>>E >>>>>> >>>>>> >>>>>> >>>>>> >>>Matrix([[ 0, 1, 4, 5], >>> [ 2, 3, 6, 7], >>> [ 8, 9, 12, 13], >>> [10, 11, 14, 15]]) >>> >>> > >[Jeffrey] > > >>This is terrible! There should definitely be a better way to do this. >>People doing control analysis or anything requiring large linear >>system built up from smaller systems (e.g. FEM, BEM, etc.) would >>like to do this. Is the function [ ] an overloaded function from Scipy >>that it can process the matrix class? It would be very nice to add the >>concatenation capability to it. >> >> > >I'm not sure what you mean here. [] isn't a function, but a Python >language literal that creates a list. It isn't overloadable. > Robert, I'm sure my newbieness show and I'm glad you didn't exploit it :) Let me try to explain. If a create an instance of the mat class via, mat(), I can slice up that array all I want. Do the slice functions happen via methods in the mat class that end up using lists in Python? If so, why can't something simple like, >>> E=[[A,B],[C,D]] be written into the class? (that I'm volunteering :) >>I did try the following: >> >> >> >>>>>Adum=mat('[0,0;0,0]') >>>>>print Adum >>>>> >>>>> >>Matrix([[0, 0], >> [0, 0]]) >> >> >>>>>E=mat('[Adum,Adum];[Adum,Adum]') >>>>> >>>>> >>Traceback (most recent call last): >> File "", line 1, in ? >> File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 69, in >>__init__ >> data = _convert_from_string(data) >> File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 36, in >>_convert_from_string >> newrow.extend(map(_eval,temp)) >> File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 24, in >>_eval >> return eval(astr.translate(_table,_todelete)) >> File "", line 0 >> >> ^ >>SyntaxError: unexpected EOF while parsing >> >>I think this should work. Amy I way off base here? >> >> > >A little bit. Notice the _todelete argument to the translate method. >That argument deletes all characters from the string that aren't part of >a numeric literal. Besides, the Matrix constructor doesn't pass along >the vars() from which it was called, so Adum wouldn't be defined where >the string gets eval'd anyways. > Is there a way to tell the mat constructor not to delete all non-numerical literals? Maybe it could check the namespace for the variable (is instance a better word?) and then use the value of the variable to construct the matrix. Would this be a complete rewrite of the mat class? I hate to be a pain, but this seems like something that should be part of the mat class (just suggesting, not volunteering, and not truly criticizing :). Thanks! Jeff From laytonjb at bellsouth.net Sun Aug 31 11:52:05 2003 From: laytonjb at bellsouth.net (Jeffrey B. Layton) Date: Sun, 31 Aug 2003 11:52:05 -0400 Subject: [SciPy-user] Couple of Matrix() questions In-Reply-To: <000d01c36fd4$162f89f0$01fd5644@playroom> References: <3F5205E8.30808@bellsouth.net> <000d01c36fd4$162f89f0$01fd5644@playroom> Message-ID: <3F5219A5.6060001@bellsouth.net> Gary Pajer wrote: >I think I have similar questions. I, too, am a pilgrim from Matlab. > >I haven't found the answer, but look at the source for >.../scipy_base/shape_base.py >and you'll find vstack() and hstack() and some other stuff that might help. >I haven't groked these entirely. > Gary, Thanks for the tip! I tried vstack() and hstack() for my problem. I ended up with something like this: >>> E=hstack((vstack((A,C)),vstack((B,D)))) which is not an array type (maybe not a bad thing). However, I'd still like to avoid so much work (typing, watching my tuples, etc.) to just do something so simple. Oh well, Roberts matcat function seems to work just great. I just hate to have a function for each common matrix function when it could (or should) be part of the underlying class. > >Also see >.../scipy_base/index_tricks.py >There's a class in there called concatenator, along with instances r_ and >c_. If you figure out what it does, let me know. It looks promising, but I >can't figure it out. > I'll keep digging as well. Thanks for the tips! Jeff > >-Gary > > > >----- Original Message ----- >From: "Jeffrey B. Layton" >To: >Sent: Sunday, August 31, 2003 10:27 AM >Subject: Re: [SciPy-user] Couple of Matrix() questions > > > > >>Pearu, >> >> Thanks for the help! I've got a follow-up below. >> >> >> >>>> My second question is how to concatenate matrices >>>>create with mat(). I tried the following (complete with >>>>error messages), >>>> >>>> >>>> >>>>>>>A=mat('[0,1];[2,3]') >>>>>>>B=mat('[4,5];[6,7]') >>>>>>>C=mat('[8,9];[10,11]') >>>>>>>D=mat('[12,13];[14,15]') >>>>>>> >>>>>>> >>>>I know this is a holdover from Matlab, but I would like >>>>to get is the following, >>>> >>>>E=[0, 1, 4 ,5; >>>> 2, 3, 6, 7; >>>> 8, 9, 12, 13; >>>> 10, 11, 14, 15] >>>> >>>>How do I do this in scipy? >>>> >>>> >>>> >>>> >>>I hope there would be a better way but Numeric.concatenate does the job: >>> >>> >>> >>> >>> >>>>>E=mat(concatenate([concatenate([A,B],axis=1),concatenate([C,D],axis=1)]) >>>>> >>>>> >) > > >>>>>>E >>>>>> >>>>>> >>>>>> >>>>>> >>>Matrix([[ 0, 1, 4, 5], >>> [ 2, 3, 6, 7], >>> [ 8, 9, 12, 13], >>> [10, 11, 14, 15]]) >>> >>> >>> >>This is terrible! There should definitely be a better way to do this. >>People doing control analysis or anything requiring large linear >>system built up from smaller systems (e.g. FEM, BEM, etc.) would >>like to do this. Is the function [ ] an overloaded function from Scipy >>that it can process the matrix class? It would be very nice to add the >>concatenation capability to it. >> >>I guess another way would be to create E of the appropriate size and >>then copy A, B, C, and D into the appropriate locations. Is there a >>way to create E using mat() that initializes the matrix to zero? While >>I'm on the topic, is there a good place for mat() documentation, >>specifically a tutorial? >> >>I did try the following: >> >> >>> Adum=mat('[0,0;0,0]') >> >>> print Adum >>Matrix([[0, 0], >> [0, 0]]) >> >>> E=mat('[Adum,Adum];[Adum,Adum]') >>Traceback (most recent call last): >> File "", line 1, in ? >> File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 69, in >>__init__ >> data = _convert_from_string(data) >> File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 36, in >>_convert_from_string >> newrow.extend(map(_eval,temp)) >> File "/usr/lib/python2.2/site-packages/Numeric/Matrix.py", line 24, in >>_eval >> return eval(astr.translate(_table,_todelete)) >> File "", line 0 >> >> ^ >>SyntaxError: unexpected EOF while parsing >> >>I think this should work. Amy I way off base here? >> >>TIA! >> >>Jeff >> >> >> From kern at caltech.edu Sun Aug 31 11:59:09 2003 From: kern at caltech.edu (Robert Kern) Date: Sun, 31 Aug 2003 08:59:09 -0700 Subject: [SciPy-user] Couple of Matrix() questions In-Reply-To: <3F5216D4.5020706@bellsouth.net> References: <3F5205E8.30808@bellsouth.net> <20030831150958.GA3792@taliesen.caltech.edu> <3F5216D4.5020706@bellsouth.net> Message-ID: <20030831155909.GA11758@taliesen.caltech.edu> On Sun, Aug 31, 2003 at 11:40:04AM -0400, Jeffrey B. Layton wrote: [snippity] > Robert, > > I'm sure my newbieness show and I'm glad you didn't exploit it :) > Let me try to explain. If a create an instance of the mat class via, > mat(), I can slice up that array all I want. Do the slice functions > happen via methods in the mat class that end up using lists in > Python? No. E[2:4,:], etc. call the __getslice__, __setslice__, or __delslice__ methods (depending on the context) of the underlying Numeric array. > If so, why can't something simple like, > > >>> E=[[A,B],[C,D]] > > be written into the class? (that I'm volunteering :) Not like that. That particular piece of code creates a list (of lists of whatever A, B, C, and D are) and binds the name 'E' to that object. It doesn't matter if you had already bound 'E' to another type of object (say, a zero matrix). The name just gets rebound. There's no slicing going on in this example at all. If you want to do some processing on that list to get it into the form that you want (a Matrix instance with the sub-arrays appropriately concatenated), the best way is to define a function. [snip] > Is there a way to tell the mat constructor not to delete all non-numerical > literals? Maybe it could check the namespace for the variable (is instance > a better word?) and then use the value of the variable to construct the > matrix. Would this be a complete rewrite of the mat class? Not complete, just the __init__ method and the support functions would need to be changed. > I hate to be > a pain, but this seems like something that should be part of the mat class > (just suggesting, not volunteering, and not truly criticizing :). Well, given that the class already has concessions for Matlab-like syntax, perhaps it should. On the other hand, it might make it a little less safe. > Thanks! > > Jeff -- Robert Kern kern at caltech.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From pajer at iname.com Sun Aug 31 13:07:41 2003 From: pajer at iname.com (Gary Pajer) Date: Sun, 31 Aug 2003 13:07:41 -0400 Subject: [SciPy-user] Couple of Matrix() questions References: <3F5205E8.30808@bellsouth.net> <000d01c36fd4$162f89f0$01fd5644@playroom> <3F5219A5.6060001@bellsouth.net> Message-ID: <000b01c36fe2$637b41a0$01fd5644@playroom> [...] > >>> E=hstack((vstack((A,C)),vstack((B,D)))) > > which is not an array type (maybe not a bad thing). However, I'd still > like to avoid so much work (typing, watching my tuples, etc.) to just > do something so simple. Oh well, Roberts matcat function seems to > work just great. I just hate to have a function for each common matrix > function when it could (or should) be part of the underlying class. I argree entirely, and I continue to search for the syntax that makes it so. -gary From pearu at scipy.org Sun Aug 31 14:13:57 2003 From: pearu at scipy.org (Pearu Peterson) Date: Sun, 31 Aug 2003 13:13:57 -0500 (CDT) Subject: [SciPy-user] Couple of Matrix() questions In-Reply-To: <000b01c36fe2$637b41a0$01fd5644@playroom> Message-ID: On Sun, 31 Aug 2003, Gary Pajer wrote: > [...] > > >>> E=hstack((vstack((A,C)),vstack((B,D)))) > > > > which is not an array type (maybe not a bad thing). However, I'd still > > like to avoid so much work (typing, watching my tuples, etc.) to just > > do something so simple. Oh well, Roberts matcat function seems to > > work just great. I just hate to have a function for each common matrix > > function when it could (or should) be part of the underlying class. > > I argree entirely, and I continue to search for the syntax that makes it so. How about adding some new ?stack-type of methods to Matrix: E = A.vstack(C).hstack(B.vstack(D)) ? Suggestions for a better naming for such ?stack methods? Another idea: extend Matrix constructor to accept a list of matrix-like objects so that stacking of matrices can be achived as follows: E = mat([[A,B],[C,D]]) where A,B,C,D are Matrix instances with appropiate shapes. Pearu From laytonjb at bellsouth.net Sun Aug 31 14:37:10 2003 From: laytonjb at bellsouth.net (Jeffrey B. Layton) Date: Sun, 31 Aug 2003 14:37:10 -0400 Subject: [SciPy-user] Couple of Matrix() questions In-Reply-To: References: Message-ID: <3F524056.2040203@bellsouth.net> > > > >Another idea: extend Matrix constructor to accept a list of matrix-like >objects so that stacking of matrices can be achived as follows: > > E = mat([[A,B],[C,D]]) > >where A,B,C,D are Matrix instances with appropiate shapes. > This has got my vote! Jeff From andrew.straw at adelaide.edu.au Sat Aug 30 00:02:59 2003 From: andrew.straw at adelaide.edu.au (Andrew Straw) Date: Sat, 30 Aug 2003 13:32:59 +0930 Subject: [SciPy-user] user contributed documentation and code Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I would like for us, as a community, to be able contribute documentation and sample code to the scipy project. I think a wiki would be a good, low-energy starting point, but unfortunately the link from the scipy "Documentation and Tutorials" page is broken. Could we get one of the Enthought folks to fix this? (If you're evaluating wikis, I recently found setting up a phpWiki ridiculously easy, even though I knew nothing about php. And yes, I know it's not in our favorite language, but I got it working within 30 minutes. :) There is also mention of user webpages and annotation of scipy.org pages if you become a scipy site member. However, I just tried to test-drive this functionality and also failed... It could be my browser -- OS X Safari is not the most compatible browser in the world, but that mainly seems to do with JavaScript support, which seems unlikely to be the problem. What do people think? Cheers! Andrew -----BEGIN PGP SIGNATURE----- iD8DBQE/UCH61xWcCSPVbpgRAthiAJ9eJ9M3lGTlP9MtnQMIT+cIFNRhDQCfS4CC 0eS5GQBJfTiLuMGF3FefErI= =uHan -----END PGP SIGNATURE----- From joe at enthought.com Sun Aug 31 15:51:00 2003 From: joe at enthought.com (Joe Cooper) Date: Sun, 31 Aug 2003 14:51:00 -0500 Subject: [SciPy-user] user contributed documentation and code In-Reply-To: References: Message-ID: <3F5251A4.7050507@enthought.com> Andrew Straw wrote: > I think a wiki would be a good, low-energy starting point, but > unfortunately the link from the scipy "Documentation and Tutorials" page > is broken. Could we get one of the Enthought folks to fix this? (If > you're evaluating wikis, I recently found setting up a phpWiki > ridiculously easy, even though I knew nothing about php. And yes, I > know it's not in our favorite language, but I got it working within 30 > minutes. :) I'm looking into it. We had ZWiki running fine for one precious moment in time...and it appears to have croaked again after the system upgrade a few days ago. I'll fix it. ZWiki is a temperamental beast but fits nicely into the Zope framework that runs SciPy. A PHP wiki would not have this benefit. > There is also mention of user webpages and annotation of scipy.org pages > if you become a scipy site member. However, I just tried to test-drive > this functionality and also failed... It could be my browser -- OS X > Safari is not the most compatible browser in the world, but that mainly > seems to do with JavaScript support, which seems unlikely to be the > problem. User created pages are working ok. It looks like few or no pages have commenting enabled. It is up to the creator of the page to decide whether commenting is enabled. I'll look into it to make sure we didn't lose this functionality during one of the upgrades (a couple of weeks ago we upgraded to Zope 2.6.1 to be able to use a recent ZWiki version, and then this past week we upgraded the server from Red Hat 7.2 to Red Hat 9). Thanks for the heads up.