From Tony.Mannucci at jpl.nasa.gov Mon May 1 05:30:31 2006 From: Tony.Mannucci at jpl.nasa.gov (Tony Mannucci) Date: Mon, 1 May 2006 02:30:31 -0700 Subject: [SciPy-user] scipy fails on OS X 10.4 -- RETRACTION Message-ID: Sorry, the docs are getting better, as is support for OS X. This very problem is solved using the source build instructions on the scipy site. Sorry for the hassle. -Tony At 1:27 AM -0700 4/29/06, Tony Mannucci wrote: >I downloaded the binary version of scipy from www.scipy.org/Download >for OS X 10.4. I installed in the usual OS X way (from .dmg package >file). > >I get the "old" error I used to see: > >>>> import scipy >>>> scipy.test(level=1) > >import signal -> failed: Failure linking new module: >/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/_fftpack.so: >Symbol not found: _fprintf$LDBLStub > Referenced from: >/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/_fftpack.so > Expected in: dynamic lookup > >Versions: >>>> scipy.__version__ >'0.4.8' >>>> scipy.__numpy_version__ >'0.9.6' > >I have selected gcc 3.3 using gcc_select. I had this problem before >when I built from source, and it had to do with the gcc version I >was using along with g77. > >Thanks for your help. > >-Tony -- Tony Mannucci Supervisor, Ionospheric and Atmospheric Remote Sensing Group Mail-Stop 138-308, Tel > (818) 354-1699 Jet Propulsion Laboratory, Fax > (818) 393-5115 California Institute of Technology, Email > Tony.Mannucci at jpl.nasa.gov 4800 Oak Grove Drive, http://genesis.jpl.nasa.gov Pasadena, CA 91109 From chanley at stsci.edu Mon May 1 13:14:26 2006 From: chanley at stsci.edu (Christopher Hanley) Date: Mon, 01 May 2006 13:14:26 -0400 Subject: [SciPy-user] PyFITS 1.1 "alpha 2" release Message-ID: <445641F2.8040509@stsci.edu> ------------------ | PYFITS Release | ------------------ Space Telescope Science Institute is pleased to announce the "alpha 2" release of PyFITS 1.1. This release includes support for both the NUMPY and NUMARRAY array packages. This software can be downloaded at: http://www.stsci.edu/resources/software_hardware/pyfits/Download The NUMPY support in PyFITS is not nearly as well tested as the NUMARRAY support. We expect that you will encounter bugs. Please send bug reports to "help at stsci.edu". We intend to support NUMARRAY and NUMPY simultaneously for a transition period of no less than 1 year. Eventually, however, support for NUMARRAY will disappear. During this period, it is likely that new features will appear only for NUMPY. The support for NUMARRAY will primarily be to fix serious bugs and handle platform updates. ----------- | Version | ----------- Version 1.1a2; May 1, 2006 ------------------------------- | Major Changes since v1.1a1 | ------------------------------- * Corrected a bug in which the format for a Column object was not being parsed properly because of format repeats. * Due to a change in NUMPY, recarray field access via attributes will no longer clobber pre-existing class methods or attributes. This behavior was causing PYFITS to fail when attempting to read tables that contained column names that were equivalent to existing class attribute or method names such as "field". This change in numpy was made in revision 2288. ------------------------- | Software Requirements | ------------------------- PyFITS Version 1.1a2 REQUIRES: * Python 2.3 or later * NUMPY or NUMARRAY --------------------- | Installing PyFITS | --------------------- PyFITS 1.1a2 is distributed as a Python distutils module. Installation simply involves unpacking the package and executing % python setup.py install to install it in Python's site-packages directory. Alternatively the command %python setup.py install --local="/destination/directory/" will install PyFITS in an arbitrary directory which should be placed on PYTHONPATH. Once numarray or numpy has been installed, then PyFITS should be available for use under Python. ----------------- | Download Site | ----------------- http://www.stsci.edu/resources/software_hardware/pyfits/Download ---------- | Usage | ---------- Users will issue an "import pyfits" command as in the past. However, the use of the NUMPY or NUMARRAY version of PyFITS will be controlled by an environment variable called NUMERIX. Set NUMERIX to 'numarray' for the NUMARRAY version of PyFITS. Set NUMERIX to 'numpy' for the NUMPY version of pyfits. If only one array package is installed, that package's version of PyFITS will be imported. If both packages are installed the NUMERIX value is used to decide which version to import. If no NUMERIX value is set then the NUMARRAY version of PyFITS will be imported. Anything else will raise an exception upon import. --------------- | Bug Reports | --------------- Please send all PyFITS bug reports to help at stsci.edu ------------------ | Advanced Users | ------------------ Users who would like the "bleeding" edge of PyFITS can retrieve the software from our SUBVERSION repository hosted at: http://astropy.scipy.org/svn/pyfits/trunk We also provide a Trac site at: http://projects.scipy.org/astropy/pyfits/wiki -- Christopher Hanley Systems Software Engineer Space Telescope Science Institute 3700 San Martin Drive Baltimore MD, 21218 (410) 338-4338 From ryanlists at gmail.com Mon May 1 23:58:51 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Mon, 1 May 2006 23:58:51 -0400 Subject: [SciPy-user] f2py in windows Message-ID: I just tried running f2py in windows and got the following message: No module named msvccompiler in numpy.distutils, trying from distutils.. error: The .NET Framework SDK needs to be installed before building extensions for Python. What do I need to do to use f2py in windows with mingw (or some other free compiler)? Thanks, Ryan From robert.kern at gmail.com Tue May 2 00:15:22 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 01 May 2006 23:15:22 -0500 Subject: [SciPy-user] f2py in windows In-Reply-To: References: Message-ID: <4456DCDA.1030907@gmail.com> Ryan Krauss wrote: > I just tried running f2py in windows and got the following message: > > No module named msvccompiler in numpy.distutils, trying from distutils.. > error: The .NET Framework SDK needs to be installed before building > extensions for Python. > > What do I need to do to use f2py in windows with mingw (or some other > free compiler)? Use --compiler=mingw32 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From ryanlists at gmail.com Tue May 2 00:16:28 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Tue, 2 May 2006 00:16:28 -0400 Subject: [SciPy-user] f2py in windows In-Reply-To: References: Message-ID: RTFM: --compiler=mingw32 Sorry. On 5/1/06, Ryan Krauss wrote: > I just tried running f2py in windows and got the following message: > > No module named msvccompiler in numpy.distutils, trying from distutils.. > error: The .NET Framework SDK needs to be installed before building > extensions for Python. > > What do I need to do to use f2py in windows with mingw (or some other > free compiler)? > > Thanks, > > Ryan > From ryanlists at gmail.com Tue May 2 00:17:19 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Tue, 2 May 2006 00:17:19 -0400 Subject: [SciPy-user] windows message at import Message-ID: Is this message normal on windows?: E:\thesis\swdesign\integrated_id\April_26_redo>python Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import scipy Overwriting info= from scipy.misc.helpmod (was from scipy.utils.helpmod) Overwriting factorial= from scipy.misc.common (was from scipy.utils.common) Overwriting factorial2= from scipy.misc.commo n (was from scipy.utils.common) Overwriting factorialk= from scipy.misc.commo n (was from scipy.utils.common) Overwriting comb= from scipy.misc.common (was from scipy.utils.common) Overwriting who= from scipy.misc.common (was from scipy.utils.common) Overwriting lena= from scipy.misc.common (was from scipy.utils.common) Overwriting central_diff_weights= f rom scipy.misc.common (was from sc ipy.utils.common) Overwriting derivative= from scipy.misc.commo n (was from scipy.utils.common) Overwriting pade= from scipy.misc.common (was from scipy.utils.common) >>> scipy.__version__ '0.4.8' Thanks, Ryan From robert.kern at gmail.com Tue May 2 00:21:01 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 01 May 2006 23:21:01 -0500 Subject: [SciPy-user] windows message at import In-Reply-To: References: Message-ID: <4456DE2D.3040808@gmail.com> Ryan Krauss wrote: > Is this message normal on windows?: > > E:\thesis\swdesign\integrated_id\April_26_redo>python > Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import scipy > > Overwriting info= from scipy.misc.helpmod (was ction info at 0x00FDA7F0> from scipy.utils.helpmod) > Overwriting factorial= from scipy.misc.common > (was from scipy.utils.common) > Overwriting factorial2= from scipy.misc.commo > n (was from scipy.utils.common) > Overwriting factorialk= from scipy.misc.commo > n (was from scipy.utils.common) > Overwriting comb= from scipy.misc.common (was tion comb at 0x00F77BB0> from scipy.utils.common) > Overwriting who= from scipy.misc.common (was on who at 0x00FD4DB0> from scipy.utils.common) > Overwriting lena= from scipy.misc.common (was tion lena at 0x00FD4D70> from scipy.utils.common) > Overwriting central_diff_weights= f > rom scipy.misc.common (was from sc > ipy.utils.common) > Overwriting derivative= from scipy.misc.commo > n (was from scipy.utils.common) > Overwriting pade= from scipy.misc.common (was tion pade at 0x00FD4D30> from scipy.utils.common) > >>>>scipy.__version__ > > '0.4.8' I don't think so. scipy.utils and scipy.misc don't exist. Do you have some old version installed, too? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From ryanlists at gmail.com Tue May 2 00:37:28 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Tue, 2 May 2006 00:37:28 -0400 Subject: [SciPy-user] windows message at import In-Reply-To: <4456DE2D.3040808@gmail.com> References: <4456DE2D.3040808@gmail.com> Message-ID: I did have an old version installed. All is well now. Thanks Robert. On 5/2/06, Robert Kern wrote: > Ryan Krauss wrote: > > Is this message normal on windows?: > > > > E:\thesis\swdesign\integrated_id\April_26_redo>python > > Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import scipy > > > > Overwriting info= from scipy.misc.helpmod (was > ction info at 0x00FDA7F0> from scipy.utils.helpmod) > > Overwriting factorial= from scipy.misc.common > > (was from scipy.utils.common) > > Overwriting factorial2= from scipy.misc.commo > > n (was from scipy.utils.common) > > Overwriting factorialk= from scipy.misc.commo > > n (was from scipy.utils.common) > > Overwriting comb= from scipy.misc.common (was > tion comb at 0x00F77BB0> from scipy.utils.common) > > Overwriting who= from scipy.misc.common (was > on who at 0x00FD4DB0> from scipy.utils.common) > > Overwriting lena= from scipy.misc.common (was > tion lena at 0x00FD4D70> from scipy.utils.common) > > Overwriting central_diff_weights= f > > rom scipy.misc.common (was from sc > > ipy.utils.common) > > Overwriting derivative= from scipy.misc.commo > > n (was from scipy.utils.common) > > Overwriting pade= from scipy.misc.common (was > tion pade at 0x00FD4D30> from scipy.utils.common) > > > >>>>scipy.__version__ > > > > '0.4.8' > > I don't think so. scipy.utils and scipy.misc don't exist. Do you have some old > version installed, too? > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret it as though it had > an underlying truth." > -- Umberto Eco > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From nwagner at iam.uni-stuttgart.de Tue May 2 09:35:23 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Tue, 02 May 2006 15:35:23 +0200 Subject: [SciPy-user] Balancing sparse matrices Message-ID: <4457601B.7010405@iam.uni-stuttgart.de> Hi all, Has someone written a function for balancing sparse matrices ? Any pointer would be appreciated. Nils From karsten at bolding-burchard.com Tue May 2 15:46:10 2006 From: karsten at bolding-burchard.com (Karsten Bolding) Date: Tue, 2 May 2006 21:46:10 +0200 Subject: [SciPy-user] problems with ..../delaunay/triangulate.py Message-ID: <20060502194610.GB31079@dbmail.dk> Hello My experince with python is very limited but there is a small group (so far) of oceanographers who would like to use python and various packages for oceanographic applications. I've tried to run the triangulation example from the Cookbook: http://www.scipy.org/Wiki/Cookbook/Matplotlib/Gridding_irregularly_spaced_data Running the script I get: Traceback (most recent call last): File "aa.py", line 32, in ? tri = Triangulation(x,y) File "/usr/lib/python2.3/site-packages/scipy/sandbox/delaunay/triangulate.py", line 68, in __init__ self.hull = self._compute_convex_hull() File "/usr/lib/python2.3/site-packages/scipy/sandbox/delaunay/triangulate.py", line 80, in _compute_convex_hull self.triangle_nodes[border[:,0]][:,2])) AttributeError: keys Now Rob Hetland has made a scripts that also uses triangulation.py and that works without problems for him. Running his script I get the same error. I'm running debian/unstable but have compiled numpy and scipy from the svn-repository. Yours Karsten -- ---------------------------------------------------------------------- Karsten Bolding Bolding & Burchard Hydrodynamics Strandgyden 25 Phone: +45 64422058 DK-5466 Asperup Fax: +45 64422068 Denmark Email: karsten at bolding-burchard.com In a world without walls and fences, who need windows and gates ---------------------------------------------------------------------- From robert.kern at gmail.com Tue May 2 15:57:48 2006 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 02 May 2006 14:57:48 -0500 Subject: [SciPy-user] problems with ..../delaunay/triangulate.py In-Reply-To: <20060502194610.GB31079@dbmail.dk> References: <20060502194610.GB31079@dbmail.dk> Message-ID: <4457B9BC.6090904@gmail.com> Karsten Bolding wrote: > Hello > > My experince with python is very limited but there is a small group (so > far) of oceanographers who would like to use python and various packages > for oceanographic applications. > > I've tried to run the triangulation example from the Cookbook: > http://www.scipy.org/Wiki/Cookbook/Matplotlib/Gridding_irregularly_spaced_data > > Running the script I get: > Traceback (most recent call last): > File "aa.py", line 32, in ? > tri = Triangulation(x,y) > File > "/usr/lib/python2.3/site-packages/scipy/sandbox/delaunay/triangulate.py", > line 68, in __init__ > self.hull = self._compute_convex_hull() > File > "/usr/lib/python2.3/site-packages/scipy/sandbox/delaunay/triangulate.py", > line 80, in _compute_convex_hull > self.triangle_nodes[border[:,0]][:,2])) > AttributeError: keys Oops. I injected a 2.4-ism. Fixed in r1893. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From jbattat at cfa.harvard.edu Tue May 2 16:22:22 2006 From: jbattat at cfa.harvard.edu (James Battat) Date: Tue, 2 May 2006 16:22:22 -0400 (EDT) Subject: [SciPy-user] indices of array elements that satisfy some condition. In-Reply-To: <4457B9BC.6090904@gmail.com> References: <20060502194610.GB31079@dbmail.dk> <4457B9BC.6090904@gmail.com> Message-ID: Hi all, I'm coming from an IDL (RSI) background in which you can get the indices of an array whose elements satisfy some condition in the following way: IDL> data = [10, 5, 9, 14] IDL> ids = where(data>9) IDL> print, ids 0, 3 IDL> print, data[ids] 10, 14 Using scipy, I only know of a very convoluted solution to the same problem (see below). Can someone suggest a more direct, cleaner approach? Many thanks, James >>> import scipy >>> data = scipy.array([10,5,9,14]) >>> data array([10,5,9,14]) >>> true = scipy.ones(len(data)) >>> true array([1,1,1,1]) >>> false = scipy.zeros(len(data)) >>> false array([0,0,0,0]) >>> temp = scipy.where(data>9,true,false) >>> temp array([1,0,0,1]) >>> ids = scipy.nonzero(temp) >>> ids array([0,3]) >>> data[ids] array([10,14]) From robert.kern at gmail.com Tue May 2 16:25:56 2006 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 02 May 2006 15:25:56 -0500 Subject: [SciPy-user] indices of array elements that satisfy some condition. In-Reply-To: References: <20060502194610.GB31079@dbmail.dk> <4457B9BC.6090904@gmail.com> Message-ID: <4457C054.9000706@gmail.com> James Battat wrote: > Hi all, > > I'm coming from an IDL (RSI) background in which you can get the > indices of an array whose elements satisfy some condition in the following > way: > > IDL> data = [10, 5, 9, 14] > IDL> ids = where(data>9) > IDL> print, ids > 0, 3 > IDL> print, data[ids] > 10, 14 > > Using scipy, I only know of a very convoluted solution to the same problem > (see below). Can someone suggest a more direct, cleaner approach? In [2]: from numpy import * In [3]: data = array([10, 5, 9, 14]) In [4]: ids = where(data > 9) In [5]: ids Out[5]: (array([0, 3]),) In [6]: data[ids] Out[6]: array([10, 14]) -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From perry at stsci.edu Tue May 2 16:28:14 2006 From: perry at stsci.edu (Perry Greenfield) Date: Tue, 2 May 2006 16:28:14 -0400 Subject: [SciPy-user] indices of array elements that satisfy some condition. In-Reply-To: References: <20060502194610.GB31079@dbmail.dk> <4457B9BC.6090904@gmail.com> Message-ID: <5FD0FA30-2BCD-4D7D-A623-92B3BF71D274@stsci.edu> On May 2, 2006, at 4:22 PM, James Battat wrote: > Hi all, > > I'm coming from an IDL (RSI) background in which you can get the > indices of an array whose elements satisfy some condition in the > following > way: > > IDL> data = [10, 5, 9, 14] > IDL> ids = where(data>9) > IDL> print, ids > 0, 3 > IDL> print, data[ids] > 10, 14 Very nearly the same thing works in numpy (the only difference is that ids would return a tuple of index arrays, one per dimension). Try it. Note that where() has two entirely different functionalities. If you just supply one argument, it behaves much like IDL's where function. The use with multiple arguments is taken from Numeric's behavior. Perry Greenfield From a.u.r.e.l.i.a.n at gmx.net Tue May 2 16:33:50 2006 From: a.u.r.e.l.i.a.n at gmx.net (Johannes Loehnert) Date: Tue, 02 May 2006 22:33:50 +0200 Subject: [SciPy-user] indices of array elements that satisfy some condition. In-Reply-To: <4457C054.9000706@gmail.com> References: <20060502194610.GB31079@dbmail.dk> <4457B9BC.6090904@gmail.com> <4457C054.9000706@gmail.com> Message-ID: <4457C22E.8050400@gmx.net> Hi, > In [2]: from numpy import * > > In [3]: data = array([10, 5, 9, 14]) > > In [4]: ids = where(data > 9) > > In [5]: ids > Out[5]: (array([0, 3]),) > > In [6]: data[ids] > Out[6]: array([10, 14]) > You can have it even shorter: In [1]: from numpy import * In [2]: data = array([10, 5, 9, 14]) In [3]: data[data>9] Out[3]: array([10, 14]) HTH, Johannes From kwgoodman at gmail.com Tue May 2 16:36:09 2006 From: kwgoodman at gmail.com (Keith Goodman) Date: Tue, 2 May 2006 13:36:09 -0700 Subject: [SciPy-user] indices of array elements that satisfy some condition. In-Reply-To: References: <20060502194610.GB31079@dbmail.dk> <4457B9BC.6090904@gmail.com> Message-ID: On 5/2/06, James Battat wrote: > I'm coming from an IDL (RSI) background in which you can get the > indices of an array whose elements satisfy some condition in the following > way: > > IDL> data = [10, 5, 9, 14] > IDL> ids = where(data>9) > IDL> print, ids > 0, 3 > IDL> print, data[ids] > 10, 14 > > Using scipy, I only know of a very convoluted solution to the same problem > (see below). Can someone suggest a more direct, cleaner approach? I'm new to scipy too. But I think your IDL example works without modification in scipy: >> data = array([10,5,9,14]) >> data array([10, 5, 9, 14]) >> where(data > 9) (array([0, 3]),) The trick is to use one input argument with 'where' (instead of three). From karsten at bolding-burchard.com Tue May 2 16:39:51 2006 From: karsten at bolding-burchard.com (Karsten Bolding) Date: Tue, 2 May 2006 22:39:51 +0200 Subject: [SciPy-user] problems with ..../delaunay/triangulate.py In-Reply-To: <4457B9BC.6090904@gmail.com> References: <20060502194610.GB31079@dbmail.dk> <4457B9BC.6090904@gmail.com> Message-ID: <20060502203951.GC31079@dbmail.dk> Hello On Tue, May 02, 2006 at 02:57:48PM -0500, Robert Kern wrote: > Karsten Bolding wrote: > > Hello > > Oops. I injected a 2.4-ism. Fixed in r1893. This fixed the triagulation.py problem so I now can run Rob's example - however for the irregulare grid example I get a new error: kbk at orca:~$ python aa.py /usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:991: GtkWarning: Could not find the icon 'gnome-fs-home'. The 'hicolor' theme was not found either, perhaps you need to install it. You can get a copy from: http://icon-theme.freedesktop.org/releases buttons) /usr/lib/python2.3/site-packages/numpy/core/ma.py:601: UserWarning: Cannot automatically convert masked array to numeric because data is masked in one or more locations. warnings.warn("Cannot automatically convert masked array to "\ /usr/lib/python2.3/site-packages/numarray/numarraycore.py:383: UserWarning: __array__ returned non-NumArray instance _warnings.warn("__array__ returned non-NumArray instance") Traceback (most recent call last): File "aa.py", line 41, in ? plot_data(xi,yi,zi) File "aa.py", line 15, in plot_data pcolor(xi,yi,zim,shading='interp',cmap=cm.gray) File "/usr/lib/python2.3/site-packages/matplotlib/pylab.py", line 2007, in pcolor ret = gca().pcolor(*args, **kwargs) File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 2268, in pcolor C = compress(ravel(mask==0),ravel(ma.filled(C[0:Nx-1,0:Ny-1]))) File "/usr/lib/python2.3/site-packages/numarray/ma/MA.py", line 832, in __getitem__ if self._data.rank == 0: AttributeError: 'numpy.ndarray' object has no attribute 'rank' I don't know why debian is so slow to make the default version of python 2.4 - however trying to overrule it yourself is advisable according to google :-) > > -- > Robert Kern > Karsten -- ---------------------------------------------------------------------- Karsten Bolding Bolding & Burchard Hydrodynamics Strandgyden 25 Phone: +45 64422058 DK-5466 Asperup Fax: +45 64422068 Denmark Email: karsten at bolding-burchard.com In a world without walls and fences, who need windows and gates ---------------------------------------------------------------------- From robert.kern at gmail.com Tue May 2 16:53:51 2006 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 02 May 2006 15:53:51 -0500 Subject: [SciPy-user] problems with ..../delaunay/triangulate.py In-Reply-To: <20060502203951.GC31079@dbmail.dk> References: <20060502194610.GB31079@dbmail.dk> <4457B9BC.6090904@gmail.com> <20060502203951.GC31079@dbmail.dk> Message-ID: <4457C6DF.8080003@gmail.com> Karsten Bolding wrote: > kbk at orca:~$ python aa.py > /usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:991: > GtkWarning: Could not find the icon 'gnome-fs-home'. The 'hicolor' theme > was not found either, perhaps you need to install it. > You can get a copy from: > http://icon-theme.freedesktop.org/releases > buttons) > /usr/lib/python2.3/site-packages/numpy/core/ma.py:601: > UserWarning: Cannot automatically convert masked array to > numeric because data > is masked in one or more locations. > warnings.warn("Cannot automatically convert masked array > to "\ > /usr/lib/python2.3/site-packages/numarray/numarraycore.py:383: > UserWarning: __array__ returned non-NumArray instance > _warnings.warn("__array__ returned non-NumArray > instance") > Traceback (most recent call last): > File "aa.py", line 41, in ? > plot_data(xi,yi,zi) > File "aa.py", line 15, in plot_data > pcolor(xi,yi,zim,shading='interp',cmap=cm.gray) > File > "/usr/lib/python2.3/site-packages/matplotlib/pylab.py", > line 2007, in pcolor > ret = gca().pcolor(*args, **kwargs) > File > "/usr/lib/python2.3/site-packages/matplotlib/axes.py", > line 2268, in pcolor > C = > compress(ravel(mask==0),ravel(ma.filled(C[0:Nx-1,0:Ny-1]))) > File > "/usr/lib/python2.3/site-packages/numarray/ma/MA.py", > line 832, in __getitem__ > if self._data.rank == 0: > AttributeError: > 'numpy.ndarray' object has no attribute 'rank' Make matplotlib use numpy instead of numarray. Set the "numerix" parameter to "numpy" in your ~/.matplotlib/matplotlibrc file. > I don't know why debian is so slow to make the default version of python > 2.4 - however trying to overrule it yourself is advisable according to > google :-) You might want to try Ubuntu. All of the Debian goodness with updated packages. Also, you can install python2.4 alongside python2.3 just fine. Just use "python2.4" as the executable name instead of "python". -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From fonnesbeck at gmail.com Tue May 2 17:11:24 2006 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Tue, 2 May 2006 17:11:24 -0400 Subject: [SciPy-user] scipy fails on OS X 10.4 In-Reply-To: References: Message-ID: <723eb6930605021411t3067543fq4b43a1d0fa65e76d@mail.gmail.com> On 4/29/06, Tony Mannucci wrote: > > I downloaded the binary version of scipy from www.scipy.org/Download > for OS X 10.4. I installed in the usual OS X way (from .dmg package > file). > > I get the "old" error I used to see: > > >>> import scipy > >>> scipy.test(level=1) > > import signal -> failed: Failure linking new module: > > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/_fftpack.so: > Symbol not found: _fprintf$LDBLStub > Referenced from: > > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/scipy/fftpack/_fftpack.so > Expected in: dynamic lookup > > Are you using the associated numpy release that is posted on the site? This binary was compiled against it, and using another build may be causing this. This (and numpy) were built using gcc 3.3. Chris -- Chris Fonnesbeck + Atlanta, GA + http://trichech.us -------------- next part -------------- An HTML attachment was scrubbed... URL: From hetland at tamu.edu Tue May 2 17:14:42 2006 From: hetland at tamu.edu (Robert Hetland) Date: Tue, 2 May 2006 16:14:42 -0500 Subject: [SciPy-user] problems with ..../delaunay/triangulate.py In-Reply-To: <4457C6DF.8080003@gmail.com> References: <20060502194610.GB31079@dbmail.dk> <4457B9BC.6090904@gmail.com> <20060502203951.GC31079@dbmail.dk> <4457C6DF.8080003@gmail.com> Message-ID: <93DFB532-B0EA-4497-8C5F-C6C4DB3E3EE3@tamu.edu> > > Also, you can install python2.4 alongside python2.3 just fine. Just > use > "python2.4" as the executable name instead of "python". It is important to call the executable python2.4, since some of the operating system utilities rely on python. I had issues with an npaci rocks version (clustering tools) of redhat when I tried to set the default python to 2.4. -Rob ----- Rob Hetland, Assistant Professor Dept of Oceanography, Texas A&M University p: 979-458-0096, f: 979-845-6331 e: hetland at tamu.edu, w: http://pong.tamu.edu From josegomez at gmx.net Wed May 3 03:29:27 2006 From: josegomez at gmx.net (Jose Luis Gomez Dans) Date: Wed, 3 May 2006 09:29:27 +0200 (MEST) Subject: [SciPy-user] Fastest way to calculate masked values? Message-ID: <16016.1146641367@www088.gmx.net> Hi! I have written some code that calculates some statistics from regions of an array. These regions are defined by a mask array. This mask array has defines a number of regions in the first array which are to be grouped together (i.e., work out the mean of all elements in the data array where the mask array is some_value). I use Enthought Python (and thus Numeric 23.4) for ease of installation in my work computer, and so far, what I have come up with works, but is quite slow: for n in mask_vals: t = ravel(where (mask == n,data_array, 0.0)) val = mean ( compress ( t>0.0, t ) ) The number of elements in mask_vals is relatively large (>1000), and the arrays are around 2000x2000 in size. I also need to do a test in case the number of elements in t is less than 1 (there can be values in data_array of 0.0 that need to be ignored). As I said, my code works, but it is very slow. I have thought about using the map function, and also considered using masked arrays. I don't know the relative merits of each, and before I start tearing my hair, I'd ask around for some suggestions :) Many thanks! Jose -- GMX Produkte empfehlen und ganz einfach Geld verdienen! Satte Provisionen f?r GMX Partner: http://www.gmx.net/de/go/partner From a.u.r.e.l.i.a.n at gmx.net Wed May 3 04:11:37 2006 From: a.u.r.e.l.i.a.n at gmx.net (Johannes Loehnert) Date: Wed, 3 May 2006 10:11:37 +0200 Subject: [SciPy-user] Boolean indexing Message-ID: <200605031011.37173.a.u.r.e.l.i.a.n@gmx.net> Hi, I just stumbled upon something... In [15]: a Out[15]: array([[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]]) In [16]: b = array([False, True, True, True, False]) In [17]: a[b] Out[17]: array([[2, 3], [4, 5], [6, 7]]) In [18]: a[b,:] --------------------------------------------------------------------------- exceptions.IndexError Traceback (most recent call last) /home/jloehnert/python/ratchet/ IndexError: arrays used as indices must be of integer type In [19]: a[nonzero(b),:] Out[19]: array([[2, 3], [4, 5], [6, 7]]) In [20]: numpy.__version__ Out[20]: '0.9.7.2473' Why does a[b, :] not work? Johannes From zpincus at stanford.edu Wed May 3 04:23:37 2006 From: zpincus at stanford.edu (Zachary Pincus) Date: Wed, 3 May 2006 01:23:37 -0700 Subject: [SciPy-user] N-D Convex Hull? Message-ID: <2067652A-783E-4D1E-93C4-69E3ABCAE368@stanford.edu> Hi folks, Is there anything in scipy (or in python at all) that can calculate the (approximate) convex hull of a set of N-dimensional points? All I need are the vertices, actually. I could get qhull or something and wrap that, or use one of the sets of libSVM wrappers to train a one-class SVM and extract the support vectors which probably provide an approximate convex hull... but if there's anything already out there, I'd be interested in finding out. Zach Pincus Program in Biomedical Informatics and Department of Biochemistry Stanford University School of Medicine From jelle.feringa at ezct.net Wed May 3 04:36:10 2006 From: jelle.feringa at ezct.net (Jelle Feringa / EZCT Architecture & Design Research) Date: Wed, 3 May 2006 10:36:10 +0200 Subject: [SciPy-user] N-D Convex Hull? In-Reply-To: <2067652A-783E-4D1E-93C4-69E3ABCAE368@stanford.edu> Message-ID: <034b01c66e8c$a1d0cb90$0b01a8c0@JELLE> Hi Zach, PyXL written by Chris Meyers will be of great use to you: http://www.tc.cornell.edu/~myers/PyXL/ Currently I'm working wit PyXL a lot, so feel free to be in touch off-list. Cheers, -jelle -----Original Message----- From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] On Behalf Of Zachary Pincus Sent: Wednesday, May 03, 2006 10:24 AM To: SciPy Users List Subject: [SciPy-user] N-D Convex Hull? Hi folks, Is there anything in scipy (or in python at all) that can calculate the (approximate) convex hull of a set of N-dimensional points? All I need are the vertices, actually. I could get qhull or something and wrap that, or use one of the sets of libSVM wrappers to train a one-class SVM and extract the support vectors which probably provide an approximate convex hull... but if there's anything already out there, I'd be interested in finding out. Zach Pincus Program in Biomedical Informatics and Department of Biochemistry Stanford University School of Medicine _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user From fullung at gmail.com Wed May 3 04:37:10 2006 From: fullung at gmail.com (Albert Strasheim) Date: Wed, 3 May 2006 10:37:10 +0200 Subject: [SciPy-user] N-D Convex Hull? In-Reply-To: <2067652A-783E-4D1E-93C4-69E3ABCAE368@stanford.edu> Message-ID: <013701c66e8c$c4c724a0$0a84a8c0@dsp.sun.ac.za> Hello Zach I'm currently putting the finishing touches on my libsvm wrapper for SciPy. I used ctypes and my wrapper allows one to pass NumPy arrays as data to libsvm. If you're interested in playing with it, I'll send it to you. Regards, Albert > -----Original Message----- > From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] > On Behalf Of Zachary Pincus > Sent: 03 May 2006 10:24 > To: SciPy Users List > Subject: [SciPy-user] N-D Convex Hull? > > Hi folks, > > Is there anything in scipy (or in python at all) that can calculate > the (approximate) convex hull of a set of N-dimensional points? All I > need are the vertices, actually. > > I could get qhull or something and wrap that, or use one of the sets > of libSVM wrappers to train a one-class SVM and extract the support > vectors which probably provide an approximate convex hull... but if > there's anything already out there, I'd be interested in finding out. > > Zach Pincus > > Program in Biomedical Informatics and Department of Biochemistry > Stanford University School of Medicine > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From m_webber_sydney at yahoo.com.au Wed May 3 08:03:30 2006 From: m_webber_sydney at yahoo.com.au (Matthew Webber) Date: Wed, 3 May 2006 13:03:30 +0100 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: <013701c66e8c$c4c724a0$0a84a8c0@dsp.sun.ac.za> Message-ID: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> I would appreciate it if someone could clarify for me the various Python "numerical" packages. One web site (I can't remember which) suggested that, in chronological order, - first there was Numeric - then there was numarray - finally there was numpy. However, various web sites seem to have different views of this. I've seen references to Numerical (is that the same as Numeric ??), and also references that seem to use Numeric(al) as a name for numpy. Or visa versa. I suspect that names have either been reused, or changed, or both, at some point leading to my confusion. The background to this question is that I've started using matplotlib (an excellent package BTW), and in the "Matplotlib User's Guide" (.PDF) page 8 it mentions Numeric and numarray, and then gives matching websites with (respectively) numpy and numarray in the name. So if anyone can clarify the relationship between the various Python mathematical extensions, that would be appreciated! Thanks Matthew From david.huard at gmail.com Wed May 3 09:05:04 2006 From: david.huard at gmail.com (David Huard) Date: Wed, 3 May 2006 09:05:04 -0400 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> References: <013701c66e8c$c4c724a0$0a84a8c0@dsp.sun.ac.za> <001d01c66ea9$97ea9760$0200a8c0@kookaburra> Message-ID: <91cf711d0605030605n60f32e1g3c340c1a29fdab02@mail.gmail.com> Some time ago, there were two packages implementing arrays and various mathematical functions named Numeric and Numarray. Numarray was designed (correct me if I'm wrong) to deal with larges arrays efficiently, while Numeric was faster on small arrays. Then, Travis Oliphant came and unified those two packages in what was called Scipy and Scipy_core. Scipy_core contained the lower level mathematical functions and types, while Scipy was the repository of various higher level algorithms (optimize, stats, signal, etc.). Around January 2006, Scipy_core was renamed numpy, which was, I believe, the nickname of Numeric. Numeric and Numarray are used by a lot of people and many scientific apps import one or both these packages. They are, however, bound to become unsupported once Numpy has reached some maturity. If you're starting with matplotlib, it is suggested you use Numpy (the new one). If you do, make sure you specify it in the matplotlibrc file. Apologies for any innacuracies or errors on my part, I'm also a numpy rookie. David 2006/5/3, Matthew Webber : > > I would appreciate it if someone could clarify for me the various Python > "numerical" packages. > > One web site (I can't remember which) suggested that, in chronological > order, > - first there was Numeric > - then there was numarray > - finally there was numpy. > > However, various web sites seem to have different views of this. I've seen > references to Numerical (is that the same as Numeric ??), and also > references that seem to use Numeric(al) as a name for numpy. Or visa > versa. > > I suspect that names have either been reused, or changed, or both, at some > point leading to my confusion. > > The background to this question is that I've started using matplotlib (an > excellent package BTW), and in the "Matplotlib User's Guide" (.PDF) page 8 > it mentions Numeric and numarray, and then gives matching websites with > (respectively) numpy and numarray in the name. > > So if anyone can clarify the relationship between the various Python > mathematical extensions, that would be appreciated! > > Thanks > Matthew > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgarcia at olfac.univ-lyon1.fr Wed May 3 09:05:14 2006 From: sgarcia at olfac.univ-lyon1.fr (Samuel GARCIA) Date: Wed, 03 May 2006 15:05:14 +0200 Subject: [SciPy-user] weave.inline : resize an array in c++ In-Reply-To: <44449237.3060705@olfac.univ-lyon1.fr> References: <443E82AB.1090305@olfac.univ-lyon1.fr> <17472.64077.796376.991043@prpc.aero.iitb.ac.in> <44449237.3060705@olfac.univ-lyon1.fr> Message-ID: <4458AA8A.1090500@olfac.univ-lyon1.fr> I finally find the solution by looking the code code arrayobject.c. Maybe it will help someone. The half-free documentation in pdf that I received in 04.11.2005 on numpy is not up to date in page 203 for PyArray_Resize. Is there an newer version ? The code : from scipy import * from scipy import weave from scipy.weave import converters c = ones((3,6)) code = """ #line 8 "test_weave.py" printf("%d %d\\n",c_array->dimensions[0],c_array->dimensions[1]); PyArray_Dims dims; dims.len = 2; dims.ptr = new int[2]; dims.ptr[0] = 4; dims.ptr[1] = 7; PyArray_Resize(c_array,&dims,1,PyArray_CORDER); printf("%d %d\\n",c_array->dimensions[0],c_array->dimensions[1]); """ err = weave.inline(code, ['c']) print c.shape #I want (4,7) !!! print c and it works !!! Samuel Samuel GARCIA wrote: > No I can't it resize from python because it is to slow. > There are a lot of iteration and for some of them I add a new value to > a vector. > My code was only an example, of course. > Is it easier to add one element to a 1D array than a ND ? > I am porting a old code from matlab and I was able to to do that in > mex file with mxRealloc. > > thanks > > Sam > > > Prabhu Ramachandran a ?crit : >>>>>>> "Samuel" == Samuel GARCIA writes: >>>>>>> >> >> Samuel> Hi, how to resize a array in the c++ code with >> Samuel> weave.inline() >> [...] >> Samuel> c = ones((3,6)) >> [...] >> Samuel> err = weave.inline(code, ['c'], type_converters=converters.blitz) >> Samuel> print c.shape #I want (4,7) !!! >> >> I am not sure why you'd want to do that. Can't you resize it from >> Python? In any case, if you really must do it, take a look at the c++ >> code generated by weave and look at it. You'll see that c_array is a >> PyArrayObject that you can use if you want it. However, I am not sure >> what will happen if you do resize the array and are using blitz. I >> suspect something bad may happen. Resizing the array might also >> relocate the entire block of memory for the array so accessing the >> older pointer will likely be disastrous. So, you should be careful >> doing this. >> >> cheers, >> prabhu >> >> _______________________________________________ >> 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 -------------- An HTML attachment was scrubbed... URL: From wjdandreta at att.net Wed May 3 09:41:19 2006 From: wjdandreta at att.net (Bill Dandreta) Date: Wed, 03 May 2006 09:41:19 -0400 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: <91cf711d0605030605n60f32e1g3c340c1a29fdab02@mail.gmail.com> References: <013701c66e8c$c4c724a0$0a84a8c0@dsp.sun.ac.za> <001d01c66ea9$97ea9760$0200a8c0@kookaburra> <91cf711d0605030605n60f32e1g3c340c1a29fdab02@mail.gmail.com> Message-ID: <4458B2FF.3090106@att.net> I believe there was a Numerical Python project a long time ago whose python module was named num.py and was sometimes referred to as numpy but that numpy is unrelated to the scipy numpy. Bill David Huard wrote: > Some time ago, there were two packages implementing arrays and various > mathematical functions named Numeric and Numarray. Numarray was > designed (correct me if I'm wrong) to deal with larges arrays > efficiently, while Numeric was faster on small arrays. Then, Travis > Oliphant came and unified those two packages in what was called Scipy > and Scipy_core. Scipy_core contained the lower level mathematical > functions and types, while Scipy was the repository of various higher > level algorithms (optimize, stats, signal, etc.). Around January 2006, > Scipy_core was renamed numpy, which was, I believe, the nickname of > Numeric. > > Numeric and Numarray are used by a lot of people and many scientific > apps import one or both these packages. They are, however, bound to > become unsupported once Numpy has reached some maturity. If you're > starting with matplotlib, it is suggested you use Numpy (the new one). > If you do, make sure you specify it in the matplotlibrc file. > > > Apologies for any innacuracies or errors on my part, I'm also a numpy > rookie. > > David > > 2006/5/3, Matthew Webber >: > > I would appreciate it if someone could clarify for me the various > Python > "numerical" packages. > > One web site (I can't remember which) suggested that, in chronological > order, > - first there was Numeric > - then there was numarray > - finally there was numpy. > > However, various web sites seem to have different views of this. > I've seen > references to Numerical (is that the same as Numeric ??), and also > references that seem to use Numeric(al) as a name for numpy. Or > visa versa. > > I suspect that names have either been reused, or changed, or both, > at some > point leading to my confusion. > > The background to this question is that I've started using > matplotlib (an > excellent package BTW), and in the "Matplotlib User's Guide" > (.PDF) page 8 > it mentions Numeric and numarray, and then gives matching websites > with > (respectively) numpy and numarray in the name. > > So if anyone can clarify the relationship between the various Python > mathematical extensions, that would be appreciated! > > Thanks > Matthew > > _______________________________________________ > 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 robert.kern at gmail.com Wed May 3 11:53:23 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 03 May 2006 10:53:23 -0500 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> References: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> Message-ID: <4458D1F3.2030806@gmail.com> Matthew Webber wrote: > I would appreciate it if someone could clarify for me the various Python > "numerical" packages. I'm afraid that both David and Bill are also confused on some points. In the beginning was Numeric. Unfortunately, Numeric acquired several nicknames: Numerical Python, Numerical, NumPy. For example, the SourceForge project name for it is numpy, the old CVS module is Numerical, Konrad Hinsen named his package Scientific Python in reference to Numerical Python. Development on Numeric slowed down several years ago, and people wanted to extend it in ways that the then-current codebase did not really allow. Furthermore, there was a desire to get Numeric or something like it into the standard library, and Guido was quite clear that the code was not maintainable in its state then. The numarray project began as a complete rewrite of Numeric that, among other things, pushed some of the code up into the Python level. This gave numarray a lot of flexibility and allowed it to experiment with a number of alternatives that have proven their usefulness. It also was quite fast for very large arrays because the people working on it were at the Space Telescope Science Institute and were intending to use it for astronomical image processing. Unfortunately, as fast as it was for large arrays, it was too slow for small arrays. In particular, SciPy codes ran quite a bit slower. Also, the C API for creating ufuncs was not as convenient as that of Numeric. Consequently, it was going to be very difficult to convert the SciPy codebase to use numarray. This split fractured the community quite a bit: some people wrote code only for numarray, seeing it as the next Numeric; some people wrote code for Numeric, because they needed SciPy. Travis Oliphant wanted to reunify the community around a single array package. He refactored Numeric's code to make it more maintainable (although probably not enough to get the whole thing into the standard library, more on that later) and flexible enough to implement the novel features of numarray. He named this project "scipy core" and intended to use the package name "scipy". The rest of SciPy would simply add more modules to core SciPy package. Eventually, it became clear that people were mistakenly thinking that Numeric had been subsumed into SciPy and that they would have to install the whole of SciPy just to get an array object. We had a long discussion about what to name the package, and the winner was numerix! Unfortunately, that name is trademarked by a company that does DSP. In order to avoid trademark infringement by ourselves and by our users, we needed another name. We picked numpy. Moral: Don't let your software project acquire nicknames! -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From david.huard at gmail.com Wed May 3 12:04:07 2006 From: david.huard at gmail.com (David Huard) Date: Wed, 3 May 2006 12:04:07 -0400 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: <4458D1F3.2030806@gmail.com> References: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> <4458D1F3.2030806@gmail.com> Message-ID: <91cf711d0605030904n2522098cr501cea2c9fb4640d@mail.gmail.com> Thanks Robert, I'd like to put this historical note on the wiki. Any objections ? David 2006/5/3, Robert Kern : > > Matthew Webber wrote: > > I would appreciate it if someone could clarify for me the various Python > > "numerical" packages. > > I'm afraid that both David and Bill are also confused on some points. > > In the beginning was Numeric. Unfortunately, Numeric acquired several > nicknames: > Numerical Python, Numerical, NumPy. For example, the SourceForge project > name > for it is numpy, the old CVS module is Numerical, Konrad Hinsen named his > package Scientific Python in reference to Numerical Python. > > Development on Numeric slowed down several years ago, and people wanted to > extend it in ways that the then-current codebase did not really allow. > Furthermore, there was a desire to get Numeric or something like it into > the > standard library, and Guido was quite clear that the code was not > maintainable > in its state then. The numarray project began as a complete rewrite of > Numeric > that, among other things, pushed some of the code up into the Python > level. This > gave numarray a lot of flexibility and allowed it to experiment with a > number of > alternatives that have proven their usefulness. It also was quite fast for > very > large arrays because the people working on it were at the Space Telescope > Science Institute and were intending to use it for astronomical image > processing. > > Unfortunately, as fast as it was for large arrays, it was too slow for > small > arrays. In particular, SciPy codes ran quite a bit slower. Also, the C API > for > creating ufuncs was not as convenient as that of Numeric. Consequently, it > was > going to be very difficult to convert the SciPy codebase to use numarray. > This > split fractured the community quite a bit: some people wrote code only for > numarray, seeing it as the next Numeric; some people wrote code for > Numeric, > because they needed SciPy. > > Travis Oliphant wanted to reunify the community around a single array > package. > He refactored Numeric's code to make it more maintainable (although > probably not > enough to get the whole thing into the standard library, more on that > later) and > flexible enough to implement the novel features of numarray. He named this > project "scipy core" and intended to use the package name "scipy". The > rest of > SciPy would simply add more modules to core SciPy package. Eventually, it > became > clear that people were mistakenly thinking that Numeric had been subsumed > into > SciPy and that they would have to install the whole of SciPy just to get > an > array object. > > We had a long discussion about what to name the package, and the winner > was numerix! > > Unfortunately, that name is trademarked by a company that does DSP. In > order to > avoid trademark infringement by ourselves and by our users, we needed > another > name. We picked numpy. > > Moral: Don't let your software project acquire nicknames! > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma > that is made terrible by our own mad attempt to interpret it as though it > had > an underlying truth." > -- Umberto Eco > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hetland at tamu.edu Wed May 3 13:32:31 2006 From: hetland at tamu.edu (Robert Hetland) Date: Wed, 3 May 2006 12:32:31 -0500 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: <91cf711d0605030904n2522098cr501cea2c9fb4640d@mail.gmail.com> References: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> <4458D1F3.2030806@gmail.com> <91cf711d0605030904n2522098cr501cea2c9fb4640d@mail.gmail.com> Message-ID: On May 3, 2006, at 11:04 AM, David Huard wrote: > > I'd like to put this historical note on the wiki. Any objections ? +1. Also, I would like an update on how far along numpy (or some subset) is in being included in the standard python codebase. A while ago, I thought it was going to maybe be put into 2.5. Is this still true, because I don't see much evidence for it in the python2.5 What's New documentation. If false, what are the present plans? -Rob. ----- Rob Hetland, Assistant Professor Dept of Oceanography, Texas A&M University p: 979-458-0096, f: 979-845-6331 e: hetland at tamu.edu, w: http://pong.tamu.edu From robert.kern at gmail.com Wed May 3 13:57:33 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 03 May 2006 12:57:33 -0500 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: References: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> <4458D1F3.2030806@gmail.com> <91cf711d0605030904n2522098cr501cea2c9fb4640d@mail.gmail.com> Message-ID: <4458EF0D.20609@gmail.com> Robert Hetland wrote: > On May 3, 2006, at 11:04 AM, David Huard wrote: > >>I'd like to put this historical note on the wiki. Any objections ? None from me. There are some gaps, of course, but maybe the Wiki magic will help fill them in. Also, reference should be made to the Introduction of _The Guide to NumPy_ which goes into some more detail on this subject. http://numeric.scipy.org/scipybooksample.pdf > Also, I would like an update on how far along numpy (or some subset) > is in being included in the standard python codebase. A while ago, I > thought it was going to maybe be put into 2.5. Is this still true, > because I don't see much evidence for it in the python2.5 What's New > documentation. If false, what are the present plans? It's definitely not going to happen in 2.5. I don't think numpy as a whole will ever go into the standard library. It's possible that an ndarray object and ufuncs and very little else might go into 3.0, but my crystal ball is cloudy at the moment. The most likely thing to happen is that Tim Hochberg's basearray or something like it will go into 2.6. Pre-3.0, the focus is going to be on spreading the use of the array interface rather than putting a whole array-handling package into the standard library. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From oliphant at ee.byu.edu Thu May 4 02:09:30 2006 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 04 May 2006 00:09:30 -0600 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: <4458EF0D.20609@gmail.com> References: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> <4458D1F3.2030806@gmail.com> <91cf711d0605030904n2522098cr501cea2c9fb4640d@mail.gmail.com> <4458EF0D.20609@gmail.com> Message-ID: <44599A9A.1050606@ee.byu.edu> Robert Kern wrote: >Robert Hetland wrote: > > >>On May 3, 2006, at 11:04 AM, David Huard wrote: >> >> >> >>>I'd like to put this historical note on the wiki. Any objections ? >>> >>> > >None from me. There are some gaps, of course, but maybe the Wiki magic will help >fill them in. Also, reference should be made to the Introduction of _The Guide >to NumPy_ which goes into some more detail on this subject. > > Robert gave a good start to the wiki. Somebody should copy his comments over. > http://numeric.scipy.org/scipybooksample.pdf > > > >>Also, I would like an update on how far along numpy (or some subset) >>is in being included in the standard python codebase. A while ago, I >>thought it was going to maybe be put into 2.5. Is this still true, >>because I don't see much evidence for it in the python2.5 What's New >>documentation. If false, what are the present plans? >> >> > >It's definitely not going to happen in 2.5. I don't think numpy as a whole will >ever go into the standard library. It's possible that an ndarray object and >ufuncs and very little else might go into 3.0, but my crystal ball is cloudy at >the moment. The most likely thing to happen is that Tim Hochberg's basearray or >something like it will go into 2.6. Pre-3.0, the focus is going to be on >spreading the use of the array interface rather than putting a whole >array-handling package into the standard library. > > > Again this is right on. If a student were to get funded by the Summer of Code project. I proposed a project and one student has expressed interest... If this is successful, perhaps the idea of a basearray object going into Python itself could actually get done by version 2.6. I've already got an outline for this thing (I've called it genarray, others dimarray). I like basearray best of all the names. For my outline, look at the PEP here: http://svn.scipy.org/svn/PEP From tim.leslie at gmail.com Thu May 4 02:24:42 2006 From: tim.leslie at gmail.com (Tim Leslie) Date: Thu, 4 May 2006 16:24:42 +1000 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: <44599A9A.1050606@ee.byu.edu> References: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> <4458D1F3.2030806@gmail.com> <91cf711d0605030904n2522098cr501cea2c9fb4640d@mail.gmail.com> <4458EF0D.20609@gmail.com> <44599A9A.1050606@ee.byu.edu> Message-ID: On 5/4/06, Travis Oliphant wrote: > > > Again this is right on. If a student were to get funded by the Summer > of Code project. I proposed a project and one student has expressed > interest... FWIW I'm also considering applying to work on a scipy project for SOC, pending a number of other things I'm considering for the next few months. Tim If this is successful, perhaps the idea of a basearray object going into > Python itself could actually get done by version 2.6. I've already > got an outline for this thing (I've called it genarray, others > dimarray). I like basearray best of all the names. > > For my outline, look at the PEP here: > > http://svn.scipy.org/svn/PEP > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Thu May 4 02:48:44 2006 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 04 May 2006 01:48:44 -0500 Subject: [SciPy-user] Clarification sought on various Python numerical packages In-Reply-To: References: <001d01c66ea9$97ea9760$0200a8c0@kookaburra> <4458D1F3.2030806@gmail.com> <91cf711d0605030904n2522098cr501cea2c9fb4640d@mail.gmail.com> <4458EF0D.20609@gmail.com> <44599A9A.1050606@ee.byu.edu> Message-ID: <4459A3CC.8020902@gmail.com> Tim Leslie wrote: > On 5/4/06, *Travis Oliphant* > wrote: > > Again this is right on. If a student were to get funded by the Summer > of Code project. I proposed a project and one student has expressed > interest... > > FWIW I'm also considering applying to work on a scipy project for SOC, > pending a number of other things I'm considering for the next few months. Consider fast. :-) The deadline for student applications is May 8th. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From nwagner at iam.uni-stuttgart.de Thu May 4 04:01:31 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Thu, 04 May 2006 10:01:31 +0200 Subject: [SciPy-user] LU factorization without pivoting in scipy ? Message-ID: <4459B4DB.1040309@iam.uni-stuttgart.de> Is there any function which computes the LU factorization w i t h o u t pivoting in scipy/numpy ? Nils From nwagner at iam.uni-stuttgart.de Thu May 4 07:04:17 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Thu, 04 May 2006 13:04:17 +0200 Subject: [SciPy-user] LU factorization without pivoting in scipy ? In-Reply-To: <4459B4DB.1040309@iam.uni-stuttgart.de> References: <4459B4DB.1040309@iam.uni-stuttgart.de> Message-ID: <4459DFB1.8000502@iam.uni-stuttgart.de> Nils Wagner wrote: > Is there any function which computes the LU factorization w i t h o u t > pivoting in scipy/numpy ? > > Nils > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > There is no routine in LAPACK to perform Gaussian elimination without pivoting on a general matrix. See http://icl.cs.utk.edu/lapack-forum/viewtopic.php?p=275&sid=75e9f8708556c95edb5269dd669e8275 This code is adapted from http://web.cecs.pdx.edu/~gerry/nmm/mfiles/linalg/luNopiv.m from scipy import * def lunopiv(A,ptol): m,n = shape(A) for i in arange(0,n): pivot = A[i,i] if abs(pivot) < ptol: print 'zero pivot encountered' break for k in arange(i+1,n): A[k,i] = A[k,i]/pivot A[k,i+1:n] = A[k,i+1:n] - A[k,i]*A[i,i+1:n] L = eye(n)+tril(A,-1) U = triu(A) return L,U # # Test example # C = 2*diag(ones(4,Float))-diag(ones(3,Float),-1)-diag(ones(3,Float),1) print C L_C,U_C = lunopiv(C,1.e-12) print dot(L_C,U_C) Nils From wegwerp at gmail.com Thu May 4 17:20:22 2006 From: wegwerp at gmail.com (weg werp) Date: Thu, 4 May 2006 23:20:22 +0200 Subject: [SciPy-user] newby: why the inconsistancy between zeros and randn? Message-ID: <6f54c160605041420y787c0edfme2f92ec2b6b06c50@mail.gmail.com> Hi group, as a long time matlab user I am used to do y=zeros(size(x)) y=ones(size(x)) which nicely translates into y=zeros(shape(x)) y=ones(shape(x)) However, this does not work for rand and randn, there I have to do y=randn(*shape(x)) because randn does not accept a shape tuple, but expects the dimensions as separate variables. Is there any reason for this? According to the docs, Matlab accepts both a size array or seperate dimensions. Would it also be possible to allow both forms in Numpy? (I guess that would violate some Zen rule, I don't know which one). If not, I think these similar functions should have the same signature. Cheers, Bas From robert.kern at gmail.com Thu May 4 17:28:51 2006 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 04 May 2006 16:28:51 -0500 Subject: [SciPy-user] newby: why the inconsistancy between zeros and randn? In-Reply-To: <6f54c160605041420y787c0edfme2f92ec2b6b06c50@mail.gmail.com> References: <6f54c160605041420y787c0edfme2f92ec2b6b06c50@mail.gmail.com> Message-ID: <445A7213.7040707@gmail.com> weg werp wrote: > Hi group, > > as a long time matlab user I am used to do > y=zeros(size(x)) > y=ones(size(x)) > which nicely translates into > y=zeros(shape(x)) > y=ones(shape(x)) > > However, this does not work for rand and randn, there I have to do > y=randn(*shape(x)) > because randn does not accept a shape tuple, but expects the > dimensions as separate variables. Is there any reason for this? The only reason that rand() and randn() exist is to present that different API. If you want to have an API that is (largely) consistent with zeros() and ones(), use the real functions numpy.random.random(shape(x)) and numpy.random.standard_normal(shape(x)). > According to the docs, Matlab accepts both a size array or seperate > dimensions. Would it also be possible to allow both forms in Numpy? (I > guess that would violate some Zen rule, I don't know which one). In the face of ambiguity, refuse the temptation to guess. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From karol.langner at kn.pl Thu May 4 17:30:10 2006 From: karol.langner at kn.pl (Karol Langner) Date: Thu, 4 May 2006 23:30:10 +0200 Subject: [SciPy-user] =?iso-8859-2?q?Clarification_sought_on_various_Pytho?= =?iso-8859-2?q?n=A0=A0=A0=A0=A0=A0=A0=A0numerical=A0=A0=A0=A0=A0?= =?iso-8859-2?q?=A0=A0packages?= Message-ID: <200605042330.10921.karol.langner@kn.pl> Dear Tim, I am the student that has expressed interest, and I've submitted an application for this the day before yesterday. Are you considering the same project (the N-D array interace) or something else regading scipy? In fact, the deadline is Mya 8th, so you must hurry if you want to get a chance to react to comments. Right now I am intensively researching the topic to enhance my application, after getting some SoC comments and feedback from numpy developers. Best, Karol -- written by Karol Langner czw maj 4 23:25:30 CEST 2006 From hetland at tamu.edu Thu May 4 18:28:45 2006 From: hetland at tamu.edu (Robert Hetland) Date: Thu, 4 May 2006 17:28:45 -0500 Subject: [SciPy-user] newby: why the inconsistancy between zeros and randn? In-Reply-To: <445A7213.7040707@gmail.com> References: <6f54c160605041420y787c0edfme2f92ec2b6b06c50@mail.gmail.com> <445A7213.7040707@gmail.com> Message-ID: On May 4, 2006, at 4:28 PM, Robert Kern wrote: > weg werp wrote: >> Hi group, >> >> as a long time matlab user I am used to do >> y=zeros(size(x)) >> y=ones(size(x)) >> which nicely translates into >> y=zeros(shape(x)) >> y=ones(shape(x)) >> >> However, this does not work for rand and randn, there I have to do >> y=randn(*shape(x)) >> because randn does not accept a shape tuple, but expects the >> dimensions as separate variables. Is there any reason for this? This has also bothered me for a while. > > The only reason that rand() and randn() exist is to present that > different API. > If you want to have an API that is (largely) consistent with zeros > () and ones(), > use the real functions numpy.random.random(shape(x)) and > numpy.random.standard_normal(shape(x)). Note that these functions are *not* imported by a 'from numpy import *' and are quite a ways down the namespace. > >> According to the docs, Matlab accepts both a size array or seperate >> dimensions. Would it also be possible to allow both forms in >> Numpy? (I >> guess that would violate some Zen rule, I don't know which one). > > In the face of ambiguity, refuse the temptation to guess. > I don't think it would be ambiguous for rand to accept both -- just flexible -- and it would be easy to implement. -Rob ----- Rob Hetland, Assistant Professor Dept of Oceanography, Texas A&M University p: 979-458-0096, f: 979-845-6331 e: hetland at tamu.edu, w: http://pong.tamu.edu From robert.kern at gmail.com Thu May 4 18:40:59 2006 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 04 May 2006 17:40:59 -0500 Subject: [SciPy-user] newby: why the inconsistancy between zeros and randn? In-Reply-To: References: <6f54c160605041420y787c0edfme2f92ec2b6b06c50@mail.gmail.com> <445A7213.7040707@gmail.com> Message-ID: <445A82FB.2040308@gmail.com> Robert Hetland wrote: > On May 4, 2006, at 4:28 PM, Robert Kern wrote: >>weg werp wrote: >>The only reason that rand() and randn() exist is to present that >>different API. >>If you want to have an API that is (largely) consistent with zeros >>() and ones(), >>use the real functions numpy.random.random(shape(x)) and >>numpy.random.standard_normal(shape(x)). > > Note that these functions are *not* imported by a 'from numpy import > *' and are quite a ways down the namespace. After a "from numpy import *" they are just random.random() and random.standard_normal(). They're not *that* far down. If I had my 'druthers, rand() and randn() wouldn't be exported to the top-level namespace either. >>>According to the docs, Matlab accepts both a size array or seperate >>>dimensions. Would it also be possible to allow both forms in >>>Numpy? (I >>>guess that would violate some Zen rule, I don't know which one). >> >>In the face of ambiguity, refuse the temptation to guess. > > I don't think it would be ambiguous for rand to accept both -- just > flexible -- and it would be easy to implement. It doesn't solve any problem. People *writing* code who want a consistent interface should just use random() and standard_normal(). People *reading* code who want a consistent interface will be even more confused when the same function is being called in multiple ways. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From robert.kern at gmail.com Thu May 4 18:55:50 2006 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 04 May 2006 17:55:50 -0500 Subject: [SciPy-user] Potential SoC project: black-box non-uniform random number generation Message-ID: <445A8676.5080108@gmail.com> A good number of the probability distributions in scipy.stats don't have fast random samplers. The default implementation of the .rvs() method uses the expensive and frequently inaccurate inversion method. However, there are "universal" sampling algorithms that operate on very broad classes of probability distributions. http://statistik.wu-wien.ac.at/projects/arvag/index.html I think that implementing several of these algorithms and integrating them into scipy.stats would make a tidy SoC project for a student. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From fullung at gmail.com Thu May 4 19:58:30 2006 From: fullung at gmail.com (Albert Strasheim) Date: Fri, 5 May 2006 01:58:30 +0200 Subject: [SciPy-user] Potential SoC project: black-box non-uniform randomnumber generation In-Reply-To: <445A8676.5080108@gmail.com> Message-ID: <002001c66fd6$a494d6a0$0a84a8c0@dsp.sun.ac.za> Hey Robert > -----Original Message----- > From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] > On Behalf Of Robert Kern > Sent: 05 May 2006 00:56 > To: SciPy Users List > Subject: [SciPy-user] Potential SoC project: black-box non-uniform > randomnumber generation > > A good number of the probability distributions in scipy.stats don't have > fast > random samplers. The default implementation of the .rvs() method uses the > expensive and frequently inaccurate inversion method. However, there are > "universal" sampling algorithms that operate on very broad classes of > probability distributions. > > http://statistik.wu-wien.ac.at/projects/arvag/index.html A good starting point might be the code in the GNU Scientific Library: http://www.gnu.org/software/gsl/manual/html_node/Random-Number-Distributions .html#Random-Number-Distributions I was actually wondering if it wouldn't make sense to integrate various parts of this library into SciPy via ctypes? GSL is licensed under the GPL, but the implications of this when using it via ctypes from Python aren't clear to me. Laywers? What do you think? Would this be useful? I'm actually pretty interested in integrating with various libraries via ctypes. I'm currently busy with libsvm, and I've been able to do some very cool things with ctypes which weren't easily doable with the original SWIG wrapper provided by the authors. Some minor additions to NumPy to help ctypes do its thing could making wrapping C libraries via ctypes a complete breeze. > I think that implementing several of these algorithms and integrating them > into > scipy.stats would make a tidy SoC project for a student. As for doing this as a SoC project, SciPy doesn't seem to be a registered as a mentoring organization. I think mentor applications have closed already, with student applications closing on Monday. Regards, Albert From robert.kern at gmail.com Thu May 4 20:15:46 2006 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 04 May 2006 19:15:46 -0500 Subject: [SciPy-user] Potential SoC project: black-box non-uniform randomnumber generation In-Reply-To: <002001c66fd6$a494d6a0$0a84a8c0@dsp.sun.ac.za> References: <002001c66fd6$a494d6a0$0a84a8c0@dsp.sun.ac.za> Message-ID: <445A9932.7050307@gmail.com> Albert Strasheim wrote: > A good starting point might be the code in the GNU Scientific Library: > > http://www.gnu.org/software/gsl/manual/html_node/Random-Number-Distributions > .html#Random-Number-Distributions Not really. These are specialized samplers, not universal ones. We already have most, if not all of them already implemented in numpy.random. > I was actually wondering if it wouldn't make sense to integrate various > parts of this library into SciPy via ctypes? GSL is licensed under the GPL, > but the implications of this when using it via ctypes from Python aren't > clear to me. Laywers? Using ctypes is just dynamic linking which the FSF considers to trigger the GPL clauses. Even if you could convince a judge to agree with you, it would be monstrously rude. scipy will not use the GSL. >>I think that implementing several of these algorithms and integrating them >>into >>scipy.stats would make a tidy SoC project for a student. > > As for doing this as a SoC project, SciPy doesn't seem to be a registered as > a mentoring organization. I think mentor applications have closed already, > with student applications closing on Monday. The PSF is handling Python-related applications including scipy projects. Student applications do close on Monday, but mentors can still sign up before May 22nd. However, mentors should sign up now so they can participate in the selection process. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From edin.salkovic at gmail.com Fri May 5 08:48:18 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Fri, 5 May 2006 14:48:18 +0200 Subject: [SciPy-user] SoC - pymulae Message-ID: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> Hi, all I've contacted Robert regarding google's summer of code, and he said that he would realy like someone implementing a Python library that can typeset math formulae using TeX algorithms. I supplied an application for it, and I would realy welcome some suggestions etc. regarding what should I concetrate on etc. From klemm at phys.ethz.ch Fri May 5 08:56:21 2006 From: klemm at phys.ethz.ch (Hanno Klemm) Date: Fri, 05 May 2006 14:56:21 +0200 Subject: [SciPy-user] Matrix-vector multiplication Message-ID: Hi there, I'm sorry this might be quite a newbie question but I haven't found the answer on the web. I have to multiply relatively large matrices (roughly 1000x1000) with vectors many times. What is the speed-optimised way to do this in SciPy/NumPy? At the moment I simply use dot(Matrix, vector) from numpy. Is there a faster method, maybe using some of the blas library stuff, or is that already used under the hood? Hanno -- Hanno Klemm klemm at phys.ethz.ch From david.huard at gmail.com Fri May 5 09:50:39 2006 From: david.huard at gmail.com (David Huard) Date: Fri, 5 May 2006 09:50:39 -0400 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> Message-ID: <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> Will this be used to parse docstrings ? If that's the case, it would be great if it could define a docstring template and process it accordingly: class/function/method definition (what is does) usage (how its called) parameters definitions and defaults attributes/objects methods references version author (contact) There could be some options to display only the definition and usage or the whole thing with references and version number. Is this project related to or drawing from PyTeX ? Best of luck with your project, I'm really looking forward to use it. David 2006/5/5, Edin Salkovi? : > > Hi, all > > I've contacted Robert regarding google's summer of code, and he said > that he would realy like someone implementing a Python library that > can typeset math formulae using TeX algorithms. > > I supplied an application for it, and I would realy welcome some > suggestions etc. regarding what should I concetrate on etc. > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aisaac at american.edu Fri May 5 10:24:06 2006 From: aisaac at american.edu (Alan Isaac) Date: Fri, 5 May 2006 10:24:06 -0400 (EDT) Subject: [SciPy-user] SoC - pymulae In-Reply-To: <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com><91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> Message-ID: On Fri, 5 May 2006, David Huard wrote: > Will this be used to parse docstrings ? > If that's the case, it would be great if it could define a docstring template and process it accordingly: > class/function/method definition (what is does) > usage (how its called) > parameters definitions and defaults > attributes/objects > methods > references > version > author (contact) In this context, it will be useful to look at epydoc and the various math support implementation in reStructuredText (especially the contribution by jjens in the sandbox). Cheers, Alan Isaac From aisaac at american.edu Fri May 5 10:21:57 2006 From: aisaac at american.edu (Alan Isaac) Date: Fri, 5 May 2006 10:21:57 -0400 (EDT) Subject: [SciPy-user] SoC - pymulae In-Reply-To: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> Message-ID: On Fri, 5 May 2006, Edin Salkovi? wrote: > ... implementing a Python library that can typeset math > formulae using TeX algorithms. > I supplied an application for it, and I would realy welcome some > suggestions etc. regarding what should I concetrate on etc. I'm not sure what you have in mind here. But pushing PyTeX forward would be awesome. http://www.pytex.org/ hth, Alan Isaac From robert.kern at gmail.com Fri May 5 12:23:15 2006 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 05 May 2006 11:23:15 -0500 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> Message-ID: <445B7BF3.6000706@gmail.com> David Huard wrote: > Will this be used to parse docstrings ? No. It could be used by docstring parsers to render formulae that they encounter, though. > Is this project related to or drawing from PyTeX ? No, the point of the project is to be able to typeset math formulae using TeX font metrics and TeX algorithms without needing a TeX installation. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From cookedm at physics.mcmaster.ca Fri May 5 15:45:04 2006 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Fri, 05 May 2006 15:45:04 -0400 Subject: [SciPy-user] Matrix-vector multiplication In-Reply-To: (Hanno Klemm's message of "Fri, 05 May 2006 14:56:21 +0200") References: Message-ID: "Hanno Klemm" writes: > Hi there, > > I'm sorry this might be quite a newbie question but I haven't found > the answer on the web. I have to multiply relatively large matrices > (roughly 1000x1000) with vectors many times. What is the > speed-optimised way to do this in SciPy/NumPy? > > At the moment I simply use dot(Matrix, vector) from numpy. Is there a > faster method, maybe using some of the blas library stuff, or is that > already used under the hood? It's already used under the hood. It'll call the appropiate ?gemv routine found in the BLAS that numpy was compiled with (probably ATLAS). -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From aisaac at american.edu Fri May 5 17:58:10 2006 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 5 May 2006 17:58:10 -0400 Subject: [SciPy-user] typeset math Message-ID: >David Huard wrote: >> Will this be used to parse docstrings ? Robert Kern said: >No. It could be used by docstring parsers to render formulae that they >encounter, though. >David Huard wrote: >> Is this project related to or drawing from PyTeX ? Robert Kern said: > No, the point of the project is to be able to typeset math > formulae using TeX font metrics and TeX algorithms without > needing a TeX installation. OK, the meaning of "typeset" is a bit obscure to me here. I will assume this means: can I go from docstrings including math formulae to PDF without using TeX. Assume the math formulae are in LaTeX format, designated clearly. One path: reStructedText doc strings -> XHTML+MathML -> PDF Mostly reuse existing tools. http://svn.berlios.de/viewcvs/docutils/trunk/sandbox/jensj/latex_math/ Another path: reStructedText doc strings -> AbiWord XML -> PDF (AbiWord already has good LaTeX -> MathML conversion, but it needs improvement.) If you do not wish to go via TeX, is there an obvious (feasible) alternative to going via MathML? Cheers, Alan Isaac From robert.kern at gmail.com Fri May 5 18:09:07 2006 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 05 May 2006 17:09:07 -0500 Subject: [SciPy-user] typeset math In-Reply-To: References: Message-ID: <445BCD03.9040408@gmail.com> Alan G Isaac wrote: > Robert Kern said: > >>No, the point of the project is to be able to typeset math >>formulae using TeX font metrics and TeX algorithms without >>needing a TeX installation. > > OK, the meaning of "typeset" is a bit obscure to me here. > I will assume this means: can I go from docstrings including > math formulae to PDF without using TeX. It means going from a string 'x + \sqrt y = z' to a Python object that can tell renderers (other Python objects conforming to an abstract interface) where to place glyphs on a canvas. No specific formats. No chains of external processes. No parsing the output of some other processor. No distributional nightmares. > Assume the math formulae are in LaTeX format, > designated clearly. Extracting equations from the rest of document and then communicating the rendered formula back to be placed in the rest of the processed output is out of scope for this project. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From karol.langner at kn.pl Fri May 5 18:35:28 2006 From: karol.langner at kn.pl (Karol Langner) Date: Sat, 6 May 2006 00:35:28 +0200 Subject: [SciPy-user] SoC - Base ND array type Message-ID: <200605060035.28505.karol.langner@kn.pl> Dear all, I have submitted an application to SoC for the proposal on a base multidimensional array type. After getting some comments and reading a bit more, I've made my first revision. I hope this version is a better outlook. The full text can be found here temporarily: http://www.mml.ch.pwr.wroc.pl/langner/SoC-NDarray.txt I'm sending this also to the scipy list, as there are some SoC-related discussions there. Those interested please do comment! Thanks in advance, Karol Langner -- written by Karol Langner sob maj 6 00:28:29 CEST 2006 From fperez.net at gmail.com Fri May 5 19:28:48 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 5 May 2006 17:28:48 -0600 Subject: [SciPy-user] typeset math In-Reply-To: <445BCD03.9040408@gmail.com> References: <445BCD03.9040408@gmail.com> Message-ID: On 5/5/06, Robert Kern wrote: > It means going from a string 'x + \sqrt y = z' to a Python object that can tell > renderers (other Python objects conforming to an abstract interface) where to > place glyphs on a canvas. No specific formats. No chains of external processes. > No parsing the output of some other processor. No distributional nightmares. Just to add some context for the benefit of the OP (Robert, correct me if I'm misinterpreting your intent), the mathtext mode in matplotlib provides a crude implementation of this idea. I don't think it conform to an abstract interface, as I think it is somewhat hardcoded inside matplotlib, but perhaps looking at it can give you some ideas. Regards, f From gruben at bigpond.net.au Fri May 5 20:20:57 2006 From: gruben at bigpond.net.au (Gary Ruben) Date: Sat, 06 May 2006 10:20:57 +1000 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <445B7BF3.6000706@gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> Message-ID: <445BEBE9.9040107@bigpond.net.au> Are you talking about something like the mathtext capability of matplotlib? If so, this might be a good starting point. Mathtext has some limitations which it would be nice to remove, like no support for frac{}{}. Even if you're talking about something different, John Hunter put a lot of work into this and would be good to consult to find out what the pitfalls are. Also, what would you be rendering into? eps, pdf, svg, png? It might even be possible to separate out the mathtext part of matplotlib, turn it into a separate usable module and incorporate this back into matplotlib. Gary R. Robert Kern wrote: > David Huard wrote: >> Will this be used to parse docstrings ? > > No. It could be used by docstring parsers to render formulae that they > encounter, though. > >> Is this project related to or drawing from PyTeX ? > > No, the point of the project is to be able to typeset math formulae using TeX > font metrics and TeX algorithms without needing a TeX installation. From gruben at bigpond.net.au Fri May 5 20:27:44 2006 From: gruben at bigpond.net.au (Gary Ruben) Date: Sat, 06 May 2006 10:27:44 +1000 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <445BEBE9.9040107@bigpond.net.au> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> Message-ID: <445BED80.3050000@bigpond.net.au> I just notice Fernando's earlier reply to this in the other thread. From lanceboyle at qwest.net Fri May 5 20:27:20 2006 From: lanceboyle at qwest.net (lanceboyle at qwest.net) Date: Fri, 5 May 2006 17:27:20 -0700 Subject: [SciPy-user] SoC - pymulae Now OT In-Reply-To: <445BEBE9.9040107@bigpond.net.au> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> Message-ID: Sorry for the intrusion, but maybe someone here knows the answer to this. What math markup language does the U.S. Patent Office use? Jerry On May 5, 2006, at 5:20 PM, Gary Ruben wrote: > Are you talking about something like the mathtext capability of > matplotlib? > > If so, this might be a good starting point. Mathtext has some > limitations which it would be nice to remove, like no support for > frac{}{}. Even if you're talking about something different, John > Hunter > put a lot of work into this and would be good to consult to find out > what the pitfalls are. Also, what would you be rendering into? eps, > pdf, > svg, png? It might even be possible to separate out the mathtext > part of > matplotlib, turn it into a separate usable module and incorporate this > back into matplotlib. > > Gary R. > > Robert Kern wrote: >> David Huard wrote: >>> Will this be used to parse docstrings ? >> >> No. It could be used by docstring parsers to render formulae that >> they >> encounter, though. >> >>> Is this project related to or drawing from PyTeX ? >> >> No, the point of the project is to be able to typeset math >> formulae using TeX >> font metrics and TeX algorithms without needing a TeX installation. > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From fperez.net at gmail.com Fri May 5 23:45:52 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 5 May 2006 21:45:52 -0600 Subject: [SciPy-user] typeset math In-Reply-To: References: <445BCD03.9040408@gmail.com> Message-ID: On 5/5/06, Fernando Perez wrote: > Just to add some context for the benefit of the OP (Robert, correct me > if I'm misinterpreting your intent), the mathtext mode in matplotlib > provides a crude implementation of this idea. And just to do justice to John, by 'crude' I only mean in comparison to the final output of the real Latex. I was amazed that John got this to work at all, given how tricky the problem can be and how he was also developing the rest of mpl at the same time. So by all means, if you intend to work on this, I think the mathtext code in mpl should be your first stop. Cheers, f From edin.salkovic at gmail.com Sat May 6 06:05:50 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Sat, 6 May 2006 12:05:50 +0200 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <445BED80.3050000@bigpond.net.au> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> <445BED80.3050000@bigpond.net.au> Message-ID: <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> Thanks for the feedback! I'm now refining my application for SoC. Regardless of it being accepted or not I'll work on pymulae - anyone having a better name? formulpy? It will be along the lines of what Robert suggested. From dd55 at cornell.edu Sat May 6 09:31:35 2006 From: dd55 at cornell.edu (Darren Dale) Date: Sat, 6 May 2006 09:31:35 -0400 Subject: [SciPy-user] typeset math In-Reply-To: References: Message-ID: <200605060931.35530.dd55@cornell.edu> On Friday 05 May 2006 11:45 pm, Fernando Perez wrote: > On 5/5/06, Fernando Perez wrote: > > Just to add some context for the benefit of the OP (Robert, correct me > > if I'm misinterpreting your intent), the mathtext mode in matplotlib > > provides a crude implementation of this idea. > > And just to do justice to John, by 'crude' I only mean in comparison > to the final output of the real Latex. I was amazed that John got > this to work at all, given how tricky the problem can be and how he > was also developing the rest of mpl at the same time. So by all > means, if you intend to work on this, I think the mathtext code in mpl > should be your first stop. I would also be very excited to see someone take up this project. Matplotlib could make very good use of such a library. My own time is overbooked these days, but I ordered used copies of Computers and Typesetting, Volumes A and B (B is the one about tex algorithms) from Amazon. It would be nice to work out the existing bugs in mpl's mathtext module. Darren From jdhunter at ace.bsd.uchicago.edu Sat May 6 10:19:51 2006 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Sat, 06 May 2006 09:19:51 -0500 Subject: [SciPy-user] typeset math In-Reply-To: ("Fernando Perez"'s message of "Fri, 5 May 2006 17:28:48 -0600") References: <445BCD03.9040408@gmail.com> Message-ID: <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Fernando" == Fernando Perez writes: Fernando> I don't think it conform to an abstract interface, as I Fernando> think it is somewhat hardcoded inside matplotlib, but Fernando> perhaps looking at it can give you some ideas. It only needs a little bit of matplotlib. Most of the matplotlib imports in matplotlib.mathtext are simple helper functions and could be factored out in about 30 minutes if it would be useful. The only significant piece that it depends on is the matplotlib freetype modules ft2font and afm, and these are in some sense optional since their use is totally encapsulated by the Font interface. The Font class has to be able to provide the glyph metric and kerning info, and importantly, must implement a render method to draw a glyph at a given place. The ps font classes do this by writing to a string, and the truetype font classes write to a bitmap. But the font classes don't need to know anything about math and the math classes don't need to know anything about the underlying font libraries. The only substantive dependency is pyparsing, which is a single file pure python module. I really like Robert's idea of solving the problem "once and for all" but it might be an insurmountable task unless someone like Robert spends a year doing it. I spent about 4 weeks on mathtext, and I think it could be substantially improved with another concerted effort. JDH From dd55 at cornell.edu Sat May 6 11:07:47 2006 From: dd55 at cornell.edu (Darren Dale) Date: Sat, 6 May 2006 11:07:47 -0400 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <445BED80.3050000@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> Message-ID: <200605061107.47832.dd55@cornell.edu> On Saturday 06 May 2006 6:05 am, Edin Salkovi? wrote: > Thanks for the feedback! > > I'm now refining my application for SoC. Regardless of it being > accepted or not I'll work on pymulae - anyone having a better name? > formulpy? How about tex4py? From robert.kern at gmail.com Sat May 6 15:30:39 2006 From: robert.kern at gmail.com (Robert Kern) Date: Sat, 06 May 2006 14:30:39 -0500 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <200605061107.47832.dd55@cornell.edu> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <445BED80.3050000@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> <200605061107.47832.dd55@cornell.edu> Message-ID: <445CF95F.9060000@gmail.com> Darren Dale wrote: > On Saturday 06 May 2006 6:05 am, Edin Salkovi? wrote: > >>Thanks for the feedback! >> >>I'm now refining my application for SoC. Regardless of it being >>accepted or not I'll work on pymulae - anyone having a better name? >>formulpy? > > How about tex4py? It promises too much, I think. I keep thinking that good names for a typographical project would be "typical" or "typo", but those Google poorly. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From travis at enthought.com Sat May 6 17:11:59 2006 From: travis at enthought.com (Travis N. Vaught) Date: Sat, 06 May 2006 16:11:59 -0500 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <445CF95F.9060000@gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <445BED80.3050000@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> <200605061107.47832.dd55@cornell.edu> <445CF95F.9060000@gmail.com> Message-ID: <445D111F.7020901@enthought.com> Robert Kern wrote: > Darren Dale wrote: > >> On Saturday 06 May 2006 6:05 am, Edin Salkovi? wrote: >> >> >>> Thanks for the feedback! >>> >>> I'm now refining my application for SoC. Regardless of it being >>> accepted or not I'll work on pymulae - anyone having a better name? >>> formulpy? >>> >> How about tex4py? >> > > It promises too much, I think. > > I keep thinking that good names for a typographical project would be "typical" > or "typo", but those Google poorly. > typy, or tython perhaps From karol.langner at kn.pl Sat May 6 17:20:10 2006 From: karol.langner at kn.pl (Karol Langner) Date: Sat, 6 May 2006 23:20:10 +0200 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <445D111F.7020901@enthought.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <445CF95F.9060000@gmail.com> <445D111F.7020901@enthought.com> Message-ID: <200605062320.11432.karol.langner@kn.pl> On Saturday 06 May 2006 23:11, Travis N. Vaught wrote: > Robert Kern wrote: > > Darren Dale wrote: > >> On Saturday 06 May 2006 6:05 am, Edin Salkovi? wrote: > >>> Thanks for the feedback! > >>> > >>> I'm now refining my application for SoC. Regardless of it being > >>> accepted or not I'll work on pymulae - anyone having a better name? > >>> formulpy? pythex -- written by Karol Langner sob maj 6 23:19:34 CEST 2006 From dd55 at cornell.edu Sat May 6 17:51:20 2006 From: dd55 at cornell.edu (Darren Dale) Date: Sat, 6 May 2006 17:51:20 -0400 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <445CF95F.9060000@gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <200605061107.47832.dd55@cornell.edu> <445CF95F.9060000@gmail.com> Message-ID: <200605061751.20969.dd55@cornell.edu> On Saturday 06 May 2006 3:30 pm, Robert Kern wrote: > Darren Dale wrote: > > On Saturday 06 May 2006 6:05 am, Edin Salkovi? wrote: > >>Thanks for the feedback! > >> > >>I'm now refining my application for SoC. Regardless of it being > >>accepted or not I'll work on pymulae - anyone having a better name? > >>formulpy? > > > > How about tex4py? > > It promises too much, I think. > > I keep thinking that good names for a typographical project would be > "typical" or "typo", but those Google poorly. How about typescrypt? From ryanlists at gmail.com Sat May 6 18:48:01 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Sat, 6 May 2006 18:48:01 -0400 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <200605061751.20969.dd55@cornell.edu> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <200605061107.47832.dd55@cornell.edu> <445CF95F.9060000@gmail.com> <200605061751.20969.dd55@cornell.edu> Message-ID: I just figured out what pymulae is supposed to be. It is kind of cool, but a bit obscure as a name. What about formu-py? On 5/6/06, Darren Dale wrote: > On Saturday 06 May 2006 3:30 pm, Robert Kern wrote: > > Darren Dale wrote: > > > On Saturday 06 May 2006 6:05 am, Edin Salkovi? wrote: > > >>Thanks for the feedback! > > >> > > >>I'm now refining my application for SoC. Regardless of it being > > >>accepted or not I'll work on pymulae - anyone having a better name? > > >>formulpy? > > > > > > How about tex4py? > > > > It promises too much, I think. > > > > I keep thinking that good names for a typographical project would be > > "typical" or "typo", but those Google poorly. > > How about typescrypt? > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From edin.salkovic at gmail.com Mon May 8 04:54:17 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Mon, 8 May 2006 10:54:17 +0200 Subject: [SciPy-user] typeset math In-Reply-To: <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> References: <445BCD03.9040408@gmail.com> <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> Thanks a lot! I spent a bit reading something that Robert pointed me at: http://rw4.cs.uni-sb.de/~heckmann/abstracts/neuform-review.html (very helpful) and this morning I installed matplotlib and gave it try. Then I saw (literally) what John has managed to do - it's just great. I deffinitely don't want to reinvent the wheel, but I realy think that this stuff should be put in a separate library so: 1) other projects can use it (if they want to). 2) it can be easy for others to use it (see 1) 3) John can use it :) without having to develop and maintain it 4) other developers can join the project more easily As for 2) i had to download Python, matplotlib, and then Numeric, the old Numeric, although wherever I went everybody was screaming numpy! numpy!. So the only real problem is the dependency on Numeric. However, aside from that, everything seems to be working pretty nicely. SVG/PS/PNG outputs look great. I just had to install ttf CM fonts for displaying the SVG file in inkscape, but that's normal, at least under windows. From edin.salkovic at gmail.com Mon May 8 05:00:03 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Mon, 8 May 2006 11:00:03 +0200 Subject: [SciPy-user] SoC - pymulae In-Reply-To: References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <200605061107.47832.dd55@cornell.edu> <445CF95F.9060000@gmail.com> <200605061751.20969.dd55@cornell.edu> Message-ID: <63eb7fa90605080200v364679c7rb1c8ca52d9edadf0@mail.gmail.com> Wow! It's very hard to find a suitable name - one that googles nicely, and sounds nicely. I was thinking about pypeset. It googles flawlessly + sounds nicely (at least to me :) From robert.kern at gmail.com Mon May 8 05:04:06 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 08 May 2006 04:04:06 -0500 Subject: [SciPy-user] typeset math In-Reply-To: <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> References: <445BCD03.9040408@gmail.com> <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> Message-ID: <445F0986.8030309@gmail.com> Edin Salkovi? wrote: > Thanks a lot! > > I spent a bit reading something that Robert pointed me at: > http://rw4.cs.uni-sb.de/~heckmann/abstracts/neuform-review.html (very helpful) > and this morning I installed matplotlib and gave it try. > > Then I saw (literally) what John has managed to do - it's just great. > I deffinitely don't want to reinvent the wheel, but I realy think that > this stuff should be put in a separate library so: > 1) other projects can use it (if they want to). See, John! I told you! :-) > 2) it can be easy for others to use it (see 1) > 3) John can use it :) without having to develop and maintain it > 4) other developers can join the project more easily > > As for 2) i had to download Python, matplotlib, and then Numeric, the > old Numeric, although wherever I went everybody was screaming numpy! > numpy!. So the only real problem is the dependency on Numeric. Recent matplotlibs should be able to work with numpy (and only numpy) fine. You may have to edit the "numerix" variable in your matplotlibrc file to say "numpy" instead of "Numeric". -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From arnd.baecker at web.de Mon May 8 05:20:34 2006 From: arnd.baecker at web.de (Arnd Baecker) Date: Mon, 8 May 2006 11:20:34 +0200 (CEST) Subject: [SciPy-user] SoC - pymulae In-Reply-To: <63eb7fa90605080200v364679c7rb1c8ca52d9edadf0@mail.gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <200605061107.47832.dd55@cornell.edu> <445CF95F.9060000@gmail.com> <63eb7fa90605080200v364679c7rb1c8ca52d9edadf0@mail.gmail.com> Message-ID: On Mon, 8 May 2006, [UTF-8] Edin Salkovi?^G wrote: > Wow! It's very hard to find a suitable name - one that googles nicely, > and sounds nicely. I was thinking about pypeset. It googles flawlessly > + sounds nicely (at least to me :) For this name I would have no idea what this code would be doing ;-) Do you have a link to a more detailed description of the aims of the project - maybe some of the keywords would be useable to construct a good name. If I understood things correctly it is about typesetting LaTeX/TeX formulae using pure python (i.e. without latex/tex in the background, like http://www.pytex.org/ and http://pyx.sourceforge.net/), but still of the same quality? Another suggestion pyformula ? Best, Arnd P.S.: Just as a comment - this group loves rounds of name finding ;-), though the epic numeric/numarray/scipy/core/numerix/numpy will be hard to beat: http://www.physik.tu-dresden.de/~baecker/talks/pyco/pyco_.html#numeric-numarray-scipy-core-scipy-numpy From edin.salkovic at gmail.com Mon May 8 07:11:38 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Mon, 8 May 2006 13:11:38 +0200 Subject: [SciPy-user] matplotlib problem on windows Message-ID: <63eb7fa90605080411j31437c5qf2392c10e46861cb@mail.gmail.com> > Recent matplotlibs should be able to work with numpy (and only numpy) fine. You > may have to edit the "numerix" variable in your matplotlibrc file to say "numpy" > instead of "Numeric". Weird. I am using a windows machine at the moment with the newest versions of python 2.4, numpy, matplotlib (binary installers). When I changed (actually created, because the installation doesn't create it by default) the matplotlibrc file, it started complaining about some gtk stuff: from pylab import * --------------------------------------------------------------------------- exceptions.ImportError Traceback (most recent call last) C:\Documents and Settings\edin\ C:\Python24\Lib\site-packages\pylab.py ----> 1 from matplotlib.pylab import * C:\Python24\Lib\site-packages\matplotlib\pylab.py 199 200 from axes import Axes, PolarAxes --> 201 import backends 202 from cbook import flatten, is_string_like, exception_to_str, popd, \ 203 silent_list, iterable, enumerate C:\Python24\Lib\site-packages\matplotlib\backends\__init__.py 52 # a hack to keep old versions of ipython working with mpl after bug 53 # fix #1209354 54 if 'IPython.Shell' in sys.modules: ---> 55 new_figure_manager, draw_if_interactive, show = pylab_setup() 56 C:\Python24\Lib\site-packages\matplotlib\backends\__init__.py in pylab_setup() 21 backend_name = 'backend_'+backend.lower() 22 backend_mod = __import__('matplotlib.backends.'+backend_name, ---> 23 globals(),locals(),[backend_name]) 24 25 # Things we pull in from all backends C:\Python24\Lib\site-packages\matplotlib\backends\backend_gtk.py 4 def fn_name(): return sys._getframe(1).f_code.co_name 5 ----> 6 import gobject 7 import gtk; gdk = gtk.gdk 8 import pango ImportError: No module named gobject When I install Numeric (i also had to remove matplotlibrc) everything is fine. From robert.kern at gmail.com Mon May 8 07:32:09 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 08 May 2006 06:32:09 -0500 Subject: [SciPy-user] matplotlib problem on windows In-Reply-To: <63eb7fa90605080411j31437c5qf2392c10e46861cb@mail.gmail.com> References: <63eb7fa90605080411j31437c5qf2392c10e46861cb@mail.gmail.com> Message-ID: <445F2C39.9090708@gmail.com> Edin Salkovi? wrote: >>Recent matplotlibs should be able to work with numpy (and only numpy) fine. You >>may have to edit the "numerix" variable in your matplotlibrc file to say "numpy" >>instead of "Numeric". > > Weird. I am using a windows machine at the moment with the newest > versions of python 2.4, numpy, matplotlib (binary installers). When I > changed (actually created, because the installation doesn't create it > by default) the matplotlibrc file, it started complaining about some > gtk stuff: > > from pylab import * > When I install Numeric (i also had to remove matplotlibrc) everything is fine. When you create the matplotlibrc, it has to be a full matplotlibrc. Copy the one inside the package over and make sure that the "backend" variable is also set appropriately for your setup. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From aisaac at american.edu Mon May 8 08:08:42 2006 From: aisaac at american.edu (Alan G Isaac) Date: Mon, 8 May 2006 08:08:42 -0400 Subject: [SciPy-user] SoC - pymulae In-Reply-To: References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com><200605061107.47832.dd55@cornell.edu> <445CF95F.9060000@gmail.com><63eb7fa90605080200v364679c7rb1c8ca52d9edadf0@mail.gmail.com> Message-ID: tex2paint my favorite tex2painter drawtex slightly used (discontinuted project) texdraw fwiw, Alan Isaac From wegwerp at gmail.com Mon May 8 13:06:59 2006 From: wegwerp at gmail.com (weg werp) Date: Mon, 8 May 2006 19:06:59 +0200 Subject: [SciPy-user] Numerical Math consortium Message-ID: <6f54c160605081006l759664fam70a4b439cb2a2eec@mail.gmail.com> Hi group, I came across a link to the numerical math consortium (http://www.nmconsortium.org/) while browsing the site of SciLab. Other members represent Maple, MathCad and LabView (Matlab is clearly missing). Apparently they are trying to standardize on some core set of numerical algorithms. Current status looks like vaporware, but mightbe this is something for Scipy to join / observe in future? I guess most of the functionally is already there via things like Lapack, but mightbe this is an opportunity to prevent numerical pitfalls for rarely used functions by using standard algorithms...... Cheers, Bas From klemm at phys.ethz.ch Mon May 8 13:22:53 2006 From: klemm at phys.ethz.ch (Hanno Klemm) Date: Mon, 08 May 2006 19:22:53 +0200 Subject: [SciPy-user] Scipy Segmentation Fault Message-ID: Hi there, I try to install scipy-0.4.8 together with numpy-0.9.6 and Python 2.4.3 and atlas and blas support. The installation seems to be going fine. scipy.test(level=1, verbosity=10) however results in: .. check_x_bad_size (scipy.linalg.tests.test_fblas.test_zscal)zscal:n=4 ... ok check_x_stride (scipy.linalg.tests.test_fblas.test_zscal) ... ok check_simple (scipy.linalg.tests.test_fblas.test_zswap) ... ok check_x_and_y_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok check_x_bad_size (scipy.linalg.tests.test_fblas.test_zswap)zswap:n=4 ... ok check_x_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok check_y_bad_size (scipy.linalg.tests.test_fblas.test_zswap)zswap:n=3 ... ok check_y_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok affine_transform 1 ... FAIL affine transform 2 ... FAIL affine transform 3 ... FAIL affine transform 4 ... FAIL affine transform 5Segmentation fault I don't have any idea what I'm doing wrong. Any hints? Hanno -- Hanno Klemm klemm at phys.ethz.ch From oliphant.travis at ieee.org Mon May 8 13:43:32 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Mon, 08 May 2006 11:43:32 -0600 Subject: [SciPy-user] Scipy Segmentation Fault In-Reply-To: References: Message-ID: <445F8344.60105@ieee.org> Hanno Klemm wrote: > Hi there, > > I try to install scipy-0.4.8 together with numpy-0.9.6 and Python > 2.4.3 and atlas and blas support. The installation seems to be going > fine. > > scipy.test(level=1, verbosity=10) > > however results in: > > .. > check_x_bad_size (scipy.linalg.tests.test_fblas.test_zscal)zscal:n=4 > ... ok > check_x_stride (scipy.linalg.tests.test_fblas.test_zscal) ... ok > check_simple (scipy.linalg.tests.test_fblas.test_zswap) ... ok > check_x_and_y_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok > check_x_bad_size (scipy.linalg.tests.test_fblas.test_zswap)zswap:n=4 > ... ok > check_x_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok > check_y_bad_size (scipy.linalg.tests.test_fblas.test_zswap)zswap:n=3 > ... ok > check_y_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok > affine_transform 1 ... FAIL > affine transform 2 ... FAIL > affine transform 3 ... FAIL > affine transform 4 ... FAIL > affine transform 5Segmentation fault > > I don't have any idea what I'm doing wrong. > > Are you on a 64-bit machine? This looks like the problem with ndimage on 64-bit machines. -Travis From klemm at phys.ethz.ch Mon May 8 13:47:09 2006 From: klemm at phys.ethz.ch (Hanno Klemm) Date: Mon, 08 May 2006 19:47:09 +0200 Subject: [SciPy-user] Scipy Segmentation Fault In-Reply-To: <445F8344.60105@ieee.org> References: , Message-ID: Yes, that is right. I am on a 64bit machine. More precisely an Intel Xeon with two processors. Hanno Travis Oliphant said: > Hanno Klemm wrote: > > Hi there, > > > > I try to install scipy-0.4.8 together with numpy-0.9.6 and Python > > 2.4.3 and atlas and blas support. The installation seems to be going > > fine. > > > > scipy.test(level=1, verbosity=10) > > > > however results in: > > > > .. > > check_x_bad_size (scipy.linalg.tests.test_fblas.test_zscal)zscal:n=4 > > ... ok > > check_x_stride (scipy.linalg.tests.test_fblas.test_zscal) ... ok > > check_simple (scipy.linalg.tests.test_fblas.test_zswap) ... ok > > check_x_and_y_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok > > check_x_bad_size (scipy.linalg.tests.test_fblas.test_zswap)zswap:n=4 > > ... ok > > check_x_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok > > check_y_bad_size (scipy.linalg.tests.test_fblas.test_zswap)zswap:n=3 > > ... ok > > check_y_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok > > affine_transform 1 ... FAIL > > affine transform 2 ... FAIL > > affine transform 3 ... FAIL > > affine transform 4 ... FAIL > > affine transform 5Segmentation fault > > > > I don't have any idea what I'm doing wrong. > > > > > > Are you on a 64-bit machine? This looks like the problem with ndimage > on 64-bit machines. > > -Travis > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -- Hanno Klemm klemm at phys.ethz.ch From klemm at phys.ethz.ch Mon May 8 14:15:44 2006 From: klemm at phys.ethz.ch (Hanno Klemm) Date: Mon, 08 May 2006 20:15:44 +0200 Subject: [SciPy-user] Scipy Segmentation Fault In-Reply-To: <445F8344.60105@ieee.org> References: , Message-ID: Travis, thanks for pointing that out to me, commenting out ndimage in setup.py did the trick. However now I experience another problem. I have repeated the compile and the installation and now scipy.test(level=1, verbosity =10) results in ====================================================================== FAIL: check_simple (scipy.linalg.tests.test_decomp.test_eig) ---------------------------------------------------------------------- Traceback (most recent call last): File "/scratch/python2.4/lib/python2.4/site-packages/scipy/linalg/tests/test_decomp.py", line 89, in check_simple assert_array_almost_equal(w,exact_w) File "/scratch/python2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 231, in assert_array_almost_equal assert cond,\ AssertionError: Arrays are not almost equal (mismatch 66.6666666667%): Array 1: [ 9.4371906+0.j -0.1153653+0.j -0.3218254+0.j] Array 2: [ 9.3218254 0. -0.3218254] ====================================================================== FAIL: check_simple (scipy.linalg.tests.test_decomp.test_eigvals) ---------------------------------------------------------------------- Traceback (most recent call last): File "/scratch/python2.4/lib/python2.4/site-packages/scipy/linalg/tests/test_decomp.py", line 37, in check_simple assert_array_almost_equal(w,exact_w) File "/scratch/python2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 231, in assert_array_almost_equal assert cond,\ AssertionError: Arrays are not almost equal (mismatch 66.6666666667%): Array 1: [ 9.4371906+0.j -0.1153653+0.j -0.3218254+0.j] Array 2: [ 9.3218254 0. -0.3218254] ====================================================================== FAIL: check_simple_tr (scipy.linalg.tests.test_decomp.test_eigvals) ---------------------------------------------------------------------- Traceback (most recent call last): File "/scratch/python2.4/lib/python2.4/site-packages/scipy/linalg/tests/test_decomp.py", line 45, in check_simple_tr assert_array_almost_equal(w,exact_w) File "/scratch/python2.4/lib/python2.4/site-packages/numpy/testing/utils.py", line 231, in assert_array_almost_equal assert cond,\ AssertionError: Arrays are not almost equal (mismatch 66.6666666667%): Array 1: [ 9.4371906+0.j -0.1153653+0.j -0.3218254+0.j] Array 2: [ 9.3218254 0. -0.3218254] ---------------------------------------------------------------------- Ran 1109 tests in 3.030s FAILED (failures=3) Any hints there? Hanno Travis Oliphant said: > Hanno Klemm wrote: > > Hi there, > > > > I try to install scipy-0.4.8 together with numpy-0.9.6 and Python > > 2.4.3 and atlas and blas support. The installation seems to be going > > fine. > > > > scipy.test(level=1, verbosity=10) > > > > however results in: > > > > .. > > check_x_bad_size (scipy.linalg.tests.test_fblas.test_zscal)zscal:n=4 > > ... ok > > check_x_stride (scipy.linalg.tests.test_fblas.test_zscal) ... ok > > check_simple (scipy.linalg.tests.test_fblas.test_zswap) ... ok > > check_x_and_y_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok > > check_x_bad_size (scipy.linalg.tests.test_fblas.test_zswap)zswap:n=4 > > ... ok > > check_x_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok > > check_y_bad_size (scipy.linalg.tests.test_fblas.test_zswap)zswap:n=3 > > ... ok > > check_y_stride (scipy.linalg.tests.test_fblas.test_zswap) ... ok > > affine_transform 1 ... FAIL > > affine transform 2 ... FAIL > > affine transform 3 ... FAIL > > affine transform 4 ... FAIL > > affine transform 5Segmentation fault > > > > I don't have any idea what I'm doing wrong. > > > > > > Are you on a 64-bit machine? This looks like the problem with ndimage > on 64-bit machines. > > -Travis > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -- Hanno Klemm klemm at phys.ethz.ch From jdhunter at ace.bsd.uchicago.edu Mon May 8 15:38:51 2006 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Mon, 08 May 2006 14:38:51 -0500 Subject: [SciPy-user] typeset math In-Reply-To: <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> ("Edin =?iso-8859-1?q?Salkovi=A7"'s?= message of "Mon, 8 May 2006 10:54:17 +0200") References: <445BCD03.9040408@gmail.com> <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> Message-ID: <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Edin" == Edin Salkovi? writes: Edin> Then I saw (literally) what John has managed to do - it's Edin> just great. I deffinitely don't want to reinvent the wheel, Edin> but I realy think that this stuff should be put in a Edin> separate library so: 1) other projects can use it (if they Edin> want to). 2) it can be easy for others to use it (see 1) 3) Edin> John can use it :) without having to develop and maintain it Edin> 4) other developers can join the project more easily If you want to work on a new/better/freestanding version of mathtext for SOC, I'm happy to be an unoffical mentor, though I think I long missed the deadline to apply to be an official mentor. I'm suspect Robert/enthought would be willing to officially mentor the project. There are several things that need to be done to improve mathtext, roughly in order of importance * replace the bakoma truetype fonts with a set of good, comprehensive, math fonts, eg, STIX. These aren't out yet but are due real soon, really, they mean it this time . But you could at least refactor the code to make it easy to plug in any font set, using unicode names for symbols where available, so that plugging in STIX would be easy when it is ready. And it is supposed to be out by this simmer. * use the Knuth layout algorithms * refactor it into a stand-alone module * add support for kerning - I took at stab at this but gave up when I realized that the bakoma fonts do not have kerning info in them. Arggg. * improve the parser to handle more TeX * add support for more layouts, eg arrays and fractions JDH From robert.kern at gmail.com Mon May 8 15:52:06 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 08 May 2006 14:52:06 -0500 Subject: [SciPy-user] typeset math In-Reply-To: <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> References: <445BCD03.9040408@gmail.com> <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <445FA166.2010306@gmail.com> John Hunter wrote: > If you want to work on a new/better/freestanding version of mathtext > for SOC, I'm happy to be an unoffical mentor, though I think I long > missed the deadline to apply to be an official mentor. Nope. The deadline for mentors is May 22nd. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From jdhunter at ace.bsd.uchicago.edu Mon May 8 16:09:40 2006 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Mon, 08 May 2006 15:09:40 -0500 Subject: [SciPy-user] typeset math In-Reply-To: <445FA166.2010306@gmail.com> (Robert Kern's message of "Mon, 08 May 2006 14:52:06 -0500") References: <445BCD03.9040408@gmail.com> <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> <445FA166.2010306@gmail.com> Message-ID: <87d5eo5ldn.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Robert" == Robert Kern writes: Robert> Nope. The deadline for mentors is May 22nd. See http://code.google.com/soc/studentfaq.html#42 April 24, 2006: All mentoring organizations must have submitted their interest to Google due by 08:00 Pacific Daylight Time Since I haven't done this, am I not SOL for SOC? JDH From robert.kern at gmail.com Mon May 8 16:48:13 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 08 May 2006 15:48:13 -0500 Subject: [SciPy-user] typeset math In-Reply-To: <87d5eo5ldn.fsf@peds-pc311.bsd.uchicago.edu> References: <445BCD03.9040408@gmail.com> <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> <445FA166.2010306@gmail.com> <87d5eo5ldn.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <445FAE8D.9010905@gmail.com> John Hunter wrote: >>>>>>"Robert" == Robert Kern writes: > > > Robert> Nope. The deadline for mentors is May 22nd. > > See http://code.google.com/soc/studentfaq.html#42 > > April 24, 2006: All mentoring organizations must have submitted > their interest to Google due by 08:00 Pacific Daylight Time > > Since I haven't done this, am I not SOL for SOC? You aren't an organization. You would be just a mentor for the PSF (which is already registered as a mentoring organization). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From jdhunter at ace.bsd.uchicago.edu Mon May 8 17:00:39 2006 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Mon, 08 May 2006 16:00:39 -0500 Subject: [SciPy-user] typeset math In-Reply-To: <445FAE8D.9010905@gmail.com> (Robert Kern's message of "Mon, 08 May 2006 15:48:13 -0500") References: <445BCD03.9040408@gmail.com> <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> <445FA166.2010306@gmail.com> <87d5eo5ldn.fsf@peds-pc311.bsd.uchicago.edu> <445FAE8D.9010905@gmail.com> Message-ID: <87fyjkut8o.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Robert" == Robert Kern writes: Robert> You aren't an organization. You would be just a mentor for Robert> the PSF (which is already registered as a mentoring Robert> organization). OK, thanks, I submitted an application through the google site and sent a request to Neal Norwitz to approve it. I used Eric Jones as my reference, so Eric, if contacted, please say something nice! Again, Edim, if you want to go the mathtext route, I'm happy to help. I realize we have just a few more hours before the 5PM PST deadline so let me know what if anything I can do to help. JDH From robert.kern at gmail.com Mon May 8 17:12:31 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 08 May 2006 16:12:31 -0500 Subject: [SciPy-user] typeset math In-Reply-To: <87fyjkut8o.fsf@peds-pc311.bsd.uchicago.edu> References: <445BCD03.9040408@gmail.com> <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> <445FA166.2010306@gmail.com> <87d5eo5ldn.fsf@peds-pc311.bsd.uchicago.edu> <445FAE8D.9010905@gmail.com> <87fyjkut8o.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <445FB43F.8010001@gmail.com> John Hunter wrote: > Again, Edim, if you want to go the mathtext route, I'm happy to help. > I realize we have just a few more hours before the 5PM PST deadline so > let me know what if anything I can do to help. Students will be able to edit their applications after this deadline if they are requested to do so by the mentor pool. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From eric at enthought.com Mon May 8 19:10:40 2006 From: eric at enthought.com (eric jones) Date: Mon, 08 May 2006 18:10:40 -0500 Subject: [SciPy-user] typeset math In-Reply-To: <87fyjkut8o.fsf@peds-pc311.bsd.uchicago.edu> References: <445BCD03.9040408@gmail.com> <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> <445FA166.2010306@gmail.com> <87d5eo5ldn.fsf@peds-pc311.bsd.uchicago.edu> <445FAE8D.9010905@gmail.com> <87fyjkut8o.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <445FCFF0.3050000@enthought.com> John Hunter wrote: >>>>>> "Robert" == Robert Kern writes: >>>>>> > > Robert> You aren't an organization. You would be just a mentor for > Robert> the PSF (which is already registered as a mentoring > Robert> organization). > > OK, thanks, I submitted an application through the google site and > sent a request to Neal Norwitz to approve it. I used Eric Jones as my > reference, so Eric, if contacted, please say something nice! > > Will do. eric From tcdevlin at bc.edu Mon May 8 20:33:07 2006 From: tcdevlin at bc.edu (TCDevlin) Date: Mon, 8 May 2006 20:33:07 -0400 Subject: [SciPy-user] SCIPY Import Error....suggestions please. Message-ID: <265AC771-C72A-4ADA-83C9-67B4ED1A0614@bc.edu> Ok here is my dilema. I'm using python 2.4.3 IPython 0.7.1.fix1 -- An enhanced Interactive Python. OS X 10.4.6 Same error in XTerm or Terminal ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from scipy import * ------------------------------------------------------------------------ --- exceptions.ImportError Traceback (most recent call last) /Users/herbstzu/ /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/scipy/linalg/__init__.py 6 from linalg_version import linalg_version as __version__ 7 ----> 8 from basic import * 9 from decomp import * 10 from matfuncs import * /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/scipy/linalg/basic.py 15 #from blas import get_blas_funcs 16 #from lapack import get_lapack_funcs ---> 17 from flinalg import get_flinalg_funcs 18 from scipy.lib.lapack import get_lapack_funcs 19 from numpy import asarray,zeros,sum,newaxis,greater_equal,subtract,arange,\ /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/scipy/linalg/flinalg.py 13 import _flinalg 14 except ImportError: ---> 15 from numpy.distutils.misc_util import PostponedException 16 _flinalg = PostponedException() 17 print _flinalg.__doc__ ImportError: cannot import name PostponedException IDEAS..... ------ Robert Herbstzuber TCDevlin Covering::Geology,Slavic Languages,Black Studies,Music,IML,Langauge Lab,Fine Arts,Mc Mullen Museum Devlin Hall 316B Phone: 617-552-6305 Email:tcdevlin at bc.edu ------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From cimrman3 at ntc.zcu.cz Tue May 9 05:38:26 2006 From: cimrman3 at ntc.zcu.cz (Robert Cimrman) Date: Tue, 09 May 2006 11:38:26 +0200 Subject: [SciPy-user] SoC - pymulae In-Reply-To: References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com><200605061107.47832.dd55@cornell.edu> <445CF95F.9060000@gmail.com><63eb7fa90605080200v364679c7rb1c8ca52d9edadf0@mail.gmail.com> Message-ID: <44606312.7030101@ntc.zcu.cz> some more: (py)texlite mathtype(set) texist cheers, r. From ckkart at hoc.net Tue May 9 07:20:24 2006 From: ckkart at hoc.net (Christian Kristukat) Date: Tue, 09 May 2006 20:20:24 +0900 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <44606312.7030101@ntc.zcu.cz> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com><200605061107.47832.dd55@cornell.edu> <445CF95F.9060000@gmail.com><63eb7fa90605080200v364679c7rb1c8ca52d9edadf0@mail.gmail.com> <44606312.7030101@ntc.zcu.cz> Message-ID: <44607AF8.7020708@hoc.net> how about PeX? The only drawback is, that with common TeX pronunciation it sounds like the german word 'Pech' which means 'bad luck'. Christian From edin.salkovic at gmail.com Tue May 9 07:46:06 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Tue, 9 May 2006 13:46:06 +0200 Subject: [SciPy-user] typeset math In-Reply-To: <445FCFF0.3050000@enthought.com> References: <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> <445FA166.2010306@gmail.com> <87d5eo5ldn.fsf@peds-pc311.bsd.uchicago.edu> <445FAE8D.9010905@gmail.com> <87fyjkut8o.fsf@peds-pc311.bsd.uchicago.edu> <445FCFF0.3050000@enthought.com> Message-ID: <63eb7fa90605090446qcba2c9eya844a20550bea99b@mail.gmail.com> Thanks for the interest John! So, I was wondering how could this be organized in a suitable way. - Is it better to reuse the matplotlib's sf project space, or to create a completely new project. As for the former, mathtext could be just a separate package (like matplotlib-toolkits is now). - Should the name be changed to something else, like pyformula, formupy, pymulae, tex4py, typy, pypeset (see the other thread - SoC - pymulae). Honestly speaking, mathtext sounds great, and currently, when you type it into google it comes out 3rd and 4th. pyformula also sounds nicely. Also, Robert pointed me at some sources: - The Texbook, appendix G - http://www.grigoriev.ru/svgmath/ - http://www.sti.uniurb.it/padovani/publications.html - http://rw4.cs.uni-sb.de/~heckmann/abstracts/neuform-review.html - http://www-mgi.informatik.rwth-aachen.de/~blume/Download.html Anything else that I should look at? Should I consult the book "TeX: The Program" (I don't have it currently). I also have "The METAFONTbook", MetaPost's manual, "Thinking in PostScript", but I'm not sure whether I need those at all. I'm not an expert about fonts, so some (freely available) resources would come in handy. From dd55 at cornell.edu Tue May 9 08:27:09 2006 From: dd55 at cornell.edu (Darren Dale) Date: Tue, 9 May 2006 08:27:09 -0400 Subject: [SciPy-user] typeset math In-Reply-To: <63eb7fa90605090446qcba2c9eya844a20550bea99b@mail.gmail.com> References: <445FCFF0.3050000@enthought.com> <63eb7fa90605090446qcba2c9eya844a20550bea99b@mail.gmail.com> Message-ID: <200605090827.09610.dd55@cornell.edu> On Tuesday 09 May 2006 07:46, Edin Salkovi? wrote: > Thanks for the interest John! > > So, I was wondering how could this be organized in a suitable way. > > - Is it better to reuse the matplotlib's sf project space, or to create > a completely new project. As for the former, mathtext could be just a > separate package (like matplotlib-toolkits is now). > - Should the name be changed to something else, like pyformula, formupy, > pymulae, tex4py, typy, pypeset (see the other thread - SoC - pymulae). > Honestly speaking, mathtext sounds great, and currently, when you type > it into google it comes out 3rd and 4th. pyformula also sounds nicely. > > Also, Robert pointed me at some sources: > - The Texbook, appendix G > - http://www.grigoriev.ru/svgmath/ > - http://www.sti.uniurb.it/padovani/publications.html > - http://rw4.cs.uni-sb.de/~heckmann/abstracts/neuform-review.html > - http://www-mgi.informatik.rwth-aachen.de/~blume/Download.html > Anything else that I should look at? > > Should I consult the book "TeX: The Program" (I don't have it currently). > I also have "The METAFONTbook", MetaPost's manual, "Thinking in > PostScript", but I'm not sure whether I need those at all. I'm not an > expert about fonts, so some (freely available) resources would come in > handy. I think "Computers and Typesetting, Volume B: Tex: The Program" may be useful, although I have only just ordered it myself and have not yet received it. Darren From gpajer at rider.edu Tue May 9 08:37:47 2006 From: gpajer at rider.edu (Gary Pajer) Date: Tue, 09 May 2006 08:37:47 -0400 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <44607AF8.7020708@hoc.net> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <200605061107.47832.dd55@cornell.edu> <445CF95F.9060000@gmail.com> <63eb7fa90605080200v364679c7rb1c8ca52d9edadf0@mail.gmail.com> <44606312.7030101@ntc.zcu.cz> <44607AF8.7020708@hoc.net> Message-ID: <44608D1B.1040900@rider.edu> Christian Kristukat wrote: >how about PeX? The only drawback is, that with common TeX pronunciation it >sounds like the german word 'Pech' which means 'bad luck'. > >Christian > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > > typycal ? (may be a repeat...) From jdhunter at ace.bsd.uchicago.edu Tue May 9 10:56:52 2006 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue, 09 May 2006 09:56:52 -0500 Subject: [SciPy-user] typeset math In-Reply-To: <63eb7fa90605090446qcba2c9eya844a20550bea99b@mail.gmail.com> ("Edin =?iso-8859-1?q?Salkovi=A7"'s?= message of "Tue, 9 May 2006 13:46:06 +0200") References: <87fyjnz14o.fsf@peds-pc311.bsd.uchicago.edu> <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> <445FA166.2010306@gmail.com> <87d5eo5ldn.fsf@peds-pc311.bsd.uchicago.edu> <445FAE8D.9010905@gmail.com> <87fyjkut8o.fsf@peds-pc311.bsd.uchicago.edu> <445FCFF0.3050000@enthought.com> <63eb7fa90605090446qcba2c9eya844a20550bea99b@mail.gmail.com> Message-ID: <87psin456z.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Edin" == Edin Salkovi? writes: Edin> - Is it better to reuse the matplotlib's sf project space, Edin> or to create a completely new project. As for the former, Edin> mathtext could be just a separate package (like Edin> matplotlib-toolkits is now). - Should the name be changed matplotlib distributes several packages that are not part of matplotlib proper -- pytz, dateutil, subprocess. These all reside in the lib dir of the python src tree, where matplotlib itself resides. I think for the time being, that would be a natural place to put it. You can refactor it into a free standing package with it's own setup.py that can be distributed standalone, but at the same time matplotlib users and devs can access the latest/greatest with a svn checkout of matplotlib -- these people will give you instant feedback that you probably will not get as a new/freestanding project since you will have an existing user-base working with the development version of your code. In the future, if all is working well and is useful, we can upload it to it's own site. Edin> to something else, like pyformula, formupy, pymulae, tex4py, Edin> typy, pypeset (see the other thread - SoC - pymulae). Edin> Honestly speaking, mathtext sounds great, and currently, Edin> when you type it into google it comes out 3rd and Edin> 4th. pyformula also sounds nicely. The amount of time spent worrying about infrastructure, names, and stuff like that before any real code gets written is usually inversely proportionate to the amount of real work that gets done. mathtext isn't terribly clever as a name, but it exists, is compatible with existing code, and googles well. Your job is to move it from third to first place in google'e search results :-) Actually, that is easy to do. If you make announcements on c.l.py and on pypi when you have new releases, these will be vastly magnified by RSS feeds and lots of mail->news gateways on the web, which will amplify it in google's page rank algorithm. Edin> Also, Robert pointed me at some sources: - The Texbook, Edin> appendix G - http://www.grigoriev.ru/svgmath/ - Edin> http://www.sti.uniurb.it/padovani/publications.html - Edin> http://rw4.cs.uni-sb.de/~heckmann/abstracts/neuform-review.html Edin> - Edin> http://www-mgi.informatik.rwth-aachen.de/~blume/Download.html Edin> Anything else that I should look at? Edin> Should I consult the book "TeX: The Program" (I don't have Edin> it currently). I also have "The METAFONTbook", MetaPost's Edin> manual, "Thinking in PostScript", but I'm not sure whether I Edin> need those at all. I'm not an expert about fonts, so some Edin> (freely available) resources would come in handy. All of these are great resources. Also checkout * the various publications on http://www.truetex.com/, eg "The TrueTeX Times Option: Using Times Fonts with TrueTeX", "UM Fonts", "Belleek: A Call for METAFONT Revival", "Extending TeX to Unicode" * the STIX fonts project http://www.stixfonts.org -- these are likely to be the fonts we will end up using. See if you can get a beta "developer's" distribution to work with. * the freetype project -- this is a good place to learn about truetype fonts and fonts in general - http://freetype.sourceforge.net/freetype2/documentation.html * study up on unicode -- there are tons of web resources * Knuth's web src code -- in addition to the code, these contain all of the documentation that were used to generate the TeX book and friends, so you can build the documentation or download it yourself free of charge if you don't have access to the books. * the postscript and pdf documentation will have some helpful stuff vis-a-vis fonts, font metrics and kerning, and are available free Lots to learn! I have lots of code and examples sitting around that I can share with you on how to load, read, and manipulate font files. If you want to refactor mathtext into a standalone project first, that is fine by me. That should be fairly easy, with the caveat being the font library issue. The font library is probably an SOC project of it's own, because we would like to settle on one freetype library that both matplotlib and enthought/chaco can use. How to deal with this issue without becoming consumed by it will require some thought. The first substantial project should be to refactor mathtext to use a unicode mapping for the TeX symbols. This is not a one-to-one mapping but it is a fairly close. Currently we hardcode the mapping from TeX symbol name to a (font_file, glyph_index) tuple, which ties us to a given set of fonts (eg, the Bakoma fonts); see the matplotlib _mathtext_data module. I've done a fair amount of work here already which I can send your way, and there are resources on the web you can find that will provide the mapping, so your main job will be to make mathtext work with these. Once this is done, we can get rid of the substandard bakoma cm* fonts and replace them with any set of freetype fonts that provide math symbols. If these fonts provide kerning information, we can dust off the kerning code which will automatically improve the layout. This is all fairly easy and will introduce you to the code as you prepare for the harder job, which is to grok and implement Knuth's layout algorithms.... One thing I've struggled with is how one can do cross fontfile kerning. Eg, suppose you have ( x ) You want to pull the parentheses in closer to the x, but if the parentheses glyphs and the 'x' glyph come from different font files, there will be no kerning information for them. I'm curious to know how Knuth handles this problem. At various times I've considered adding some code to the matplotlib font module for "autokerning". Basically, given the rasters of two glyphs, you should be able to work out some optimization routines that lay them out nicely. The traditional glyph metrics in a font file give you the rectangle of the ink extent, but this is not what you want, since for a tall parentheses / \ |x| \ / you might want the x to be moved inside the ink rectangle. This is what kerning information provides, but we will potentially be working with glyph across font files where this information does not exist (a research question for you -- do the STIX fonts deal with this issue?) But one should be able to do this algorithmically. You might model the raster pixels of the glyphs as being like a charge or a mass, where the particles are attracted to one-another unless they get too close, in which case they repel, and no particle can cross another particle.... You would need to constrain the optimization in a single dimension, eg horizontal movement. Has anyone seen something like this? You could tweak the attractor/repellor functions until you get something that "looks good" for typical use cases. JDH From robert.kern at gmail.com Tue May 9 11:51:42 2006 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 09 May 2006 10:51:42 -0500 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> <445BED80.3050000@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> Message-ID: <4460BA8E.8000307@gmail.com> Edin Salkovi? wrote: > Thanks for the feedback! > > I'm now refining my application for SoC. Regardless of it being > accepted or not I'll work on pymulae - anyone having a better name? Actually, now that I think about, "mathtext" is just about perfect. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From nvf at MIT.EDU Tue May 9 13:01:52 2006 From: nvf at MIT.EDU (Nick Fotopoulos) Date: Tue, 09 May 2006 13:01:52 -0400 Subject: [SciPy-user] Numpy-discussion digest, Vol 1 #1753 - 1 msg In-Reply-To: <20060509030933.A19D3F53A@sc8-sf-spam2.sourceforge.net> References: <20060509030933.A19D3F53A@sc8-sf-spam2.sourceforge.net> Message-ID: <4460CB00.10601@mit.edu> Dear all, I sure wish I had seen John's link before writing my own decimate, but such is life. I am going to transition this thread to the scipy list since it seems more as if it belongs there. I have a comment which may be way, way beyond the scope of Ryan's intended application, but which probably should be made before a decimate function is added to scipy. If you will be FFTing your decimated signal and care at all about the phase, then you may want to consider using something like filtfilt rather than just applying a single filter. It filters a signal forwards then backwards in order to avoid introducing a phase delay, and is actually used in the Matlab implementation of decimate. I found an implementation in Python here: http://article.gmane.org/gmane.comp.python.scientific.user/1164/ While the author, Andrew Straw, seems to be suffering edge effects, it seems as if he's not windowing his data. In my application, his filtfilt seems to do its job quite nicely. Then again, I am also not a signals whiz. Take care, Nick numpy-discussion-request at lists.sourceforge.net wrote: > Message: 1 > To: "Ryan Krauss" > Cc: numpy-discussion > Subject: Re: [Numpy-discussion] downsample vector with averaging > From: John Hunter > Date: Mon, 08 May 2006 21:31:51 -0500 > > You might look at the matlab function decimate -- it first does a > chebyshev low-pass filter before it does the down-sampling. > Conceptually similar to what you are proposing with simple averaging > but with a little more sophistication > > http://www-ccs.ucsd.edu/matlab/toolbox/signal/decimate.html > > An open source version (GPL) for octave by Paul Kienzle, who is one of > the authors of the matplotlib quadmesh functionality and apparently a > python convertee, is here > > http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/signal/decimate.m > > and it looks like someone has already translated this to python using > scipy.signal > > http://www.bigbold.com/snippets/posts/show/1209 > > Some variant of this would be a nice addition to scipy. > > JDH > From edin.salkovic at gmail.com Wed May 10 05:36:23 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Wed, 10 May 2006 11:36:23 +0200 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <4460BA8E.8000307@gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> <445BED80.3050000@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> <4460BA8E.8000307@gmail.com> Message-ID: <63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com> > Actually, now that I think about, "mathtext" is just about perfect. You too? This must be contageous ;) OK. pymulae is dead. Long live mathtext! After getting feedback (other thread) from John, I think that the best thing to do, as John pointed out, is to work on existing mathtext code. "mathtext" may be just about perfect, but mathtext is not :) Should I change the application for SoC also? If so, can you Robert (or John) set my application to be editable. So, again thanks for all the nice names (well...) you guys suggested, now it's time for real work. From edin.salkovic at gmail.com Wed May 10 05:43:43 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Wed, 10 May 2006 11:43:43 +0200 Subject: [SciPy-user] typeset math In-Reply-To: <87psin456z.fsf@peds-pc311.bsd.uchicago.edu> References: <63eb7fa90605080154x99d5426p7a458fc4bee53d89@mail.gmail.com> <873bfkjohg.fsf@peds-pc311.bsd.uchicago.edu> <445FA166.2010306@gmail.com> <87d5eo5ldn.fsf@peds-pc311.bsd.uchicago.edu> <445FAE8D.9010905@gmail.com> <87fyjkut8o.fsf@peds-pc311.bsd.uchicago.edu> <445FCFF0.3050000@enthought.com> <63eb7fa90605090446qcba2c9eya844a20550bea99b@mail.gmail.com> <87psin456z.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <63eb7fa90605100243y34632ee2kcb870a64ced47f8b@mail.gmail.com> > matplotlib distributes several packages that are not part of > matplotlib proper -- pytz, dateutil, subprocess. These all reside in > the lib dir of the python src tree, where matplotlib itself resides. > I think for the time being, that would be a natural place to put it. > You can refactor it into a free standing package with it's own > setup.py that can be distributed standalone, but at the same time > matplotlib users and devs can access the latest/greatest with a svn > checkout of matplotlib -- these people will give you instant feedback > that you probably will not get as a new/freestanding project since you > will have an existing user-base working with the development version > of your code. In the future, if all is working well and is useful, we > can upload it to it's own site. > > Edin> to something else, like pyformula, formupy, pymulae, tex4py, > Edin> typy, pypeset (see the other thread - SoC - pymulae). > Edin> Honestly speaking, mathtext sounds great, and currently, > Edin> when you type it into google it comes out 3rd and > Edin> 4th. pyformula also sounds nicely. > > The amount of time spent worrying about infrastructure, names, and > stuff like that before any real code gets written is usually inversely > proportionate to the amount of real work that gets done. mathtext > isn't terribly clever as a name, but it exists, is compatible with > existing code, and googles well. Your job is to move it from third to > first place in google'e search results :-) OK. I'll start working on existing mathtext. From arnd.baecker at web.de Wed May 10 06:41:52 2006 From: arnd.baecker at web.de (Arnd Baecker) Date: Wed, 10 May 2006 12:41:52 +0200 (CEST) Subject: [SciPy-user] SoC - pymulae In-Reply-To: <63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> <63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com> Message-ID: On Wed, 10 May 2006, [UTF-8] Edin Salkovi?^G wrote: > > Actually, now that I think about, "mathtext" is just about perfect. > > You too? This must be contageous ;) > > OK. pymulae is dead. Long live mathtext! could MathText^{TM} (first hit with google) http://users.adelphia.net/~dewell/mathtext.html cause any problems? Best, Arnd From jeanluc.menut at free.fr Wed May 10 08:07:16 2006 From: jeanluc.menut at free.fr (Jean-Luc Menut) Date: Wed, 10 May 2006 14:07:16 +0200 Subject: [SciPy-user] SoC - pymulae In-Reply-To: References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> <63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com> Message-ID: <4461D774.4040807@free.fr> > could MathText^{TM} (first hit with google) > http://users.adelphia.net/~dewell/mathtext.html > cause any problems? What about MathTeX ? From edin.salkovic at gmail.com Wed May 10 08:10:33 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Wed, 10 May 2006 14:10:33 +0200 Subject: [SciPy-user] SoC - pymulae In-Reply-To: References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> <63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com> Message-ID: <63eb7fa90605100510p17d60915pfc88c634f5ce0dc3@mail.gmail.com> You mean, because of the TM. I just noticed that there is also a "Math Up Your Text!?" TM. > could MathText^{TM} (first hit with google) > http://users.adelphia.net/~dewell/mathtext.html > cause any problems? > > Best, > > Arnd From ryanlists at gmail.com Wed May 10 08:49:52 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Wed, 10 May 2006 08:49:52 -0400 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <63eb7fa90605100510p17d60915pfc88c634f5ce0dc3@mail.gmail.com> References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> <63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com> <63eb7fa90605100510p17d60915pfc88c634f5ce0dc3@mail.gmail.com> Message-ID: As far as MathText vs. MathTeX, I had a friend who had looked into trademarks once tell me a new one needs to be somthing like 10 or 20% different from an existing one. Since MathTex and MathText only differ by 1 letter in 10, that could be a problem. (But this is just my recollection of a several year old conversation). Ryan On 5/10/06, Edin Salkovi? wrote: > You mean, because of the TM. > I just noticed that there is also a "Math Up Your Text!?" TM. > > > could MathText^{TM} (first hit with google) > > http://users.adelphia.net/~dewell/mathtext.html > > cause any problems? > > > > Best, > > > > Arnd > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From pearu at scipy.org Wed May 10 09:52:43 2006 From: pearu at scipy.org (Pearu Peterson) Date: Wed, 10 May 2006 08:52:43 -0500 (CDT) Subject: [SciPy-user] SoC - pymulae In-Reply-To: References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> <63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com> <63eb7fa90605100510p17d60915pfc88c634f5ce0dc3@mail.gmail.com> Message-ID: On Wed, 10 May 2006, Ryan Krauss wrote: > As far as MathText vs. MathTeX, I had a friend who had looked into > trademarks once tell me a new one needs to be somthing like 10 or 20% > different from an existing one. Since MathTex and MathText only > differ by 1 letter in 10, that could be a problem. (But this is just > my recollection of a several year old conversation). The difference is in two letters: removed t and capitalized x. Also pronunciation is quote different. The same difference is in mathtext that would be preferable name for a python package. Or mathtex. Pearu From aisaac at american.edu Wed May 10 11:41:12 2006 From: aisaac at american.edu (Alan G Isaac) Date: Wed, 10 May 2006 11:41:12 -0400 Subject: [SciPy-user] SoC - pymulae In-Reply-To: References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com><91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com><445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au><63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com><63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com><63eb7fa90605100510p17d60915pfc88c634f5ce0dc3@mail.gmail.com> Message-ID: It seems to me that it would be worth asking Doug Ewell dewell adelphia.net his opinion. From the tenor of his page, I doubt he'll mind. Cheers, Alan Isaac From solkaa at gmail.com Wed May 10 13:28:03 2006 From: solkaa at gmail.com (Sergey Dolgov) Date: Wed, 10 May 2006 21:28:03 +0400 Subject: [SciPy-user] longfloat in numpy Message-ID: <20060510172803.GB29540@solka-l> Hi, I,m getting this type of behaviour with numpy 0.9.6: In [12]: import numpy In [13]: print numpy.exp( numpy.longfloat(1000)) 1.97007111401704699387e+434 In [14]: print numpy.exp( numpy.array([1000], dtype=numpy.longfloat)) [ inf] In [15]: print numpy.version.version 0.9.6 i.e. seems like longfloat "doesn't work" inside array. Have I missed something? Thanks. -- Sergey From oliphant.travis at ieee.org Wed May 10 14:49:34 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Wed, 10 May 2006 12:49:34 -0600 Subject: [SciPy-user] longfloat in numpy In-Reply-To: <20060510172803.GB29540@solka-l> References: <20060510172803.GB29540@solka-l> Message-ID: <446235BE.3020009@ieee.org> Sergey Dolgov wrote: > Hi, > > I,m getting this type of behaviour with numpy 0.9.6: > > > In [12]: import numpy > > In [13]: print numpy.exp( numpy.longfloat(1000)) > 1.97007111401704699387e+434 > > In [14]: print numpy.exp( numpy.array([1000], dtype=numpy.longfloat)) > [ inf] > > In [15]: print numpy.version.version > 0.9.6 > > > i.e. seems like longfloat "doesn't work" inside array. > It does work, the error occurs only in the printing. Apparently the printing is trying to convert it to a float (which gives the inf) --- I suspect the right special-casing is not being applied in the printing code. You should file a ticket on the NumPy Trac pages. -Travis From zenguyuno at yahoo.com Wed May 10 20:27:02 2006 From: zenguyuno at yahoo.com (Mitchell Timin) Date: Wed, 10 May 2006 17:27:02 -0700 (PDT) Subject: [SciPy-user] using linalg.lstsq Message-ID: <20060511002702.1842.qmail@web60821.mail.yahoo.com> I'm brand new to numpy & scipy, and my linear algebra is pretty weak also. I'm hoping someone will show me how to fit a plane to some points. I need to work in higher dimensional space, but I think If I understand the 3-D case I will be OK. So, suppose I have, say, half a dozen points in 3-space. I want to find values for c1, c2 & c3 so that x3 = c1*x1 + c2*x2 + c3 passes close to all the points in the least square sense. I think that linalg.lstsq will solve that problem, but I don't know how to set it up. Thanks Mitchell Timin I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From robert.kern at gmail.com Wed May 10 21:22:17 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 10 May 2006 20:22:17 -0500 Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <20060511002702.1842.qmail@web60821.mail.yahoo.com> References: <20060511002702.1842.qmail@web60821.mail.yahoo.com> Message-ID: <446291C9.2070404@gmail.com> Mitchell Timin wrote: > I'm brand new to numpy & scipy, and my linear algebra is pretty weak also. I'm hoping > someone will show me how to fit a plane to some points. I need to work in higher > dimensional space, but I think If I understand the 3-D case I will be OK. > So, suppose I have, say, half a dozen points in 3-space. I want to find values for c1, > c2 & c3 so that x3 = c1*x1 + c2*x2 + c3 passes close to all the points in the least > square sense. > > I think that linalg.lstsq will solve that problem, but I don't know how to set it up. Did my explanation on comp.lang.python not help you? You said it did. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From aisaac at american.edu Wed May 10 21:45:38 2006 From: aisaac at american.edu (Alan Isaac) Date: Wed, 10 May 2006 21:45:38 -0400 (EDT) Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <20060511002702.1842.qmail@web60821.mail.yahoo.com> References: <20060511002702.1842.qmail@web60821.mail.yahoo.com> Message-ID: On Wed, 10 May 2006, Mitchell Timin wrote: > suppose I have, say, half a dozen points in 3-space. > I want to find values for c1, c2 & c3 so that x3 = c1*x1 > + c2*x2 + c3 passes close to all the points in the least > square sense. > I think that linalg.lstsq will solve that problem, but I don't know how to set it up. First look at the help: >>> help(N.linalg.lstsq) Help on function linear_least_squares in module numpy.linalg.linalg: linear_least_squares(a, b, rcond=1e-010) returns x,resids,rank,s where x minimizes 2-norm(|b - Ax|) resids is the sum square residuals rank is the rank of A s is the rank of the singular values of A in descending order If b is a matrix then x is also a matrix with corresponding columns. If the rank of A is less than the number of columns of A or greater than the number of rows, then residuals will be returned as an empty array otherwise resids = sum((b-dot(A,x)**2). Singular values less than s[0]*rcond are treated as zero. In your case b=x3 and A holds the other data. So with 10 observations, for example, to get [c1,c2,c3] you can do something like >>> c=N.ones((10,1)) >>> A=N.hstack([x1,x2,c]) >>> N.linalg.lstsq(A,x3)[0] hth, Alan Isaac From zenguyuno at yahoo.com Wed May 10 22:29:23 2006 From: zenguyuno at yahoo.com (Mitchell Timin) Date: Wed, 10 May 2006 19:29:23 -0700 (PDT) Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <446291C9.2070404@gmail.com> Message-ID: <20060511022923.44663.qmail@web60821.mail.yahoo.com> --- Robert Kern wrote: > Mitchell Timin wrote: > > I'm brand new to numpy & scipy, and my linear algebra is pretty weak also. I'm > hoping > > someone will show me how to fit a plane to some points. I need to work in higher > > dimensional space, but I think If I understand the 3-D case I will be OK. > > So, suppose I have, say, half a dozen points in 3-space. I want to find values for > c1, > > c2 & c3 so that x3 = c1*x1 + c2*x2 + c3 passes close to all the points in the least > > square sense. > > > > I think that linalg.lstsq will solve that problem, but I don't know how to set it > up. > > Did my explanation on comp.lang.python not help you? You said it did. Yes, it was helpful in that it showed me how to call lstsq() without errors, but I was not able to convert my problem into the correct form to get a solution. It is not obvious how to go from the form above into a pair of matrices that work with lstsq(). > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret it as though it had > an underlying truth." > -- Umberto Eco I like that quote! I agree with it, but I have given up the struggle he mentions. Mitchell Timin I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From robert.kern at gmail.com Wed May 10 22:36:06 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 10 May 2006 21:36:06 -0500 Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <20060511022923.44663.qmail@web60821.mail.yahoo.com> References: <20060511022923.44663.qmail@web60821.mail.yahoo.com> Message-ID: <4462A316.1030804@gmail.com> Mitchell Timin wrote: > --- Robert Kern wrote: > >>Mitchell Timin wrote: >> >>>I'm brand new to numpy & scipy, and my linear algebra is pretty weak also. I'm >> >>hoping >> >>>someone will show me how to fit a plane to some points. I need to work in higher >>>dimensional space, but I think If I understand the 3-D case I will be OK. >>>So, suppose I have, say, half a dozen points in 3-space. I want to find values for >> >>c1, >> >>>c2 & c3 so that x3 = c1*x1 + c2*x2 + c3 passes close to all the points in the least >>>square sense. >>> >>>I think that linalg.lstsq will solve that problem, but I don't know how to set it >> >>up. >> >>Did my explanation on comp.lang.python not help you? You said it did. > > Yes, it was helpful in that it showed me how to call lstsq() without errors, but I was > not able to convert my problem into the correct form to get a solution. It is not > obvious how to go from the form above into a pair of matrices that work with lstsq(). The example I showed you *was* in the form above (with an extra dimension). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From zenguyuno at yahoo.com Wed May 10 22:43:50 2006 From: zenguyuno at yahoo.com (Mitchell Timin) Date: Wed, 10 May 2006 19:43:50 -0700 (PDT) Subject: [SciPy-user] using linalg.lstsq In-Reply-To: Message-ID: <20060511024350.2119.qmail@web60820.mail.yahoo.com> --- Alan Isaac wrote: > On Wed, 10 May 2006, Mitchell Timin wrote: > > suppose I have, say, half a dozen points in 3-space. > > I want to find values for c1, c2 & c3 so that x3 = c1*x1 > > + c2*x2 + c3 passes close to all the points in the least > > square sense. > > I think that linalg.lstsq will solve that problem, but I don't know how to set it > up. > > First look at the help: Yes, I looked at the help. > In your case b=x3 and A holds the other data. > So with 10 observations, for example, to get [c1,c2,c3] > you can do something like > >>> c=N.ones((10,1)) > >>> A=N.hstack([x1,x2,c]) > >>> N.linalg.lstsq(A,x3)[0] That doesn't work. It seems I have not explained the problem clearly. x1, x2 & x3 are scalars, representing x, y & z. This refers to the usual x,y plane, and z is the height above the plane. We are given four or more points. Each point is an example of x, y & z, and they might all be put into a matrix in some way. (I don't know how.) What we seek are values for three coefficients, call them a, b & c, so that the plane described by z = a*x + b*y + c passes as close as possible to all of the given points. ("close as possible" meaning that the sum of the squared errors is minimized.) thanks, Mitchell Timin I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From zenguyuno at yahoo.com Wed May 10 22:50:59 2006 From: zenguyuno at yahoo.com (Mitchell Timin) Date: Wed, 10 May 2006 19:50:59 -0700 (PDT) Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <4462A316.1030804@gmail.com> Message-ID: <20060511025059.6332.qmail@web60817.mail.yahoo.com> --- Robert Kern wrote: > Mitchell Timin wrote: > > --- Robert Kern wrote: > > > >>Mitchell Timin wrote: > >> > >>>I'm brand new to numpy & scipy, and my linear algebra is pretty weak also. I'm > >> > >>hoping > >> > >>>someone will show me how to fit a plane to some points. I need to work in higher > >>>dimensional space, but I think If I understand the 3-D case I will be OK. > >>>So, suppose I have, say, half a dozen points in 3-space. I want to find values for > >> > >>c1, > >> > >>>c2 & c3 so that x3 = c1*x1 + c2*x2 + c3 passes close to all the points in the least > >>>square sense. > >>> > >>>I think that linalg.lstsq will solve that problem, but I don't know how to set it > >> > >>up. > >> > >>Did my explanation on comp.lang.python not help you? You said it did. > > > > Yes, it was helpful in that it showed me how to call lstsq() without errors, but I > was > > not able to convert my problem into the correct form to get a solution. It is not > > obvious how to go from the form above into a pair of matrices that work with > lstsq(). > > The example I showed you *was* in the form above (with an extra dimension). I accept that, but I don't see how to put my problem into that form. Suppose we are given these 4 points only: x y z 0 0 .5 0 1 .6 1 0 .4 1 1 .55 What is the equation of the plane that passes closest to those 4 points? It is of the form z = a*x + b*y + c. What are the values of a, b, & c? Thanks, Mitchell Timin I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From robert.kern at gmail.com Wed May 10 23:08:16 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 10 May 2006 22:08:16 -0500 Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <20060511025059.6332.qmail@web60817.mail.yahoo.com> References: <20060511025059.6332.qmail@web60817.mail.yahoo.com> Message-ID: <4462AAA0.8070404@gmail.com> Mitchell Timin wrote: > I accept that, but I don't see how to put my problem into that form. Suppose we are > given these 4 points only: > x y z > 0 0 .5 > 0 1 .6 > 1 0 .4 > 1 1 .55 > > What is the equation of the plane that passes closest to those 4 points? It is of the > form z = a*x + b*y + c. What are the values of a, b, & c? Okay, let's take a step back. If you are defining closest by looking at the difference between the points and the plane in the z direction (that is, z_i - (a*x_i + b*y_i + c)), then what I gave you is *exactly* what you asked for. I'm afraid I can't really simplify it any more than that. If, instead what you need is the distance from the data point to the point on the plane that is closest to it, then you need orthogonal distance regression (ODR). If you want to cast it into a linear algebraic least squares problem, then Google is your friend; I don't know the transformation off-hand. If you're willing to throw a non-linear ODR solver at it, then you can enable the package scipy.sandbox.odr (uncomment the appropriate line in Lib/sandbox/setup.py). There is documentation at the top of Lib/sandbox/odr/odrpack.py . You will want to use the predefined scipy.sandbox.odr.models.multilinear model. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From aisaac at american.edu Wed May 10 23:16:31 2006 From: aisaac at american.edu (Alan Isaac) Date: Wed, 10 May 2006 23:16:31 -0400 (EDT) Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <20060511024350.2119.qmail@web60820.mail.yahoo.com> References: <20060511024350.2119.qmail@web60820.mail.yahoo.com> Message-ID: On Wed, 10 May 2006, Mitchell Timin wrote: > It seems I have not explained the problem clearly. x1, x2 > & x3 are scalars, representing x, y & z. You need to think of x1, x2, and x3 as vectors. E.g., your first "observation" is x1[0], x2[0], x3[0]. Suppose for example you have this list of four observations: (1.0,1.0,3.1), (1.0,2.0,4.9), (2.0,1.0,4.1), (2.0,2.0,5.9) Use these to create a data array to do your work with. >>> data = N.array( [ (1.0,1.0,3.1), (1.0,2.0,4.9), (2.0,1.0,4.1), (2.0,2.0,5.9) ]) >>> constant = N.ones((4,1)) >>> RHS = N.hstack([data[:,0:-1],constant]) >>> LHS = data[:,-1:] >>> N.linalg.lstsq(RHS,LHS)[0] array([[ 1. ], [ 1.8], [ 0.3]]) hth, Alan Isaac From zenguyuno at yahoo.com Wed May 10 23:17:59 2006 From: zenguyuno at yahoo.com (Mitchell Timin) Date: Wed, 10 May 2006 20:17:59 -0700 (PDT) Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <4462AAA0.8070404@gmail.com> Message-ID: <20060511031759.29813.qmail@web60824.mail.yahoo.com> --- Robert Kern wrote: > Mitchell Timin wrote: > > > I accept that, but I don't see how to put my problem into that form. Suppose we are > > given these 4 points only: > > x y z > > 0 0 .5 > > 0 1 .6 > > 1 0 .4 > > 1 1 .55 > > > > What is the equation of the plane that passes closest to those 4 points? It is of > the > > form z = a*x + b*y + c. What are the values of a, b, & c? > > Okay, let's take a step back. If you are defining closest by looking at the > difference between the points and the plane in the z direction (that is, z_i - > (a*x_i + b*y_i + c)), then what I gave you is *exactly* what you asked for. I'm > afraid I can't really simplify it any more than that. That is what I want, but I don't know how to put the values given above into the A and B matrices, and also get them into the correct shapes. Thanks, Mitchell Timin I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From wbaxter at gmail.com Wed May 10 23:21:38 2006 From: wbaxter at gmail.com (Bill Baxter) Date: Thu, 11 May 2006 12:21:38 +0900 Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <4462AAA0.8070404@gmail.com> References: <20060511025059.6332.qmail@web60817.mail.yahoo.com> <4462AAA0.8070404@gmail.com> Message-ID: Try this: # x y A = array([[ 0., 0.], [ 0., 1.], [ 1., 0.], [ 1., 1.]]) A = hstack( (A, ones((A.shape[0],1)) )) z = array([.5,.6,.4,.55]) c = scipy.linalg.lstsq(A,z)[0] # Now use it! newx,newy = 0.2, 0.5 newz = c[0] * newx + c[1] * newy + c[2] On 5/11/06, Robert Kern wrote: > > Mitchell Timin wrote: > > > I accept that, but I don't see how to put my problem into that > form. Suppose we are > > given these 4 points only: > > x y z > > 0 0 .5 > > 0 1 .6 > > 1 0 .4 > > 1 1 .55 > > > > What is the equation of the plane that passes closest to those 4 > points? It is of the > > form z = a*x + b*y + c. What are the values of a, b, & c? > > Okay, let's take a step back. If you are defining closest by looking at > the > difference between the points and the plane in the z direction (that is, > z_i - > (a*x_i + b*y_i + c)), then what I gave you is *exactly* what you asked > for. I'm > afraid I can't really simplify it any more than that. > > If, instead what you need is the distance from the data point to the point > on > the plane that is closest to it, then you need orthogonal distance > regression > (ODR). If you want to cast it into a linear algebraic least squares > problem, > then Google is your friend; I don't know the transformation off-hand. > > If you're willing to throw a non-linear ODR solver at it, then you can > enable > the package scipy.sandbox.odr (uncomment the appropriate line in > Lib/sandbox/setup.py). There is documentation at the top of > Lib/sandbox/odr/odrpack.py . You will want to use the predefined > scipy.sandbox.odr.models.multilinear model. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma > that is made terrible by our own mad attempt to interpret it as though it > had > an underlying truth." > -- Umberto Eco > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -- William V. Baxter III OLM Digital Kono Dens Building Rm 302 1-8-8 Wakabayashi Setagaya-ku Tokyo, Japan 154-0023 +81 (3) 3422-3380 -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Wed May 10 23:24:53 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 10 May 2006 22:24:53 -0500 Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <20060511031759.29813.qmail@web60824.mail.yahoo.com> References: <20060511031759.29813.qmail@web60824.mail.yahoo.com> Message-ID: <4462AE85.8010907@gmail.com> Mitchell Timin wrote: > --- Robert Kern wrote: >>Okay, let's take a step back. If you are defining closest by looking at the >>difference between the points and the plane in the z direction (that is, z_i - >>(a*x_i + b*y_i + c)), then what I gave you is *exactly* what you asked for. I'm >>afraid I can't really simplify it any more than that. > > That is what I want, but I don't know how to put the values given above into the A and B > matrices, and also get them into the correct shapes. I showed you that already. So has Alan. Twice. Can you tell us what *parts* of our explanations are inadequate instead of making the same blanket request over and over again? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From zenguyuno at yahoo.com Wed May 10 23:30:10 2006 From: zenguyuno at yahoo.com (Mitchell Timin) Date: Wed, 10 May 2006 20:30:10 -0700 (PDT) Subject: [SciPy-user] using linalg.lstsq In-Reply-To: Message-ID: <20060511033010.34454.qmail@web60824.mail.yahoo.com> --- Alan Isaac wrote: > On Wed, 10 May 2006, Mitchell Timin wrote: > > It seems I have not explained the problem clearly. x1, x2 > > & x3 are scalars, representing x, y & z. > > You need to think of x1, x2, and x3 as vectors. > E.g., your first "observation" is x1[0], x2[0], x3[0]. > Suppose for example you have this list of four observations: > (1.0,1.0,3.1), > (1.0,2.0,4.9), > (2.0,1.0,4.1), > (2.0,2.0,5.9) > Use these to create a data array to do your work with. > >>> data = N.array( [ (1.0,1.0,3.1), (1.0,2.0,4.9), (2.0,1.0,4.1), (2.0,2.0,5.9) ]) > >>> constant = N.ones((4,1)) > >>> RHS = N.hstack([data[:,0:-1],constant]) > >>> LHS = data[:,-1:] > >>> N.linalg.lstsq(RHS,LHS)[0] > array([[ 1. ], > [ 1.8], > [ 0.3]]) That worked! I put the above into this program: ------------------------------------------------------------- import numpy as N data = N.array( [ (1.0,1.0,3.1), (1.0,2.0,4.9), (2.0,1.0,4.1), (2.0,2.0,5.9) ]) constant = N.ones((4,1)) RHS = N.hstack([data[:,0:-1],constant]) LHS = data[:,-1:] (X, resids, rank, s) = N.linalg.lstsq(RHS,LHS) print "X" print X print "resids" print resids print "rank" print rank print "s" print s ----------------------------------------------- and it produced this output: ----------------------------------------------- X [[ 1. ] [ 1.8] [ 0.3]] resids [ 4.07526776e-31] rank 3 s [ 4.77752568 1. 0.41862674] ------------------------------------------------- Thank you, From that I think I can work out how to do the higher dimensional case. Mitchell Timin I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From zenguyuno at yahoo.com Thu May 11 00:00:45 2006 From: zenguyuno at yahoo.com (Mitchell Timin) Date: Wed, 10 May 2006 21:00:45 -0700 (PDT) Subject: [SciPy-user] using linalg.lstsq In-Reply-To: Message-ID: <20060511040045.85101.qmail@web60813.mail.yahoo.com> --- Bill Baxter wrote: > Try this: > > # x y > A = array([[ 0., 0.], > [ 0., 1.], > [ 1., 0.], > [ 1., 1.]]) > A = hstack( (A, ones((A.shape[0],1)) )) > z = array([.5,.6,.4,.55]) > c = scipy.linalg.lstsq(A,z)[0] That seems to work. I made it into this program: ---------------------------------------------- from scipy import * A = array([[ 0., 0.], [ 0., 1.], [ 1., 0.], [ 1., 1.]]) A = hstack( (A, ones((A.shape[0],1)) )) z = array([.5,.6,.4,.55]) print "A" print A print print "z" print z print (X, resids, rank, s) = linalg.lstsq(A,z) print "X" print X print print "resids" print resids print print "rank" print rank print print "s" print s print print "calculate z at original points:" print X[0] print X[0] + X[1] print X[0] + X[2] print X[0] + X[1] + X[2] ---------------------------------------------- and it produced this result: ---------------------------------------------- A [[ 0. 0. 1.] [ 0. 1. 1.] [ 1. 0. 1.] [ 1. 1. 1.]] z [ 0.5 0.6 0.4 0.55] X [-0.075 0.125 0.4875] resids 0.000625 rank 3 s [ 2.5243378 1. 0.79228699] calculate z at original points: -0.075 0.05 0.4125 0.5375 ---------------------------------------------- I can't tell if that answer is correct. I will create a better test case to make it obvious. Thanks, Mitchell Timin I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From zenguyuno at yahoo.com Thu May 11 00:04:21 2006 From: zenguyuno at yahoo.com (Mitchell Timin) Date: Wed, 10 May 2006 21:04:21 -0700 (PDT) Subject: [SciPy-user] using linalg.lstsq In-Reply-To: <4462AE85.8010907@gmail.com> Message-ID: <20060511040421.1504.qmail@web60823.mail.yahoo.com> --- Robert Kern wrote: > Mitchell Timin wrote: > > --- Robert Kern wrote: > > >>Okay, let's take a step back. If you are defining closest by looking at the > >>difference between the points and the plane in the z direction (that is, z_i - > >>(a*x_i + b*y_i + c)), then what I gave you is *exactly* what you asked for. I'm > >>afraid I can't really simplify it any more than that. > > > > That is what I want, but I don't know how to put the values given above into the A > and B > > matrices, and also get them into the correct shapes. > > I showed you that already. So has Alan. Twice. Can you tell us what *parts* of > our explanations are inadequate instead of making the same blanket request over > and over again? Alan showed me. I replied to him before I read and replied to your previous message. I appreciate very much your efforts to help me, but I was not able to understand your explanation of how to get from my description to the numpy-appropriate one. Thanks again, Mitchell Timin I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From a.mcmorland at auckland.ac.nz Thu May 11 01:02:11 2006 From: a.mcmorland at auckland.ac.nz (Angus McMorland) Date: Thu, 11 May 2006 17:02:11 +1200 Subject: [SciPy-user] using linalg.lstsq (and now optimize.leastsq) In-Reply-To: References: <20060511025059.6332.qmail@web60817.mail.yahoo.com> <4462AAA0.8070404@gmail.com> Message-ID: <4462C553.6000200@auckland.ac.nz> Hi all, Bill Baxter wrote: > Try this: > > # x y > A = array([[ 0., 0.], > [ 0., 1.], > [ 1., 0.], > [ 1., 1.]]) > A = hstack( (A, ones((A.shape[0],1)) )) > z = array([.5,.6,.4,.55]) > c = scipy.linalg.lstsq(A,z)[0] > > Mitchell Timin wrote: > > > I accept that, but I don't see how to put my problem into that > form. Suppose we are given these 4 points only: > > x y z > > 0 0 .5 > > 0 1 .6 > > 1 0 .4 > > 1 1 .55 > > Just for fun, I tried to do this using optimize.leastsq as follows (a method I find conceptually simpler to follow): from numpy import * from scipy.optimize import leastsq def resids( p, pts ): '''returns the residual (distances to the plane for the points in pts) for a plane given by ax + by + cz + d = 0''' (a, b, c, d) = p return (a * pts[:,0] + b* pts[:,1] + c * pts[:,2] + d) \ / sqrt(a**2 + b**2 + c**2) def fit_plane( pts, p0=None ): if p0 == None: p0 = (1,1,1,1) plsq = leastsq( resids, p0, args=(pts,) ) return plsq then: pts = array([[0,0,0.5],[0,1,0.6],[1,0,0.4],[1,1,0.55]]) plfit = fit_plane( pts )[0] print -plfit / plfit[2] # convert to the other form of plane eqn -> [-0.07504592 0.12507655 -1. 0.48748469] print c # from Bill's code -> [-0.075 0.125 0.4875] Is the difference between the two answers indicative of anything wrong (or does it suggest the better applicability of one method over the other)? Cheers, Angus. -- Angus McMorland email a.mcmorland at auckland.ac.nz mobile +64-21-155-4906 PhD Student, Neurophysiology / Multiphoton & Confocal Imaging Physiology, University of Auckland phone +64-9-3737-599 x89707 Armourer, Auckland University Fencing Secretary, Fencing North Inc. From zenguyuno at yahoo.com Thu May 11 01:24:37 2006 From: zenguyuno at yahoo.com (Mitchell Timin) Date: Wed, 10 May 2006 22:24:37 -0700 (PDT) Subject: [SciPy-user] using linalg.lstsq (all good) In-Reply-To: <20060511040045.85101.qmail@web60813.mail.yahoo.com> Message-ID: <20060511052437.57038.qmail@web60817.mail.yahoo.com> Further testing and checking has shown that both Bill and Alan's methods are 100% correct. Thanks, Guys. :) Mitchell Timin I'm proud of http://ANNEvolve.sourceforge.net. If you want to write software, or articles, or do testing, or research for ANNEvolve, let me know. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From robert.kern at gmail.com Thu May 11 01:29:23 2006 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 11 May 2006 00:29:23 -0500 Subject: [SciPy-user] using linalg.lstsq (and now optimize.leastsq) In-Reply-To: <4462C553.6000200@auckland.ac.nz> References: <20060511025059.6332.qmail@web60817.mail.yahoo.com> <4462AAA0.8070404@gmail.com> <4462C553.6000200@auckland.ac.nz> Message-ID: <4462CBB3.9090007@gmail.com> Angus McMorland wrote: > Just for fun, I tried to do this using optimize.leastsq as follows (a > method I find conceptually simpler to follow): > > from numpy import * > from scipy.optimize import leastsq > > def resids( p, pts ): > '''returns the residual (distances to the plane for the > points in pts) for a plane given by ax + by + cz + d = 0''' > > (a, b, c, d) = p > return (a * pts[:,0] + b* pts[:,1] + c * pts[:,2] + d) \ > / sqrt(a**2 + b**2 + c**2) > > def fit_plane( pts, p0=None ): > if p0 == None: > p0 = (1,1,1,1) > plsq = leastsq( resids, p0, args=(pts,) ) > return plsq > > then: > > pts = array([[0,0,0.5],[0,1,0.6],[1,0,0.4],[1,1,0.55]]) > plfit = fit_plane( pts )[0] > print -plfit / plfit[2] # convert to the other form of plane eqn > -> [-0.07504592 0.12507655 -1. 0.48748469] > > print c # from Bill's code > -> [-0.075 0.125 0.4875] > > Is the difference between the two answers indicative of anything wrong > (or does it suggest the better applicability of one method over the other)? It looks like you are doing the orthogonal distance version that I alluded to. It depends on how you are measuring "error". If all of the variables ("input" and "output") are all more or less the same kidn of "thing", and they together form a Euclidean space with an isotropic metric (i.e., distance can be measured simply by sqrt(sum(v*v)) for all vectors, with no weighting), then an appropriate error function is the one you give: the shortest distance between the point and the plane. Statistically speaking, you can frequently apply weights and certain kinds of transformations to your variables to get this condition. Assuming Gaussian errors (otherwise we shouldn't be using least squares), you can derive the appropriate transformations from the covariance matrices of the uncertainties. In some models, however, the "input" variables are significantly different from the "output" variables. Sometimes, they are simply incommensurate and you can't really shove them together to form a real vector space with a metric. Other times, you *could*, but the uncertainties on the "output" variables are so much larger than those on the "input" variables that the only major contribution to the residual is the difference in the "output" variables. In that case, the classic "ordinary least squares" approach outlined in this thread using linalg.lstsq() is appropriate. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From solkaa at gmail.com Thu May 11 05:43:31 2006 From: solkaa at gmail.com (Sergey Dolgov) Date: Thu, 11 May 2006 13:43:31 +0400 Subject: [SciPy-user] longfloat in numpy In-Reply-To: <446235BE.3020009@ieee.org> References: <20060510172803.GB29540@solka-l> <446235BE.3020009@ieee.org> Message-ID: <532c966c0605110243m5ea1c908q801201a3ea82cf2b@mail.gmail.com> On 5/10/06, Travis Oliphant wrote: > > In [14]: print numpy.exp( numpy.array([1000], dtype=numpy.longfloat)) > > [ inf] > > > > In [15]: print numpy.version.version > > 0.9.6 > > > > > > i.e. seems like longfloat "doesn't work" inside array. > > > It does work, the error occurs only in the printing. Apparently the > printing is trying to convert it to a float (which gives the inf) --- I > suspect the right special-casing is not being applied in the printing > code. > > You should file a ticket on the NumPy Trac pages. > I did that, thanks clarifying the issue. -- Sergey From elcorto at gmx.net Thu May 11 05:49:02 2006 From: elcorto at gmx.net (Steve Schmerler) Date: Thu, 11 May 2006 11:49:02 +0200 Subject: [SciPy-user] using linalg.lstsq (and now optimize.leastsq) In-Reply-To: <4462CBB3.9090007@gmail.com> References: <20060511025059.6332.qmail@web60817.mail.yahoo.com> <4462AAA0.8070404@gmail.com> <4462C553.6000200@auckland.ac.nz> <4462CBB3.9090007@gmail.com> Message-ID: <4463088E.2050602@gmx.net> I followed the discussion and browsed the numpy and scipy help to learn about XXX.lstsq (I'm not doing linear algebra in my work though) and just wondered why there are two implementations (numpy.linalg.lstsq and scipy.linalg.lstsq). The numpy version calls lapack_lite.dgelsd, the scipy version geless. Two implementations using different LAPACK routines .... New users doing linalg will probably get confused :) cheers, steve From ryanlists at gmail.com Thu May 11 11:31:12 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Thu, 11 May 2006 11:31:12 -0400 Subject: [SciPy-user] auto-generating documentation in Latex with listings package Message-ID: Is anyone aware of a fairly automate way to generate a latex document containing only the function lines and docstrings for a module typeset using the listings package? Basically, I want only the information that would be returned by typing help functioname in ipython, but I need it passed through the listings package to make a pretty description of my code for my thesis. Ryan From fperez.net at gmail.com Thu May 11 11:40:52 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 11 May 2006 09:40:52 -0600 Subject: [SciPy-user] auto-generating documentation in Latex with listings package In-Reply-To: References: Message-ID: On 5/11/06, Ryan Krauss wrote: > Is anyone aware of a fairly automate way to generate a latex document > containing only the function lines and docstrings for a module typeset > using the listings package? Basically, I want only the information > that would be returned by typing help functioname in ipython, but I > need it passed through the listings package to make a pretty > description of my code for my thesis. Not the most elegant, but if you look at the code in (inside ipython): __IP.shell.inspector.pdef?? __IP.shell.inspector.pdoc?? you'll see what's needed. It would be nice if that code had an option to be called as a library returning strings rather than directly printing it, but it's not really. However, you might be able to hack something by just creating a fake stdout, then manually instantiating ipython, and then calling these methods on this ipython instance for your routines. It will think it's writing to stdout. Caveat: you may need to override the page() routine in genutils so 'less' (or $PAGER) isn't called. Not elegant, but doable in about 1 hour. Cheers, f From fperez.net at gmail.com Thu May 11 13:25:50 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 11 May 2006 11:25:50 -0600 Subject: [SciPy-user] using linalg.lstsq (and now optimize.leastsq) In-Reply-To: <4463088E.2050602@gmx.net> References: <20060511025059.6332.qmail@web60817.mail.yahoo.com> <4462AAA0.8070404@gmail.com> <4462C553.6000200@auckland.ac.nz> <4462CBB3.9090007@gmail.com> <4463088E.2050602@gmx.net> Message-ID: On 5/11/06, Steve Schmerler wrote: > I followed the discussion and browsed the numpy and scipy help to learn > about XXX.lstsq (I'm not doing linear algebra in my work though) and > just wondered why there are two implementations (numpy.linalg.lstsq and > scipy.linalg.lstsq). The numpy version calls lapack_lite.dgelsd, the > scipy version geless. Two implementations using different LAPACK > routines .... New users doing linalg will probably get confused :) On a related note, there is a similar situation with the SVD calls in numpy and scipy. The code in both is fairly different (I need to go through this in more detail), and more of a problem, the scipy one does not expose the option for the 'thin' SVD. When using this on very 'tall' or 'wide' matrices (nrows >> or << ncol), the scipy svd simply runs out of RAM, while the numpy one can still produce useful results thanks to the 'thin' option. Ideally, all functions subsumed by scipy from numpy should maintain the same calling form, and simply be better performing thanks to extra lapack/whatever functionality. Given how I'm not attaching a patch to this message, I won't really complain much :) But it's still worth noting. Cheers, f From fredantispam at free.fr Thu May 11 15:07:15 2006 From: fredantispam at free.fr (fred) Date: Thu, 11 May 2006 21:07:15 +0200 Subject: [SciPy-user] derivative of bessel jn Message-ID: <44638B63.80605@free.fr> Hi all, I want to use the (first) derivative of bessel jn(n,x). How can I do this ? Cheers, -- Fred. From jdhunter at ace.bsd.uchicago.edu Thu May 11 15:11:22 2006 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Thu, 11 May 2006 14:11:22 -0500 Subject: [SciPy-user] SoC - pymulae In-Reply-To: <63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com> ("Edin =?iso-8859-1?q?Salkovi=A7"'s?= message of "Wed, 10 May 2006 11:36:23 +0200") References: <63eb7fa90605050548x50dc7765kdc479120f83d6406@mail.gmail.com> <91cf711d0605050650u465abce7s2f586b6a49e0106e@mail.gmail.com> <445B7BF3.6000706@gmail.com> <445BEBE9.9040107@bigpond.net.au> <445BED80.3050000@bigpond.net.au> <63eb7fa90605060305w7faf676dwd4922fbc120fec4e@mail.gmail.com> <4460BA8E.8000307@gmail.com> <63eb7fa90605100236y6afb3bect23378d176e4a739e@mail.gmail.com> Message-ID: <87r7301in9.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Edin" == Edin Salkovi? writes: >> Actually, now that I think about, "mathtext" is just about >> perfect. Edin> You too? This must be contageous ;) Edin> OK. pymulae is dead. Long live mathtext! Edin> After getting feedback (other thread) from John, I think Edin> that the best thing to do, as John pointed out, is to work Edin> on existing mathtext code. "mathtext" may be just about Edin> perfect, but mathtext is not :) Edin> Should I change the application for SoC also? If so, can you Edin> Robert (or John) set my application to be editable. Yes, you need to rewrite the proposal and narrow the focus to the mathtext enhancements I described I described in the previous email. A number of reviewers felt your proposal was too ambitious, and were concerned given your other job that you would not have the resources to complete it. I agreed to be the mentor on a revised version of this project, and I think your submission should now be unlocked for an editing. Please address these two concerns, tighten the focus to *specific* enhancements you'll be making to mathtext, post it here for a quick review, and then resubmit to the google site. JDH From fperez.net at gmail.com Thu May 11 16:00:09 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Thu, 11 May 2006 14:00:09 -0600 Subject: [SciPy-user] Discussion with Guido: an idea for scipy'06 Message-ID: Hi all, I think the presence of Guido as keynote speaker for scipy'06 is something we should try to benefit of as much as possible. I figured a good way to do that would be to set aside a one hour period, at the end of the first day (his keynote is that day), to hold a discussion with him on all aspects of Python which are relevant to us as a group of users, and which he may contribute feedback to, incorporate into future versions, etc. I floated the idea privately by some people and got no negative (and some positive) feedback, so I'm now putting it out on the lists. If you all think it's a waste of time, it's easy to just kill the thing. Since I know that many on this list may not be able to attend the conference, but may still have valuable ideas to contribute, I thought the best way to proceed (assuming people want to do this) would be to prepare the key points for discussion on a public forum, true to the spirit of open source collaboration. For this purpose, I've just created a stub page in a hurry: http://scipy.org/SciPy06DiscussionWithGuido Feel free to contribute to it. Hopefully there (and on-list) we can sort out interesting questions, and we can contact Guido a few days before the conference so he has a chance to read it in advance. Cheers, f ps - I didn't link to this page from anywhere else on the wiki, so outside of this message it won't be easy to find. I just didn't feel comfortable touching the more 'visible' pages, but if this idea floats, we should make it easier to find by linking to it on one of the conference pages. From nwagner at iam.uni-stuttgart.de Thu May 11 16:19:11 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Thu, 11 May 2006 22:19:11 +0200 Subject: [SciPy-user] derivative of bessel jn In-Reply-To: <44638B63.80605@free.fr> References: <44638B63.80605@free.fr> Message-ID: On Thu, 11 May 2006 21:07:15 +0200 fred wrote: > Hi all, > > I want to use the (first) derivative of bessel jn(n,x). > > How can I do this ? > > Cheers, > > -- >Fred. > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user You can use recurrence formulas - See the book by Watson A Treatise on the theory of Bessel functions or look at http://mathworld.wolfram.com/BesselFunctionoftheFirstKind.html http://en.wikipedia.org/wiki/Bessel_function Nils From oliphant at ee.byu.edu Thu May 11 16:21:56 2006 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 11 May 2006 14:21:56 -0600 Subject: [SciPy-user] derivative of bessel jn In-Reply-To: <44638B63.80605@free.fr> References: <44638B63.80605@free.fr> Message-ID: <44639CE4.4040005@ee.byu.edu> fred wrote: >Hi all, > >I want to use the (first) derivative of bessel jn(n,x). > >How can I do this ? > > > >>> info(scipy.special.jvp) jvp(v, z, n=1) Return the nth derivative of Jv(z) with respect to z. -Travis P.S. Here's the source code: >>> source(scipy.special.jvp) def jvp(v,z,n=1): """Return the nth derivative of Jv(z) with respect to z. """ if not isinstance(n,types.IntType) or (n<0): raise ValueError, "n must be a non-negative integer." if n == 0: return jv(v,z) else: return (jvp(v-1,z,n-1) - jvp(v+1,z,n-1))/2.0 From fredantispam at free.fr Thu May 11 18:07:30 2006 From: fredantispam at free.fr (fred) Date: Fri, 12 May 2006 00:07:30 +0200 Subject: [SciPy-user] derivative of bessel jn In-Reply-To: References: <44638B63.80605@free.fr> Message-ID: <4463B5A2.3040006@free.fr> Nils Wagner a ?crit : > You can use recurrence formulas - See the book by Watson Ok, thank you Nils & Travis. -- Dr. Fred. From fonnesbeck at gmail.com Thu May 11 18:25:29 2006 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Thu, 11 May 2006 18:25:29 -0400 Subject: [SciPy-user] OS X binary installers Message-ID: <723eb6930605111525m1718b70al19cbca2aabe31f22@mail.gmail.com> I am now distributing Mac binary installers for both numpy and scipy in a "meta-package" along with a couple other modules (Matplotlib, PyMC). This will hopefully resolve some of the version conflicts that some have been experiencing with my builds of numpy and scipy that were not compiled together. These builds are recent svn checkouts, and I hope to update them approximately weekly. In addition, now that I have a new dual core Intel Mac Mini, I am distributing both PPC and Intel versions. You can download either at http://trichech.us in the OS X downloads section. Chris -- Chris Fonnesbeck + Atlanta, GA + http://trichech.us -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcdevlin at bc.edu Thu May 11 23:21:44 2006 From: tcdevlin at bc.edu (TCDevlin) Date: Thu, 11 May 2006 23:21:44 -0400 Subject: [SciPy-user] OS X binary installers Message-ID: After installing your packages. import linsolve.umfpack -> failed: Failure linking new module: / Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- packages/scipy/sparse/sparsetools.so: Library not loaded: /usr/local/ lib/libg2c.0.dylib Referenced from: /Library/Frameworks/Python.framework/Versions/2.4/ lib/python2.4/site-packages/scipy/sparse/sparsetools.so Reason: image not found Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/scipy/linalg/__init__.py", line 8, in ? from basic import * File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/scipy/linalg/basic.py", line 17, in ? from flinalg import get_flinalg_funcs File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/scipy/linalg/flinalg.py", line 15, in ? from numpy.distutils.misc_util import PostponedException ImportError: cannot import name PostponedException From fonnesbeck at gmail.com Fri May 12 07:45:06 2006 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Fri, 12 May 2006 07:45:06 -0400 Subject: [SciPy-user] OS X binary installers In-Reply-To: References: Message-ID: <723eb6930605120445v79356701x385266163dc8a89@mail.gmail.com> On 5/11/06, TCDevlin wrote: > After installing your packages. > > import linsolve.umfpack -> failed: Failure linking new module: / > Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- > packages/scipy/sparse/sparsetools.so: Library not loaded: /usr/local/ > lib/libg2c.0.dylib Oops ... bad linking. Are you on PPC or Intel? C. -- Chris Fonnesbeck + Atlanta, GA + http://trichech.us From tcdevlin at bc.edu Fri May 12 08:32:07 2006 From: tcdevlin at bc.edu (TCDevlin) Date: Fri, 12 May 2006 08:32:07 -0400 Subject: [SciPy-user] OS X binary installers Message-ID: I'm on PPC 10.4.6 MACPYTHON 2.4.3 I think it is a "universal" build. I have g77 from FINK. I think that this only has the static libg2c library. Newest XCode. iPython latest. ------ Robert Herbstzuber TCDevlin Covering::Geology,Slavic Languages,Black Studies,Music,IML,Langauge Lab,Fine Arts,Mc Mullen Museum Devlin Hall 316B Phone: 617-552-6305 Email:tcdevlin at bc.edu ------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryanlists at gmail.com Fri May 12 10:01:59 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Fri, 12 May 2006 10:01:59 -0400 Subject: [SciPy-user] quantitative data on the beauty of Python Message-ID: I am hopefully finishing up my thesis in mechanical engineering, working in vibrations and feedback control of flexible structures/robots. Part of my thesis is a chapter on how creating my software in Python is a thing of beauty and so much better to write than any non-object oreinted language. My advisor doesn't really want to count this as a contribution because it is just my opinion. I know many of you share this opinion (I think I read a part of some document where Travis was saying how much he loved Python over other languages and how he felt maybe a little embarassaed to say such affectionate things about a programming language - I feel the same way. My wife doesn't appreciate it when I tell her she is more beautiful than Python. But to me, that is saying a lot). Anyways, my primary claim in this area is that programming in Python is faster and easier than programming in those other languages. Is anyone aware of any quantitative data on how long it takes to create code that accomplishes some scientific task in Python versus other languages? Thanks, Ryan From nmarais at sun.ac.za Fri May 12 11:26:08 2006 From: nmarais at sun.ac.za (Neilen Marais) Date: Fri, 12 May 2006 17:26:08 +0200 Subject: [SciPy-user] Sparse matrix usage, documentation. Message-ID: Hi The documentation for the sparse matrix classes seem to be, well, sparse. Does documentation exist somewhere I'm missing, or is it simply to early in the development process for much documentation to be around? I may be able to commit some once I understand what's going on though :) Right now I'd like to know more about the different sparse matrix types. I understand pretty much what coo, csc, and csr matrices are. From the docstrings I can more or less figure out what dok_matrix is, but what are dod_matrix and lnk_matrix? For naive matrix filling (i.e. if you don't know the sparsity pattern before hand) dok_matrix seems to be the best choice. Are there other useful formats for this purpose? When solving the matrix using iterative techniques, would it be better to convert it to one of the other sparse formats first, or can the dok matrix be solved efficiently itself? Thanks Neilen -- you know its kind of tragic we live in the new world but we've lost the magic -- Battery 9 (www.battery9.co.za) From gnchen at cortechs.net Fri May 12 11:37:58 2006 From: gnchen at cortechs.net (Gennan Chen) Date: Fri, 12 May 2006 08:37:58 -0700 Subject: [SciPy-user] quantitative data on the beauty of Python In-Reply-To: References: Message-ID: For faster prototyping, I still believe Matlab is still a bit better due to its tighter visualization integration. But I have no doubt if you want to have a good design and tight control on code and speed, numpy+python just make our life way more easier. Gen On May 12, 2006, at 7:01 AM, Ryan Krauss wrote: > I am hopefully finishing up my thesis in mechanical engineering, > working in vibrations and feedback control of flexible > structures/robots. Part of my thesis is a chapter on how creating my > software in Python is a thing of beauty and so much better to write > than any non-object oreinted language. My advisor doesn't really want > to count this as a contribution because it is just my opinion. I know > many of you share this opinion (I think I read a part of some document > where Travis was saying how much he loved Python over other languages > and how he felt maybe a little embarassaed to say such affectionate > things about a programming language - I feel the same way. My wife > doesn't appreciate it when I tell her she is more beautiful than > Python. But to me, that is saying a lot). > > Anyways, my primary claim in this area is that programming in Python > is faster and easier than programming in those other languages. Is > anyone aware of any quantitative data on how long it takes to create > code that accomplishes some scientific task in Python versus other > languages? > > Thanks, > > Ryan > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From rclewley at cam.cornell.edu Fri May 12 12:38:55 2006 From: rclewley at cam.cornell.edu (Robert Clewley) Date: Fri, 12 May 2006 12:38:55 -0400 (EDT) Subject: [SciPy-user] quantitative data on the beauty of Python In-Reply-To: References: Message-ID: Ryan, The only thing close that I'm familiar with is Prechelt's article (ref. [jccpprt] on his page), linked to from http://wiki.python.org/moin/LanguageComparisons However, it's not about scientific coding, but there is some comparative data about productivity near the end. Someone also asked essentially the same Q in 2002 and nothing academic showed up except for what I regurgitating. IMHO it's nice to have a "fun" chapter if you're already set with lots of solid material for the rest of the thesis, but I would tend to agree with your supervisor ;) Good luck with it! -Rob From jdc at uwo.ca Fri May 12 13:16:34 2006 From: jdc at uwo.ca (Dan Christensen) Date: Fri, 12 May 2006 13:16:34 -0400 Subject: [SciPy-user] characteristic polynomials? Message-ID: <87ejyzduz1.fsf@uwo.ca> Can scipy compute the characteristic polynomial of a matrix? I guess I could compute the eigenvalues lambda_i, and then multiply together polynomials of the form x - lambda_i, but I was wondering if there was a more direct way. Thanks, Dan From schofield at ftw.at Sat May 13 07:37:24 2006 From: schofield at ftw.at (Ed Schofield) Date: Sat, 13 May 2006 13:37:24 +0200 Subject: [SciPy-user] Sparse matrix usage, documentation. In-Reply-To: References: Message-ID: <4465C4F4.50905@ftw.at> Neilen Marais wrote: > Hi > > The documentation for the sparse matrix classes seem to be, well, sparse. > Does documentation exist somewhere I'm missing, or is it simply to early > in the development process for much documentation to be around? I may be > able to commit some once I understand what's going on though :) > I've just added some basic documentation to SVN, accessible from the prompt with help(sparse). I'd be very grateful if you could contribute any more examples. Do you think it should take the form of a wiki page, or as an html or pdf file in the source tree? > Right now I'd like to know more about the different sparse matrix types. > > I understand pretty much what coo, csc, and csr matrices are. From the > docstrings I can more or less figure out what dok_matrix is, but what are > dod_matrix and lnk_matrix? > dod_matrix was dead code; I've now deleted it in SVN. > For naive matrix filling (i.e. if you don't know the sparsity pattern > before hand) dok_matrix seems to be the best choice. Are there other > useful formats for this purpose? > lil_matrix is a sparse matrix stored as a list of lists. It should allow efficient construction of matrices, like dok_matrix, but with more efficient conversion to CSR format and better support for slicing and NumPy-like fancy indexing. So I'd recommend using lil_matrix for construction. > When solving the matrix using iterative techniques, would it be better to > convert it to one of the other sparse formats first, or can the dok matrix be > solved efficiently itself? > Yes, you probably need to convert DOK and LIL matrices to either CSR or CSC first. If you don't, it should either convert them internally anyway or raise an exception :) -- Ed From fperez.net at gmail.com Sat May 13 10:04:33 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 13 May 2006 08:04:33 -0600 Subject: [SciPy-user] Sparse matrix usage, documentation. In-Reply-To: <4465C4F4.50905@ftw.at> References: <4465C4F4.50905@ftw.at> Message-ID: On 5/13/06, Ed Schofield wrote: > Neilen Marais wrote: > > Hi > > > > The documentation for the sparse matrix classes seem to be, well, sparse. > > Does documentation exist somewhere I'm missing, or is it simply to early > > in the development process for much documentation to be around? I may be > > able to commit some once I understand what's going on though :) > > > I've just added some basic documentation to SVN, accessible from the > prompt with help(sparse). I'd be very grateful if you could contribute > any more examples. Do you think it should take the form of a wiki page, > or as an html or pdf file in the source tree? Regardless of how it gets documented, I'd suggest getting into the habit of: a) Having at least usable docstrings. Docstrings are the 'first line of defense' for finding out about libraries, they are the standard python documenting tool, they get picked up by automatic API generation tools (pydoc being the most basic of the lot), etc. In addition, I know many of us (though I'm obviously biased) to a lot of library-discovery-by-tab-and-?-key in ipython. The combination of tabbing my way around a module, along with modname.foo*? and modname.foo_what_I_want? can really zoom in surprisingly quickly into the relevant information, if a library has sensible names and decent docstrings. b) If further information is put on HTML/wiki/PDF formats, I'd suggest having at the end of the relevant dosctrings, something like: For further details, see: http://scipy.org/apidocs/somelib/foo.html http://scipy.org/apidocs/somelib/foo_complete.pdf It would be trivial for future GUI-based environments to parse docstrings for url-looking strings and make them available on a browser. In fact, even today, gnome's terminal already makes such strings into hyperlinks automatically, which you can open by right-clicking on them (a menu pops up with 'open link' as an option). Just a suggestion. Cheers, f ps - Obviously this is the tip of the iceberg, but I don't want to get started on a long disucssion of documentation standards, example inclusion, special __www__ attributes, etc. From schofield at ftw.at Sat May 13 12:05:05 2006 From: schofield at ftw.at (Ed Schofield) Date: Sat, 13 May 2006 18:05:05 +0200 Subject: [SciPy-user] Sparse matrix usage, documentation. In-Reply-To: References: <4465C4F4.50905@ftw.at> Message-ID: <446603B1.8030908@ftw.at> Fernando Perez wrote: > On 5/13/06, Ed Schofield wrote: > >> Neilen Marais wrote: >> >>> Hi >>> >>> The documentation for the sparse matrix classes seem to be, well, sparse. >>> Does documentation exist somewhere I'm missing, or is it simply to early >>> in the development process for much documentation to be around? I may be >>> able to commit some once I understand what's going on though :) >>> >>> >> I've just added some basic documentation to SVN, accessible from the >> prompt with help(sparse). I'd be very grateful if you could contribute >> any more examples. Do you think it should take the form of a wiki page, >> or as an html or pdf file in the source tree? >> > > Regardless of how it gets documented, I'd suggest getting into the habit of: > > a) Having at least usable docstrings. Docstrings are the 'first line > of defense' for finding out about libraries, they are the standard > python documenting tool, they get picked up by automatic API > generation tools (pydoc being the most basic of the lot), etc. In > addition, I know many of us (though I'm obviously biased) to a lot of > library-discovery-by-tab-and-?-key in ipython. > > The combination of tabbing my way around a module, along with > modname.foo*? and modname.foo_what_I_want? can really zoom in > surprisingly quickly into the relevant information, if a library has > sensible names and decent docstrings. > Yes, that sounds sensible. I actually write a lot of docstrings, even for my personal use; I find writing docstrings first helps me to write the code, and it's the kind of documentation I find most convenient to use too. Especially with IPython's tab completion ;) -- Ed From nztideman at yahoo.co.nz Sun May 14 01:12:03 2006 From: nztideman at yahoo.co.nz (Derek Goring) Date: Sun, 14 May 2006 17:12:03 +1200 (NZST) Subject: [SciPy-user] Orthogonal Wavelets Message-ID: <20060514051203.6004.qmail@web53905.mail.yahoo.com> I'm trying out SciPy as a possible replacement for Matlab on my Linux box. One of the main tools I need is orthogonal wavelets decomposition and reconstruction. I've looked around and not found a package in SciPy. Is there one that I've missed? Actually, I have a set of Fortran routines that I developed using CVF 6.6 in Win XP. I've ported that to Linux using g95. So, if a package is not available, writing a wrapper may be a good first project in SciPy. Or am I biting off more than I can chew? Cheers Derek ________________ Derek Goring Mulgor Consulting Ltd 24 Brockworth Place Christchurch, New Zealand Phone: 64 3 343 5400 Mobile: 64 272 777 639 Website: www.mulgor.co.nz Send instant messages to your online friends http://au.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Sun May 14 01:25:38 2006 From: robert.kern at gmail.com (Robert Kern) Date: Sun, 14 May 2006 00:25:38 -0500 Subject: [SciPy-user] Orthogonal Wavelets In-Reply-To: <20060514051203.6004.qmail@web53905.mail.yahoo.com> References: <20060514051203.6004.qmail@web53905.mail.yahoo.com> Message-ID: <4466BF52.3020002@gmail.com> Derek Goring wrote: > I'm trying out SciPy as a possible replacement for Matlab on my Linux box. > > One of the main tools I need is orthogonal wavelets decomposition and > reconstruction. > I've looked around and not found a package in SciPy. Is there one that > I've missed? Check the following: http://wavelets.scipy.org/ http://projects.scipy.org/scipy/scipy/browser/trunk/Lib/signal/wavelets.py I don't know if they have exactly what you're looking for, though. > Actually, I have a set of Fortran routines that I developed using CVF > 6.6 in Win XP. > I've ported that to Linux using g95. > So, if a package is not available, writing a wrapper may be a good first > project in SciPy. > Or am I biting off more than I can chew? If you can license them under the terms of the Scipy license, perhaps. I would like to avoid putting Fortran 90 into Scipy, though. The currently available free compilers suck suck suck suck suck suck suck. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From nztideman at yahoo.co.nz Sun May 14 03:17:24 2006 From: nztideman at yahoo.co.nz (Derek Goring) Date: Sun, 14 May 2006 19:17:24 +1200 (NZST) Subject: [SciPy-user] Orthogonal Wavelets In-Reply-To: <4466BF52.3020002@gmail.com> Message-ID: <20060514071724.74829.qmail@web53911.mail.yahoo.com> Thanks Robert Seems like they're not quite there yet. In the meantime, I might try running my Fortran routines from within SciPy (once I learn how). Cheers Derek Robert Kern wrote: Derek Goring wrote: > I'm trying out SciPy as a possible replacement for Matlab on my Linux box. > > One of the main tools I need is orthogonal wavelets decomposition and > reconstruction. > I've looked around and not found a package in SciPy. Is there one that > I've missed? Check the following: http://wavelets.scipy.org/ http://projects.scipy.org/scipy/scipy/browser/trunk/Lib/signal/wavelets.py I don't know if they have exactly what you're looking for, though. > Actually, I have a set of Fortran routines that I developed using CVF > 6.6 in Win XP. > I've ported that to Linux using g95. > So, if a package is not available, writing a wrapper may be a good first > project in SciPy. > Or am I biting off more than I can chew? If you can license them under the terms of the Scipy license, perhaps. I would like to avoid putting Fortran 90 into Scipy, though. The currently available free compilers suck suck suck suck suck suck suck. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user ________________ Derek Goring Mulgor Consulting Ltd 24 Brockworth Place Christchurch, New Zealand Phone: 64 3 343 5400 Mobile: 64 272 777 639 Website: www.mulgor.co.nz Send instant messages to your online friends http://au.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From gruben at bigpond.net.au Sun May 14 07:19:40 2006 From: gruben at bigpond.net.au (Gary Ruben) Date: Sun, 14 May 2006 21:19:40 +1000 Subject: [SciPy-user] Orthogonal Wavelets In-Reply-To: <20060514071724.74829.qmail@web53911.mail.yahoo.com> References: <20060514071724.74829.qmail@web53911.mail.yahoo.com> Message-ID: <4467124C.8020801@bigpond.net.au> Hi Derek, I don't know if this is useful, but here's another wavelet-related package: http://www.pybytes.com/pywavelets/ Gary R. Derek Goring wrote: > Thanks Robert > > Seems like they're not quite there yet. > In the meantime, I might try running my Fortran routines from within > SciPy (once I learn how). > > Cheers > Derek From aisaac at american.edu Sun May 14 12:51:09 2006 From: aisaac at american.edu (Alan G Isaac) Date: Sun, 14 May 2006 12:51:09 -0400 Subject: [SciPy-user] Orthogonal Wavelets In-Reply-To: <4467124C.8020801@bigpond.net.au> References: <20060514071724.74829.qmail@web53911.mail.yahoo.com><4467124C.8020801@bigpond.net.au> Message-ID: On Sun, 14 May 2006, Gary Ruben apparently wrote: > here's another wavelet-related package: > http://www.pybytes.com/pywavelets/ SciPy seems an obvious location for this module. Is it not part of SciPy for any particular reason? Lack of author interest? Thanks, Alan Isaac From fperez.net at gmail.com Sun May 14 15:08:12 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Sun, 14 May 2006 13:08:12 -0600 Subject: [SciPy-user] Orthogonal Wavelets In-Reply-To: References: <20060514071724.74829.qmail@web53911.mail.yahoo.com> <4467124C.8020801@bigpond.net.au> Message-ID: On 5/14/06, Alan G Isaac wrote: > On Sun, 14 May 2006, Gary Ruben apparently wrote: > > here's another wavelet-related package: > > http://www.pybytes.com/pywavelets/ > > SciPy seems an obvious location for this module. > Is it not part of SciPy for any particular reason? > Lack of author interest? No worries: just lack of time. Matthew Brett and I started working on the wavelets.scipy site a while ago and put up some working 1-d code there, based on previous libraries contributed by a colleague. When I saw Filip's code, I contacted him and he ran a very nice and detailed comparison between the two libraries. His code has better performance and memory properties than what we used as a lower layer, so I'm all for a merge (esp. given how Matthew and I have near-zero time to push this forward). This week I'd talked to Matthew about it, and he agreed for us to contact Filip and suggest a merge. It had been on my todo list but I just hadn't gotten around to doing it. So if Filip is interested, we can probably merge over his code and use the already existing resources provided by wavelets.scipy.org (Trac, website, bandwidth, etc.). There's no point in having two libraries doing the same thing, and my original intent with the wavelets at scipy site was just to get the ball rolling to get community involvement, not to work on it as an end to end project (I have more than enough of that with ipython). I'll get in touch with Filip off-list to coordinate whether he wants to do this, and hopefully that will serve as a good base layer for future wavelets work for scipy. Cheers, f From nztideman at yahoo.co.nz Sun May 14 23:40:14 2006 From: nztideman at yahoo.co.nz (Derek Goring) Date: Mon, 15 May 2006 15:40:14 +1200 (NZST) Subject: [SciPy-user] Orthogonal Wavelets In-Reply-To: <4467124C.8020801@bigpond.net.au> Message-ID: <20060515034014.3077.qmail@web53908.mail.yahoo.com> Yes, I found http://www.pybytes.com/pywavelets/ earlier (from Google). Everybody seems to point to it, but the link appears to be broken. I have a lot of experience using orthogonal and continuous wavelets for real-time processing of sea-level signals to extract long waves such as far infra gravity, rissaga and tsunami waves (periods 3 to 96 minutes). eg, see: http://www.mulgor.co.nz/TongaTsu06/ I'd be happy to test wavelet routines on my data in SciPy. Derek Gary Ruben wrote: Hi Derek, I don't know if this is useful, but here's another wavelet-related package: http://www.pybytes.com/pywavelets/ Gary R. Derek Goring wrote: > Thanks Robert > > Seems like they're not quite there yet. > In the meantime, I might try running my Fortran routines from within > SciPy (once I learn how). > > Cheers > Derek _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user ________________ Derek Goring Mulgor Consulting Ltd 24 Brockworth Place Christchurch, New Zealand Phone: 64 3 343 5400 Mobile: 64 272 777 639 Website: www.mulgor.co.nz Send instant messages to your online friends http://au.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From webb.sprague at gmail.com Sun May 14 23:42:49 2006 From: webb.sprague at gmail.com (Webb Sprague) Date: Sun, 14 May 2006 20:42:49 -0700 Subject: [SciPy-user] Graceful concatenation to a "zero" dimension narray? Message-ID: Is there a nice way to make N.array([0.0,1.0,2.0,3.0]) into N.array([-1.0,0.0, 1.0,2.0,3.0, 4.0])? With regular lists in Python, I would write [-1.0] +[0.0,1.0,2.0,3.0] + [4.0]. I can only imagine multiple line things with reshape and friends, but maybe there is a better answer. Thanks! From robert.kern at gmail.com Sun May 14 23:46:12 2006 From: robert.kern at gmail.com (Robert Kern) Date: Sun, 14 May 2006 22:46:12 -0500 Subject: [SciPy-user] Graceful concatenation to a "zero" dimension narray? In-Reply-To: References: Message-ID: <4467F984.1050607@gmail.com> Webb Sprague wrote: > Is there a nice way to make N.array([0.0,1.0,2.0,3.0]) into > N.array([-1.0,0.0, 1.0,2.0,3.0, 4.0])? With regular lists in Python, > I would write [-1.0] +[0.0,1.0,2.0,3.0] + [4.0]. I can only imagine > multiple line things with reshape and friends, but maybe there is a > better answer. Use hstack(). Also, you will probably want to look at its friends, vstack() and column_stack(). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From webb.sprague at gmail.com Sun May 14 23:49:47 2006 From: webb.sprague at gmail.com (Webb Sprague) Date: Sun, 14 May 2006 20:49:47 -0700 Subject: [SciPy-user] Graceful concatenation to a "zero" dimension narray? In-Reply-To: <4467F984.1050607@gmail.com> References: <4467F984.1050607@gmail.com> Message-ID: hstack? Huh. I will indeed. Thx! On 5/14/06, Robert Kern wrote: > Webb Sprague wrote: > > Is there a nice way to make N.array([0.0,1.0,2.0,3.0]) into > > N.array([-1.0,0.0, 1.0,2.0,3.0, 4.0])? With regular lists in Python, > > I would write [-1.0] +[0.0,1.0,2.0,3.0] + [4.0]. I can only imagine > > multiple line things with reshape and friends, but maybe there is a > > better answer. > > Use hstack(). Also, you will probably want to look at its friends, vstack() and > column_stack(). > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret it as though it had > an underlying truth." > -- Umberto Eco > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From david at ar.media.kyoto-u.ac.jp Mon May 15 02:40:23 2006 From: david at ar.media.kyoto-u.ac.jp (David Cournapeau) Date: Mon, 15 May 2006 15:40:23 +0900 Subject: [SciPy-user] How to profile scipy code ? Message-ID: <44682257.5010008@ar.media.kyoto-u.ac.jp> Hi there, I was wondering if other people had any insight on how to efficiently profile scipy code. What I want is simply being able to see the bottleneck of one algorithm, see if it can be easily improved (using other algorithms in scipy, or using C extensions, etc...), and see the impact of the improvement. Under matlab, the profiler, quite rudimentary, works perfectly for this task; for people who don't know matlab's profiler, to profile one script, you simply do profile on; function_to_profile() profile off; profile report profile report call creates a html report. The report gives cumulative time, and you can easily browse to the code of any called function (as long it is a matlab file, and not a "native" compiled file). Is there anything like this for python ? David From fullung at gmail.com Mon May 15 02:46:32 2006 From: fullung at gmail.com (Albert Strasheim) Date: Mon, 15 May 2006 08:46:32 +0200 Subject: [SciPy-user] Graceful concatenation to a "zero" dimension narray? In-Reply-To: Message-ID: <003f01c677eb$4dad22d0$0502010a@dsp.sun.ac.za> My attempt: In [1]: import numpy as N In [3]: x = N.array([-1.]) In [4]: y = N.array([0.,1.,2.,3.]) In [5]: z = N.array([4.]) In [6]: N.hstack([x,y,z]) Out[6]: array([-1., 0., 1., 2., 3., 4.]) See also vstack, dstack and column_stack. > -----Original Message----- > From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] > On Behalf Of Webb Sprague > Sent: 15 May 2006 05:43 > To: SciPy Users List > Subject: [SciPy-user] Graceful concatenation to a "zero" dimension narray? > > Is there a nice way to make N.array([0.0,1.0,2.0,3.0]) into > N.array([-1.0,0.0, 1.0,2.0,3.0, 4.0])? With regular lists in Python, > I would write [-1.0] +[0.0,1.0,2.0,3.0] + [4.0]. I can only imagine > multiple line things with reshape and friends, but maybe there is a > better answer. > > Thanks! From nwagner at iam.uni-stuttgart.de Mon May 15 03:34:05 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Mon, 15 May 2006 09:34:05 +0200 Subject: [SciPy-user] characteristic polynomials? In-Reply-To: <87ejyzduz1.fsf@uwo.ca> References: <87ejyzduz1.fsf@uwo.ca> Message-ID: <44682EED.6030504@iam.uni-stuttgart.de> Dan Christensen wrote: > Can scipy compute the characteristic polynomial of a matrix? I guess > I could compute the eigenvalues lambda_i, and then multiply together > polynomials of the form x - lambda_i, but I was wondering if there > was a more direct way. > > Thanks, > > Dan > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > Hi Dan, Just curious - why are you interested in the characteristic polynomial ? Nils From elcorto at gmx.net Mon May 15 04:00:10 2006 From: elcorto at gmx.net (Steve Schmerler) Date: Mon, 15 May 2006 10:00:10 +0200 Subject: [SciPy-user] How to profile scipy code ? In-Reply-To: <44682257.5010008@ar.media.kyoto-u.ac.jp> References: <44682257.5010008@ar.media.kyoto-u.ac.jp> Message-ID: <4468350A.2000702@gmx.net> David Cournapeau wrote: > Hi there, > > I was wondering if other people had any insight on how to > efficiently profile scipy code. What I want is simply being able to see > the bottleneck of one algorithm, see if it can be easily improved (using > other algorithms in scipy, or using C extensions, etc...), and see the > impact of the improvement. > Under matlab, the profiler, quite rudimentary, works perfectly for > this task; for people who don't know matlab's profiler, to profile one > script, you simply do > > profile on; > function_to_profile() > profile off; > profile report > > profile report call creates a html report. The report gives cumulative > time, and you can easily browse to the code of any called function (as > long it is a matlab file, and not a "native" compiled file). > > Is there anything like this for python ? > > David > Try the Python profiler. (http://docs.python.org/lib/profile.html) -- Random number generation is the art of producing pure gibberish as quickly as possible. From elcorto at gmx.net Mon May 15 04:10:21 2006 From: elcorto at gmx.net (Steve Schmerler) Date: Mon, 15 May 2006 10:10:21 +0200 Subject: [SciPy-user] numpy build fails In-Reply-To: <44682257.5010008@ar.media.kyoto-u.ac.jp> References: <44682257.5010008@ar.media.kyoto-u.ac.jp> Message-ID: <4468376D.2020808@gmx.net> Hi The latest numpy svn version fails to build: =================================================================================== [...] sh: -c: line 1: syntax error near unexpected token `(' sh: -c: line 1: `( f95 --version ; echo $? > (65, '/tmp/tmpDqORY4') ) > (64, '/tmp/tmpHw36At') 2>&1' coercing to Unicode: need string or buffer, tuple found customize GnuFCompiler sh: -c: line 1: syntax error near unexpected token `(' sh: -c: line 1: `( /usr/bin/g77 --version ; echo $? > (67, '/tmp/tmpLbSCrf') ) > (66, '/tmp/tmpXq_iqw') 2>&1' Traceback (most recent call last): File "setup.py", line 84, in ? setup_package() File "setup.py", line 77, in setup_package configuration=configuration ) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/core.py", line 170, in setup return old_setup(**new_attr) File "/usr/lib/python2.3/distutils/core.py", line 149, in setup dist.run_commands() File "/usr/lib/python2.3/distutils/dist.py", line 907, in run_commands self.run_command(cmd) File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command cmd_obj.run() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/install.py", line 11, in run r = old_install.run(self) File "/usr/lib/python2.3/distutils/command/install.py", line 506, in run self.run_command('build') File "/usr/lib/python2.3/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command cmd_obj.run() File "/usr/lib/python2.3/distutils/command/build.py", line 107, in run self.run_command(cmd_name) File "/usr/lib/python2.3/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command cmd_obj.run() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", line 87, in run self.build_sources() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", line 106, in build_sources self.build_extension_sources(ext) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", line 212, in build_extension_sources sources = self.generate_sources(sources, ext) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", line 270, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 35, in generate_config_h library_dirs = default_lib_dirs) File "/usr/lib/python2.3/distutils/command/config.py", line 278, in try_run self._check_compiler() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/config.py", line 35, in _check_compiler self.fcompiler.customize(self.distribution) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/__init__.py", line 298, in customize oflags = self.__get_flags(self.get_flags_opt,'FOPT',(conf,'opt')) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/__init__.py", line 515, in __get_flags var = command() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/gnu.py", line 122, in get_flags_opt if self.get_version()<='3.3.3': File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/ccompiler.py", line 251, in CCompiler_get_version status, output = exec_command(cmd,use_tee=0) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", line 255, in exec_command use_tee=use_tee, File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", line 304, in _exec_command_posix f = open(stsfile,'r') TypeError: coercing to Unicode: need string or buffer, tuple found =================================================================================== The complete log is attached. Could this be a python 2.3.5 problem? cheers, steve -- Random number generation is the art of producing pure gibberish as quickly as possible. From david at ar.media.kyoto-u.ac.jp Mon May 15 04:09:34 2006 From: david at ar.media.kyoto-u.ac.jp (David Cournapeau) Date: Mon, 15 May 2006 17:09:34 +0900 Subject: [SciPy-user] How to profile scipy code ? In-Reply-To: <4468350A.2000702@gmx.net> References: <44682257.5010008@ar.media.kyoto-u.ac.jp> <4468350A.2000702@gmx.net> Message-ID: <4468373E.6070303@ar.media.kyoto-u.ac.jp> Steve Schmerler wrote: > > Try the Python profiler. (http://docs.python.org/lib/profile.html) > Well, of course, I tried that; I guessed I was not precise enough in my email, sorry: the matlab profiler can give you a report easy to browse (not fundamental, but this really makes things easier), and can profile line per line (fundamental). I didn't find a way to do this with the python profiler, so I was wondering if there is any instructions to do that with the python profiler, or if this is simply not possible (line per line profiling) David From elcorto at gmx.net Mon May 15 04:23:36 2006 From: elcorto at gmx.net (Steve Schmerler) Date: Mon, 15 May 2006 10:23:36 +0200 Subject: [SciPy-user] numpy build fails In-Reply-To: <4468376D.2020808@gmx.net> References: <44682257.5010008@ar.media.kyoto-u.ac.jp> <4468376D.2020808@gmx.net> Message-ID: <44683A88.1020106@gmx.net> Steve Schmerler wrote: > Hi > > The latest numpy svn version fails to build: > > > =================================================================================== > [...] > sh: -c: line 1: syntax error near unexpected token `(' > sh: -c: line 1: `( f95 --version ; echo $? > (65, '/tmp/tmpDqORY4') ) > > (64, '/tmp/tmpHw36At') 2>&1' > coercing to Unicode: need string or buffer, tuple found > customize GnuFCompiler > sh: -c: line 1: syntax error near unexpected token `(' > sh: -c: line 1: `( /usr/bin/g77 --version ; echo $? > (67, > '/tmp/tmpLbSCrf') ) > (66, '/tmp/tmpXq_iqw') 2>&1' > Traceback (most recent call last): > File "setup.py", line 84, in ? > setup_package() > File "setup.py", line 77, in setup_package > configuration=configuration ) > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/core.py", > line 170, in setup > return old_setup(**new_attr) > File "/usr/lib/python2.3/distutils/core.py", line 149, in setup > dist.run_commands() > File "/usr/lib/python2.3/distutils/dist.py", line 907, in run_commands > self.run_command(cmd) > File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command > cmd_obj.run() > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/install.py", > line 11, in run > r = old_install.run(self) > File "/usr/lib/python2.3/distutils/command/install.py", line 506, in run > self.run_command('build') > File "/usr/lib/python2.3/distutils/cmd.py", line 333, in run_command > self.distribution.run_command(command) > File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command > cmd_obj.run() > File "/usr/lib/python2.3/distutils/command/build.py", line 107, in run > self.run_command(cmd_name) > File "/usr/lib/python2.3/distutils/cmd.py", line 333, in run_command > self.distribution.run_command(command) > File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command > cmd_obj.run() > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", > line 87, in run > self.build_sources() > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", > line 106, in build_sources > self.build_extension_sources(ext) > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", > line 212, in build_extension_sources > sources = self.generate_sources(sources, ext) > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", > line 270, in generate_sources > source = func(extension, build_dir) > File "numpy/core/setup.py", line 35, in generate_config_h > library_dirs = default_lib_dirs) > File "/usr/lib/python2.3/distutils/command/config.py", line 278, in > try_run > self._check_compiler() > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/config.py", > line 35, in _check_compiler > self.fcompiler.customize(self.distribution) > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/__init__.py", > line 298, in customize > oflags = self.__get_flags(self.get_flags_opt,'FOPT',(conf,'opt')) > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/__init__.py", > line 515, in __get_flags > var = command() > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/gnu.py", > line 122, in get_flags_opt > if self.get_version()<='3.3.3': > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/ccompiler.py", > line 251, in CCompiler_get_version > status, output = exec_command(cmd,use_tee=0) > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", > line 255, in exec_command > use_tee=use_tee, > File > "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", > line 304, in _exec_command_posix > f = open(stsfile,'r') > TypeError: coercing to Unicode: need string or buffer, tuple found > =================================================================================== > > The complete log is attached. Could this be a python 2.3.5 problem? > > cheers, > steve This time with the attachment :) -- Random number generation is the art of producing pure gibberish as quickly as possible. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: log.txt URL: From elcorto at gmx.net Mon May 15 04:41:00 2006 From: elcorto at gmx.net (Steve Schmerler) Date: Mon, 15 May 2006 10:41:00 +0200 Subject: [SciPy-user] How to profile scipy code ? In-Reply-To: <4468373E.6070303@ar.media.kyoto-u.ac.jp> References: <44682257.5010008@ar.media.kyoto-u.ac.jp> <4468350A.2000702@gmx.net> <4468373E.6070303@ar.media.kyoto-u.ac.jp> Message-ID: <44683E9C.6090404@gmx.net> David Cournapeau wrote: > Steve Schmerler wrote: > >>Try the Python profiler. (http://docs.python.org/lib/profile.html) >> > > Well, of course, I tried that; I guessed I was not precise enough in my > email, sorry: the matlab profiler can give you a report easy to browse > (not fundamental, but this really makes things easier), and can profile > line per line (fundamental). I didn't find a way to do this with the > python profiler, so I was wondering if there is any instructions to do > that with the python profiler, or if this is simply not possible (line > per line profiling) > > David Uh, line per line, I don't know. I used the profiler to identify the computing time of individual functions. The only poor-man's-method that comes into my mind is putting some suspicious lines in a dummy function and call this where the lines would appear in the code, but .... well this is of course not very handy. cheers, steve -- Random number generation is the art of producing pure gibberish as quickly as possible. From gruben at bigpond.net.au Mon May 15 04:41:32 2006 From: gruben at bigpond.net.au (Gary Ruben) Date: Mon, 15 May 2006 18:41:32 +1000 Subject: [SciPy-user] Orthogonal Wavelets In-Reply-To: <20060515034014.3077.qmail@web53908.mail.yahoo.com> References: <20060515034014.3077.qmail@web53908.mail.yahoo.com> Message-ID: <44683EBC.4060206@bigpond.net.au> No, not broken from here. If you can't figure out why you can't get to it, let me know and I'll send you the package from there. Gary R. Derek Goring wrote: > Yes, I found > http://www.pybytes.com/pywavelets/ > earlier (from Google). > Everybody seems to point to it, but the link appears to be broken. > > I have a lot of experience using orthogonal and continuous wavelets for > real-time processing of sea-level signals to extract long waves such as > far infra gravity, rissaga and tsunami waves (periods 3 to 96 minutes). > eg, see: http://www.mulgor.co.nz/TongaTsu06/ > I'd be happy to test wavelet routines on my data in SciPy. > > Derek > > */Gary Ruben /* wrote: > > Hi Derek, > > I don't know if this is useful, but here's another wavelet-related > package: > http://www.pybytes.com/pywavelets/ > > Gary R. > > Derek Goring wrote: > > Thanks Robert > > > > Seems like they're not quite there yet. > > In the meantime, I might try running my Fortran routines from within > > SciPy (once I learn how). > > > > Cheers > > Derek > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > > > > ________________ > Derek Goring > Mulgor Consulting Ltd > 24 Brockworth Place > Christchurch, New Zealand > Phone: 64 3 343 5400 > Mobile: 64 272 777 639 > Website: www.mulgor.co.nz > > Send instant messages to your online friends http://au.messenger.yahoo.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From arnd.baecker at web.de Mon May 15 05:05:44 2006 From: arnd.baecker at web.de (Arnd Baecker) Date: Mon, 15 May 2006 11:05:44 +0200 (CEST) Subject: [SciPy-user] How to profile scipy code ? In-Reply-To: <4468373E.6070303@ar.media.kyoto-u.ac.jp> References: <44682257.5010008@ar.media.kyoto-u.ac.jp> <4468350A.2000702@gmx.net> <4468373E.6070303@ar.media.kyoto-u.ac.jp> Message-ID: Hi David, On Mon, 15 May 2006, David Cournapeau wrote: > Steve Schmerler wrote: > > > > Try the Python profiler. (http://docs.python.org/lib/profile.html) > > > Well, of course, I tried that; I guessed I was not precise enough in my > email, sorry: the matlab profiler can give you a report easy to browse > (not fundamental, but this really makes things easier), and can profile > line per line (fundamental). I didn't find a way to do this with the > python profiler, so I was wondering if there is any instructions to do > that with the python profiler, or if this is simply not possible (line > per line profiling) One possibility is to use the hotshot profiler with kcachegrind, see http://mail.enthought.com/pipermail/enthought-dev/2006-January/001075.html for some details. (note that there are cases where the conversion from the hotshot output to kcachegrind useable input produces wrong timing results ...) However, also have a look at http://article.gmane.org/gmane.comp.python.numeric.general/5309/ http://article.gmane.org/gmane.comp.python.numeric.general/5310 http://thread.gmane.org/gmane.comp.python.numeric.general/5311/ http://thread.gmane.org/gmane.comp.python.numeric.general/5337 In particular Robert Kern's reply in the last thread """Donuts get you dollars that the profiler does not recognize ufuncs as functions that it ought to be profiling.""" shows that one has to be careful about the results of the profilers. Overall I find the situation very unsatistfactory ... Best, Arnd From nztideman at yahoo.co.nz Mon May 15 06:25:12 2006 From: nztideman at yahoo.co.nz (Derek Goring) Date: Mon, 15 May 2006 22:25:12 +1200 (NZST) Subject: [SciPy-user] Orthogonal Wavelets In-Reply-To: <44683EBC.4060206@bigpond.net.au> Message-ID: <20060515102512.19763.qmail@web53912.mail.yahoo.com> Well that's interesting............ I've been trying all day and can't get through. Right now, I'm using Firefox on a Linux box and it won't open. Earlier, neither IE nor Firefox on Win XP could open it. Maybe there's a problem with the gateway out of New Zealand to the US, though I'm getting international mail OK through Oz. I don't understand these things. They're great when they work, but a real bitch when they don't............. Cheers Derek Gary Ruben wrote: No, not broken from here. If you can't figure out why you can't get to it, let me know and I'll send you the package from there. Gary R. Derek Goring wrote: > Yes, I found > http://www.pybytes.com/pywavelets/ > earlier (from Google). > Everybody seems to point to it, but the link appears to be broken. > > I have a lot of experience using orthogonal and continuous wavelets for > real-time processing of sea-level signals to extract long waves such as > far infra gravity, rissaga and tsunami waves (periods 3 to 96 minutes). > eg, see: http://www.mulgor.co.nz/TongaTsu06/ > I'd be happy to test wavelet routines on my data in SciPy. > > Derek > > */Gary Ruben /* wrote: > > Hi Derek, > > I don't know if this is useful, but here's another wavelet-related > package: > http://www.pybytes.com/pywavelets/ > > Gary R. > > Derek Goring wrote: > > Thanks Robert > > > > Seems like they're not quite there yet. > > In the meantime, I might try running my Fortran routines from within > > SciPy (once I learn how). > > > > Cheers > > Derek > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > > > > ________________ > Derek Goring > Mulgor Consulting Ltd > 24 Brockworth Place > Christchurch, New Zealand > Phone: 64 3 343 5400 > Mobile: 64 272 777 639 > Website: www.mulgor.co.nz > > Send instant messages to your online friends http://au.messenger.yahoo.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 ________________ Derek Goring Mulgor Consulting Ltd 24 Brockworth Place Christchurch, New Zealand Phone: 64 3 343 5400 Mobile: 64 272 777 639 Website: www.mulgor.co.nz Send instant messages to your online friends http://au.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdc at uwo.ca Mon May 15 23:31:37 2006 From: jdc at uwo.ca (Dan Christensen) Date: Mon, 15 May 2006 23:31:37 -0400 Subject: [SciPy-user] characteristic polynomials? In-Reply-To: <44682EED.6030504@iam.uni-stuttgart.de> References: <87ejyzduz1.fsf@uwo.ca> <44682EED.6030504@iam.uni-stuttgart.de> Message-ID: <877j4mtzl2.fsf@uwo.ca> Nils Wagner writes: > Dan Christensen wrote: >> Can scipy compute the characteristic polynomial of a matrix? I guess >> I could compute the eigenvalues lambda_i, and then multiply together >> polynomials of the form x - lambda_i, but I was wondering if there >> was a more direct way. > > Just curious - why are you interested in the characteristic polynomial ? I'm looking for patterns in the coefficients of the characteristic polynomials of a large family of matrices. I already know that the trace and determinant have nice properties, so I'm exploring whether the other coefficients are equally interesting. Dan From edin.salkovic at gmail.com Tue May 16 02:45:56 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Tue, 16 May 2006 08:45:56 +0200 Subject: [SciPy-user] SoC application enhancement Message-ID: <63eb7fa90605152345k7314c46x1524237081269043@mail.gmail.com> Here goes the revised version of my application for SoC. It incorporates John's suggestions. I haven't posted it yet, so any comments (Robert, Fernando, others) are welcome. I'll then post it to the SoC page for a re-review by PSF mentors. ... Project details ========= After a discussion at the scipy user list, and the comments of the possible mentor, I decided to work on improving mathtext, which is part of matplotlib. So for this summer of code I could work on the following (roughly in order of importance/realization): * replace the existing bakoma truetype fonts with a set of good, comprehensive, math fonts, eg, STIX (http://www.stixfonts.org/). The STIX fonts should be available by the begining of June. Also, the code should be refactored so that unicode names for symbols can be used. This will allow plugging in any font that supports unicode (STIX fonts already support unicode). Currently mathtext hardcodea the mapping from TeX symbol name to a (font_file, glyph_index) tuple, which ties mathtext to a given set of fonts (eg, the Bakoma fonts). - 4 weeks - * incorporate some of Knuth's layout algorithm's into the mathtext layout engine. - 4 weeks - * refactor mathtext into a stand-alone module - 1 week - * add support for kerning - the current bakoma fonts do not have kerning info in them. * improve the parser to handle more TeX - 1 week - * add suport for fractions (\frac), arrays etc. - 1 week - I plan to continue the work on mathtext after SoC. ... From stefan at sun.ac.za Tue May 16 05:18:16 2006 From: stefan at sun.ac.za (Stefan van der Walt) Date: Tue, 16 May 2006 11:18:16 +0200 Subject: [SciPy-user] Graceful concatenation to a "zero" dimension narray? In-Reply-To: <4467F984.1050607@gmail.com> References: <4467F984.1050607@gmail.com> Message-ID: <20060516091816.GF6173@mentat.za.net> On Sun, May 14, 2006 at 10:46:12PM -0500, Robert Kern wrote: > Webb Sprague wrote: > > Is there a nice way to make N.array([0.0,1.0,2.0,3.0]) into > > N.array([-1.0,0.0, 1.0,2.0,3.0, 4.0])? With regular lists in Python, > > I would write [-1.0] +[0.0,1.0,2.0,3.0] + [4.0]. I can only imagine > > multiple line things with reshape and friends, but maybe there is a > > better answer. > > Use hstack(). Also, you will probably want to look at its friends, vstack() and > column_stack(). You can also use the indexing trick N.r_[-1.0,N.array([0.0,1.0,2.0,3.0]),4.0] Regards St?fan From vandenbosch.idesbald at gmail.com Tue May 16 07:19:14 2006 From: vandenbosch.idesbald at gmail.com (idesbald van den bosch) Date: Tue, 16 May 2006 13:19:14 +0200 Subject: [SciPy-user] linalg.scipy use of "GMRESREVCOM.f.scr" for complex-type systems Message-ID: Hi there, I would like to reuse directly in C++ code the "GMRESREVCOM.f.scr" fortran routine that is used in scipy. The problem is that I need it for complex matrices and vectors (A, b, x), and "GMRESREVCOM.f.scr" has been written for double-precision floats. I know that scipy can solve complex-type linear systems using " GMRESREVCOM.f.src", but I don't understand how it does it. Apparently, by looking at the scipy "iterative.py" source code, scipy has a dictionary of linalg methods (ended by "revcom") that work for "floats" and "complex": dir(_iterative) = ['__doc__', '__file__', '__name__', '__version__', 'as_column_major_storage', 'cbicgrevcom', 'cbicgstabrevcom', 'ccgrevcom', 'ccgsrevcom', 'cgmresrevcom', 'cqmrrevcom', 'cstoptest2', 'dbicgrevcom', 'dbicgstabrevcom', 'dcgrevcom', 'dcgsrevcom', 'dgmresrevcom', 'dqmrrevcom', 'dstoptest2', 'has_column_major_storage', 'sbicgrevcom', 'sbicgstabrevcom', 'scgrevcom', 'scgsrevcom', 'sgmresrevcom', 'sqmrrevcom', 'sstoptest2', 'zbicgrevcom', 'zbicgstabrevcom', 'zcgrevcom', 'zcgsrevcom', 'zgmresrevcom', 'zqmrrevcom', 'zstoptest2'] My question is: how is 'zgmresrevcom' built, since the fortran source code " GMRESREVCOM.f.src" has been written for double-precision floats??? Thanks for help anyone! Ides -------------- next part -------------- An HTML attachment was scrubbed... URL: From fonnesbeck at gmail.com Tue May 16 09:57:22 2006 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Tue, 16 May 2006 09:57:22 -0400 Subject: [SciPy-user] extracting a range from within an array Message-ID: <723eb6930605160657w73e9c517i78ccb8199f44ac0f@mail.gmail.com> I am trying to extract a section within an array, based on the values of the entries. It is easy to use compress() if the subsection is at one end or the other: foo = arange(100) bar = foo.compress(foo>40) However, you cannot do the same for a chunk in the middle: bar.foo.compress(20 References: <723eb6930605160657w73e9c517i78ccb8199f44ac0f@mail.gmail.com> Message-ID: <4469DC71.6000005@olfac.univ-lyon1.fr> foo = arange(100) bar = foo[logical_and(20I am trying to extract a section within an array, based on the values >of the entries. It is easy to use compress() if the subsection is at >one end or the other: > >foo = arange(100) >bar = foo.compress(foo>40) > >However, you cannot do the same for a chunk in the middle: > >bar.foo.compress(20 >ValueError: The truth value of an array with more than one element is >ambiguous. Use a.any() or a.all() > >What is the correct way of going about this. Obviously, for this >simple case, I could simply call arange(20,40), but in an array where >the contents are unknown a priori, this does not work. > >Thanks, >Chris > > > From aisaac at american.edu Tue May 16 10:15:05 2006 From: aisaac at american.edu (Alan G Isaac) Date: Tue, 16 May 2006 10:15:05 -0400 Subject: [SciPy-user] extracting a range from within an array In-Reply-To: <723eb6930605160657w73e9c517i78ccb8199f44ac0f@mail.gmail.com> References: <723eb6930605160657w73e9c517i78ccb8199f44ac0f@mail.gmail.com> Message-ID: On Tue, 16 May 2006, Chris Fonnesbeck apparently wrote: > foo = arange(100) bar = foo.compress(foo>40) > However, you cannot do the same for a chunk in the middle: > bar.foo.compress(20>> x = N.arange(100) >>> x[(x>20)*(x<40)] array([21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]) From agn at noc.soton.ac.uk Tue May 16 10:39:46 2006 From: agn at noc.soton.ac.uk (George Nurser) Date: Tue, 16 May 2006 15:39:46 +0100 Subject: [SciPy-user] extracting a range from within an array In-Reply-To: References: <723eb6930605160657w73e9c517i78ccb8199f44ac0f@mail.gmail.com> Message-ID: <7216A73B-D17C-4D37-8F9D-2FF3D49A9A94@noc.soton.ac.uk> On 16 May 2006, at 15:15, Alan G Isaac wrote: > On Tue, 16 May 2006, Chris Fonnesbeck apparently wrote: >> foo = arange(100) bar = foo.compress(foo>40) >> However, you cannot do the same for a chunk in the middle: >> bar.foo.compress(20 > One simple way below. > > Cheers, > Alan Isaac > >>>> x = N.arange(100) >>>> x[(x>20)*(x<40)] > array([21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, > 36, 37, 38, 39]) > My favourite, because it seems most logical, is: x[(x>20)&(x<40)] array([21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]) Similarly x[(x<20)|(x>80)] array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]) George. From morovia at rediffmail.com Tue May 16 11:01:59 2006 From: morovia at rediffmail.com (morovia) Date: 16 May 2006 15:01:59 -0000 Subject: [SciPy-user] toeplitz matrix - yule-walker equations Message-ID: <20060516150159.8212.qmail@webmail31.rediffmail.com> Hello, I was trying to solve the yule-walker equations which uses toeplitz matrix to get the coefficients. Since the toeplitz matrix is already in scipy.linalg, I am just wondering whether someone has already written to solve eqns. using recursive levinson-durby algorithm. http://documents.wolfram.com/applications/timeseries/UsersGuidetoTimeSeries/1.6.1.html Any suggestions. Thanks in advance, Best regards, morovia. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Tue May 16 13:46:35 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Tue, 16 May 2006 11:46:35 -0600 Subject: [SciPy-user] SoC application enhancement In-Reply-To: <63eb7fa90605152345k7314c46x1524237081269043@mail.gmail.com> References: <63eb7fa90605152345k7314c46x1524237081269043@mail.gmail.com> Message-ID: On 5/16/06, Edin Salkovi? wrote: > Here goes the revised version of my application for SoC. It > incorporates John's suggestions. I haven't posted it yet, so any > comments (Robert, Fernando, others) are welcome. I'll then post it to > the SoC page for a re-review by PSF mentors. > > ... > Project details > ========= > After a discussion at the scipy user list, and the comments of > the possible mentor, I decided to work on improving mathtext, which > is part of matplotlib. So for this summer of code I could work on the > following (roughly in order of importance/realization): [...] > I plan to continue the work on mathtext after SoC. Minor comment: you may want to indicate what possible use other projects may make of your contribution. I imagine that a project whose results can benefit a wider array of tools is likely to be seen in a better light at the final evaluation time. Good luck, f From alford at wuphys.wustl.edu Tue May 16 14:24:07 2006 From: alford at wuphys.wustl.edu (Mark Alford) Date: Tue, 16 May 2006 13:24:07 -0500 (CDT) Subject: [SciPy-user] fsolve passing array not float Message-ID: I have a function of one floating-point variable, written in python. It has a root, and I want to use fsolve to find it. But fsolve passes an array (of length 1!) instead of a simple float. What do I do? I want the function call to be efficient, because it will be repeated many times. And the function uses 'if(...)' tests on its argument so it is not easy to vectorize it. (a) Ideally I would like to tell fsolve not to pass silly length-1 arrays to my function. But I expect that's not possible. (b) I could modify my function to test for a length-1 array, and pull out the single element in that case. This feels wasteful (undoing fsolve's work), but perhaps it can be done in an efficient way? (c) I could write a wrapper that takes an array as argument, and calls my function many times to create an array of results. How does one do this in an efficient way? From cookedm at physics.mcmaster.ca Tue May 16 16:09:28 2006 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Tue, 16 May 2006 16:09:28 -0400 Subject: [SciPy-user] fsolve passing array not float In-Reply-To: (Mark Alford's message of "Tue, 16 May 2006 13:24:07 -0500 (CDT)") References: Message-ID: Mark Alford writes: > I have a function of one floating-point variable, written in > python. It has a root, and I want to use fsolve to find it. But fsolve > passes an array (of length 1!) instead of a simple float. What do I do? > I want the function call to be efficient, because it will be repeated > many times. And the function uses 'if(...)' tests on its argument > so it is not easy to vectorize it. > > (a) Ideally I would like to tell fsolve not to pass silly length-1 arrays > to my function. But I expect that's not possible. > > (b) I could modify my function to test for a length-1 array, and pull out > the single element in that case. This feels wasteful (undoing fsolve's > work), but perhaps it can be done in an efficient way? > > (c) I could write a wrapper that takes an array as argument, and > calls my function many times to create an array of results. > How does one do this in an efficient way? fsolve is designed to find the roots of a set of non-linear equations, hence the array (of length #-of-variables). You could use one of the 1-d routines instead (brentq, for instance), which may be better for your case, or use a wrapper. Assuming your function is func(x), this would work: def func_wrapper(x): return func(x[0]) -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From alford at wuphys.wustl.edu Tue May 16 16:51:47 2006 From: alford at wuphys.wustl.edu (Mark Alford) Date: Tue, 16 May 2006 15:51:47 -0500 (CDT) Subject: [SciPy-user] fsolve passing array not float In-Reply-To: References: Message-ID: On Tue, 16 May 2006, David M. Cooke wrote: > You could use one of the 1-d routines instead (brentq, for instance), Thank you, I didn't know about those. I'll try that. > Assuming your function is func(x), this would work: > def func_wrapper(x): > return func(x[0]) Well, fsolve is also expecting to get an array back again, so I think we need something more like return array( [func(x[0])] ) but I guess am also interested in the more general question of how to construct array( [f(x0),f(x1),f(x2),...] ) given array( [x0,x1,x2...] ). One could just do fx_array = array( map(f, x_array) ) But is this the most efficient way? Are there more efficient ways? From jdhunter at ace.bsd.uchicago.edu Tue May 16 22:38:36 2006 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue, 16 May 2006 21:38:36 -0500 Subject: [SciPy-user] SoC application enhancement In-Reply-To: <63eb7fa90605152345k7314c46x1524237081269043@mail.gmail.com> ("Edin =?iso-8859-1?q?Salkovi=A7"'s?= message of "Tue, 16 May 2006 08:45:56 +0200") References: <63eb7fa90605152345k7314c46x1524237081269043@mail.gmail.com> Message-ID: <87odxxe5oz.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Edin" == Edin Salkovi? writes: Edin> Here goes the revised version of my application for SoC. It Edin> incorporates John's suggestions. I haven't posted it yet, so Edin> any comments (Robert, Fernando, others) are welcome. I'll Edin> then post it to the SoC page for a re-review by PSF mentors. Hey Edin, I think this looks good. Let's go ahead and upload it to the SOC site and I'll see if I can get the mentors to take a second look to try and boost your score a bit. JDH From oliphant.travis at ieee.org Tue May 16 23:27:31 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Tue, 16 May 2006 21:27:31 -0600 Subject: [SciPy-user] fsolve passing array not float In-Reply-To: References: Message-ID: <446A9823.50803@ieee.org> Mark Alford wrote: > On > Well, fsolve is also expecting to get an array back again, so I think > we need something more like > return array( [func(x[0])] ) > but I guess am also interested in the more general question of how to > construct array( [f(x0),f(x1),f(x2),...] ) given array( [x0,x1,x2...] ). > > One could just do > fx_array = array( map(f, x_array) ) > > Yes, this works, but it's better spelled in modern Python (the map function is going away in Python 3.0) as fx_array = array([f(x) for x in x_array]). However, this is the concept that is called "vectorizing" a function in SciPy. Naturally, any function that consists of a combination of vectorizing functions will already be vectorized. Thus, because all ufuncs (+, *, -, sqrt, sin, etc.) are "automatically" vectorizing, any function consisting of just a combination of ufuncs will automatically be vectorized. Example: from numpy import sqrt def f(x): return x*x + 3*sqrt(x) The function "f" will already accept an array and return an array. But for functions that you can't "vectorize" internally, there is the command = numpy.vectorize() This command constructs a callable object for you that is a vectorizing function already. It requires a callable object as an input that takes a scalar input and returns a scalar output. The vectorized function also implements broadcasting just like all the other ufuncs. I haven't really timed the two approaches, but I would expect them to be on the same order speed-wise. The ufunc loop is done in C (but it calls out to a Python function in each loop so there isn't much advantage there). The big difference is in multi-dimensional vectorization which vectorize handles just like all the other ufuncs but list-comprehension doesn't. -Travis > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From edin.salkovic at gmail.com Wed May 17 02:24:02 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Wed, 17 May 2006 08:24:02 +0200 Subject: [SciPy-user] SoC application enhancement In-Reply-To: <87odxxe5oz.fsf@peds-pc311.bsd.uchicago.edu> References: <63eb7fa90605152345k7314c46x1524237081269043@mail.gmail.com> <87odxxe5oz.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <63eb7fa90605162324l4da655ebp8c47b236a19a09b6@mail.gmail.com> I have just uploaded it to the SoC site. Thanks! From bdejong at iua.upf.edu Wed May 17 03:19:05 2006 From: bdejong at iua.upf.edu (Bram de Jong - MTG) Date: Wed, 17 May 2006 09:19:05 +0200 Subject: [SciPy-user] sparse+slice? (and hello!) Message-ID: <446ACE69.4050104@iua.upf.edu> Hello everyone, ( First post on this list... Using SciPy in various algorithms and extensions, all related to audio processing ) * A simple question to start of with, is it correct to say that the sparse matrices do not support slicing? > values = [0.1, 5.8, 21.8] > indices = [[0,0],[1,1],[2,1]] > matrix = sparse.coo_matrix(values, indices, 3, 3) > matrix = matrix.tocsc() > matrix2[1,1] 5.7999999999999998 > matrix2[1,:] Traceback (most recent call last): File "", line 1, in ? File "C:\PYTHON23\lib\site-packages\scipy\sparse\Sparse.py", line 578, in __getitem__ raise KeyError, "Index out of bounds." KeyError: 'Index out of bounds.' This using the scipy from the latest 'enthought' python installer for windows. PySparse seems to support slicing, but seems to be VERY slow when slicing... * a not-so-simple question: is there any documentation, tutorial, introduction, ... to the sparse matrices of scipy? It seems neither the official (feebased) docs mention them, nor are the docstrings *that* extensive. - bram -- MTG - http://www.mtg.upf.edu/ The Freesound Project - http://freesound.iua.upf.edu Smartelectronix - http://www.smartelectronix.com Musicdsp - http://www.musicdsp.org Office Telephone - +34 935 422 101 From schofield at ftw.at Wed May 17 04:29:22 2006 From: schofield at ftw.at (Ed Schofield) Date: Wed, 17 May 2006 10:29:22 +0200 Subject: [SciPy-user] sparse+slice? (and hello!) In-Reply-To: <446ACE69.4050104@iua.upf.edu> References: <446ACE69.4050104@iua.upf.edu> Message-ID: On 17/05/2006, at 9:19 AM, Bram de Jong - MTG wrote: > Hello everyone, > > ( First post on this list... Using SciPy in various algorithms and > extensions, all related to audio processing ) > > * A simple question to start of with, is it correct to say that the > sparse matrices do not support slicing? > >> values = [0.1, 5.8, 21.8] >> indices = [[0,0],[1,1],[2,1]] >> matrix = sparse.coo_matrix(values, indices, 3, 3) >> matrix = matrix.tocsc() >> matrix2[1,1] > 5.7999999999999998 >> matrix2[1,:] > Traceback (most recent call last): > File "", line 1, in ? > File "C:\PYTHON23\lib\site-packages\scipy\sparse\Sparse.py", line > 578, in __getitem__ > raise KeyError, "Index out of bounds." > KeyError: 'Index out of bounds.' > > This using the scipy from the latest 'enthought' python installer for > windows. I've added some support for slicing in more recent SVN versions. It's now possible to use csc[:, j], csr[i, :], or lil[i, :]. These should be efficient operations. But slicing along the 'non-native' axes, with csc[i, :], csr[:, j], or lil[:, j] would be slower (and more complex to write), and these raise an IndexError. > * a not-so-simple question: is there any documentation, tutorial, > introduction, ... to the sparse matrices of scipy? It seems neither > the > official (feebased) docs mention them, nor are the docstrings *that* > extensive. There are also more docstrings in SVN HEAD. No tutorial yet, although we've had several requests recently. I'll see what I can do after I've submitted my thesis in a few weeks ... -- Ed From nwagner at iam.uni-stuttgart.de Wed May 17 04:38:19 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Wed, 17 May 2006 10:38:19 +0200 Subject: [SciPy-user] sparse+slice? (and hello!) In-Reply-To: References: <446ACE69.4050104@iua.upf.edu> Message-ID: <446AE0FB.5050908@iam.uni-stuttgart.de> Ed Schofield wrote: > On 17/05/2006, at 9:19 AM, Bram de Jong - MTG wrote: > > >> Hello everyone, >> >> ( First post on this list... Using SciPy in various algorithms and >> extensions, all related to audio processing ) >> >> * A simple question to start of with, is it correct to say that the >> sparse matrices do not support slicing? >> >> >>> values = [0.1, 5.8, 21.8] >>> indices = [[0,0],[1,1],[2,1]] >>> matrix = sparse.coo_matrix(values, indices, 3, 3) >>> matrix = matrix.tocsc() >>> matrix2[1,1] >>> >> 5.7999999999999998 >> >>> matrix2[1,:] >>> >> Traceback (most recent call last): >> File "", line 1, in ? >> File "C:\PYTHON23\lib\site-packages\scipy\sparse\Sparse.py", line >> 578, in __getitem__ >> raise KeyError, "Index out of bounds." >> KeyError: 'Index out of bounds.' >> >> This using the scipy from the latest 'enthought' python installer for >> windows. >> > > I've added some support for slicing in more recent SVN versions. > It's now possible to use csc[:, j], csr[i, :], or lil[i, :]. These > should be efficient operations. But slicing along the 'non-native' > axes, with csc[i, :], csr[:, j], or lil[:, j] would be slower (and > more complex to write), and these raise an IndexError. > > >> * a not-so-simple question: is there any documentation, tutorial, >> introduction, ... to the sparse matrices of scipy? It seems neither >> the >> official (feebased) docs mention them, nor are the docstrings *that* >> extensive. >> > > There are also more docstrings in SVN HEAD. No tutorial yet, > although we've had several requests recently. I'll see what I can do > after I've submitted my thesis in a few weeks ... > > -- Ed > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > BTW, I have submitted a bug report a few weeks ago http://projects.scipy.org/scipy/scipy/ticket/40 Traceback (most recent call last): File "test_iterative.py", line 12, in ? x,info = linalg.gmres(A,b) File "/usr/lib64/python2.4/site-packages/scipy/linalg/iterative.py", line 615, in gmres work[slice2] += sclr1*matvec(work[slice1]) ValueError: invalid return array shape >>> A matrix([[ 1., 0.], [ 0., 1.]]) Is it wanted that the input is restricted to arrays in linalg.gmres and friends ? Nils From bdejong at iua.upf.edu Wed May 17 05:43:17 2006 From: bdejong at iua.upf.edu (Bram de Jong - MTG) Date: Wed, 17 May 2006 11:43:17 +0200 Subject: [SciPy-user] sparse+slice? (and hello!) In-Reply-To: References: <446ACE69.4050104@iua.upf.edu> Message-ID: <446AF035.3070808@iua.upf.edu> Hi, Ed Schofield wrote: > On 17/05/2006, at 9:19 AM, Bram de Jong - MTG wrote: >> >> * A simple question to start of with, is it correct to say that the >> sparse matrices do not support slicing? > > I've added some support for slicing in more recent SVN versions. > It's now possible to use csc[:, j], csr[i, :], or lil[i, :]. These > should be efficient operations. But slicing along the 'non-native' > axes, with csc[i, :], csr[:, j], or lil[:, j] would be slower (and > more complex to write), and these raise an IndexError. Oh, that's great news... Is this Python-only, or C code? Just to know if I will have to recompile. (Are there daily builds somewhere?) Perhaps slicing along the non-native axes could be supported as well, even if it's really slow... A simple docstring with a message about the speed would solve the problem, while supplying the user with a "full set". For small matrices or really sparse ones it won't be much of a problem I guess (?). >> * a not-so-simple question: is there any documentation, tutorial, >> introduction, ... to the sparse matrices of scipy? It seems neither >> the >> official (feebased) docs mention them, nor are the docstrings *that* >> extensive. > > There are also more docstrings in SVN HEAD. No tutorial yet, > although we've had several requests recently. I'll see what I can do > after I've submitted my thesis in a few weeks ... Ok, that's great as well... thanks for the rapid reply! - bram -- MTG - http://www.mtg.upf.edu/ The Freesound Project - http://freesound.iua.upf.edu Smartelectronix - http://www.smartelectronix.com Musicdsp - http://www.musicdsp.org Office Telephone - +34 935 422 101 From bdejong at iua.upf.edu Wed May 17 05:49:38 2006 From: bdejong at iua.upf.edu (Bram de Jong - MTG) Date: Wed, 17 May 2006 11:49:38 +0200 Subject: [SciPy-user] sparse+slice? (and hello!) In-Reply-To: <446AF035.3070808@iua.upf.edu> References: <446ACE69.4050104@iua.upf.edu> <446AF035.3070808@iua.upf.edu> Message-ID: <446AF1B2.2080805@iua.upf.edu> Bram de Jong - MTG wrote: > Oh, that's great news... Is this Python-only, or C code? Just to know if > I will have to recompile. (Are there daily builds somewhere?) ( ahem, ... pardon me for confusing scipy with numpy... ;-) ) - bram -- MTG - http://www.mtg.upf.edu/ The Freesound Project - http://freesound.iua.upf.edu Smartelectronix - http://www.smartelectronix.com Musicdsp - http://www.musicdsp.org Office Telephone - +34 935 422 101 From schofield at ftw.at Wed May 17 07:19:51 2006 From: schofield at ftw.at (Ed Schofield) Date: Wed, 17 May 2006 13:19:51 +0200 Subject: [SciPy-user] sparse+slice? (and hello!) In-Reply-To: <446AF035.3070808@iua.upf.edu> References: <446ACE69.4050104@iua.upf.edu> <446AF035.3070808@iua.upf.edu> Message-ID: <446B06D7.3070203@ftw.at> Bram de Jong - MTG wrote: > Hi, > > Ed Schofield wrote: > >> On 17/05/2006, at 9:19 AM, Bram de Jong - MTG wrote: >> >>> * A simple question to start of with, is it correct to say that the >>> sparse matrices do not support slicing? >>> >> I've added some support for slicing in more recent SVN versions. >> It's now possible to use csc[:, j], csr[i, :], or lil[i, :]. These >> should be efficient operations. But slicing along the 'non-native' >> axes, with csc[i, :], csr[:, j], or lil[:, j] would be slower (and >> more complex to write), and these raise an IndexError. >> > > Oh, that's great news... Is this Python-only, or C code? Just to know if > I will have to recompile. (Are there daily builds somewhere?) > It's Python-only, but I suggest you re-compile the package, since some bugs were also fixed in the sparsetools Fortran code. You'll need a fairly recent NumPy version too (I think at least 0.9.6). > Perhaps slicing along the non-native axes could be supported as well, > even if it's really slow... A simple docstring with a message about the > speed would solve the problem, while supplying the user with a "full > set". For small matrices or really sparse ones it won't be much of a > problem I guess (?). > If you don't mind it being slow, an easy way to get slices along non-native axes is to convert the matrix format first. For example, >>> csc.tocsr()[i, :] does the trick :) >>> * a not-so-simple question: is there any documentation, tutorial, >>> introduction, ... to the sparse matrices of scipy? It seems neither >>> the >>> official (feebased) docs mention them, nor are the docstrings *that* >>> extensive. >>> >> There are also more docstrings in SVN HEAD. No tutorial yet, >> although we've had several requests recently. I'll see what I can do >> after I've submitted my thesis in a few weeks ... >> > > Ok, that's great as well... > > thanks for the rapid reply! > You're welcome! -- Ed From dd55 at cornell.edu Wed May 17 07:43:00 2006 From: dd55 at cornell.edu (Darren Dale) Date: Wed, 17 May 2006 07:43:00 -0400 Subject: [SciPy-user] SoC application enhancement In-Reply-To: <63eb7fa90605152345k7314c46x1524237081269043@mail.gmail.com> References: <63eb7fa90605152345k7314c46x1524237081269043@mail.gmail.com> Message-ID: <200605170743.01058.dd55@cornell.edu> On Tuesday 16 May 2006 02:45, Edin Salkovi? wrote: > * replace the existing bakoma truetype fonts with a set of good, > comprehensive, math fonts, eg, STIX (http://www.stixfonts.org/). > The STIX fonts should be available by the begining of June. Also, > the code should be refactored so that unicode names for symbols can > be used. This will allow plugging in any font that supports unicode > (STIX fonts already support unicode). Currently mathtext hardcodea > the mapping from TeX symbol name to a (font_file, glyph_index) tuple, > which ties mathtext to a given set of fonts (eg, the Bakoma fonts). > - 4 weeks - Hopefully the stixfonts are on schedule, but I've been watching them for a year now, and in that time they have postponed the beta release several times. In fact, the release schedule on their website still claims a beta release in April 2006. Darren From aisaac at american.edu Wed May 17 08:17:16 2006 From: aisaac at american.edu (Alan G Isaac) Date: Wed, 17 May 2006 08:17:16 -0400 Subject: [SciPy-user] fsolve passing array not float In-Reply-To: <446A9823.50803@ieee.org> References: <446A9823.50803@ieee.org> Message-ID: On Tue, 16 May 2006, Travis Oliphant apparently wrote: > the map function is going away in Python 3.0 I think "going away" means something like "going into a 'functional' module" rather than "disappearing". Right. fwiw, Alan Isaac PS Map looks pretty nice and communicates well in some contexts. From nwagner at iam.uni-stuttgart.de Wed May 17 09:58:36 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Wed, 17 May 2006 15:58:36 +0200 Subject: [SciPy-user] Wrapping dsytrf.f In-Reply-To: <4462EC81.4060605@iam.uni-stuttgart.de> References: <4462EC81.4060605@iam.uni-stuttgart.de> Message-ID: <446B2C0C.2010409@iam.uni-stuttgart.de> Nils Wagner wrote: > Hi all, > > I would like to know if scipy.linalg.flapack will be completed one day. > > For example > > http://www.netlib.org/lapack/double/dsytrf.f > > is missing. > > Any comments ? > > Nils > > _______________________________________________ > Scipy-dev mailing list > Scipy-dev at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-dev > I have just started wrapping dsytrf.f. f2py -m wrap_lap -h wrap_lap.pyf dsytrf.f How can I further improve the wrapper wrt lwork and work ? * WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) * On exit, if INFO = 0, WORK(1) returns the optimal LWORK. * * LWORK (input) INTEGER * The length of WORK. LWORK >=1. For best performance * LWORK >= N*NB, where NB is the block size returned by ILAENV. * * If LWORK = -1, then a workspace query is assumed; the routine * only calculates the optimal size of the WORK array, returns * this value as the first entry of the WORK array, and no error * message related to LWORK is issued by XERBLA. This is my current wrap_lap.pyf ! -*- f90 -*- ! Note: the context of this file is case sensitive. python module wrap_lap ! in interface ! in :wrap_lap subroutine dsytrf(uplo,n,a,lda,ipiv,work,lwork,info) ! in :wrap_lap:dsytrf.f character intent(in) :: uplo integer intent(hide), depend(a) :: n=shape(a,1) double precision intent(in,out), dimension(lda,n) :: a integer intent(hide), depend(a) :: lda=shape(a,0) integer intent(out), dimension(n) :: ipiv double precision dimension(*) :: work integer :: lwork integer intent(out):: info end subroutine dsytrf end interface end python module wrap_lap ! This file was auto-generated with f2py (version:2_2513). ! See http://cens.ioc.ee/projects/f2py2e/ f2py -c wrap_lap.pyf -L/usr/local/lib/atlas/ -llapack -lf77blas -lcblas -latlas -lg2c Nils From bdejong at iua.upf.edu Wed May 17 11:12:17 2006 From: bdejong at iua.upf.edu (Bram de Jong - MTG) Date: Wed, 17 May 2006 17:12:17 +0200 Subject: [SciPy-user] sparse+slice? (and hello!) In-Reply-To: <446B06D7.3070203@ftw.at> References: <446ACE69.4050104@iua.upf.edu> <446AF035.3070808@iua.upf.edu> <446B06D7.3070203@ftw.at> Message-ID: <446B3D51.1030809@iua.upf.edu> Ed Schofield wrote: >> Perhaps slicing along the non-native axes could be supported as well, >> even if it's really slow... A simple docstring with a message about the >> speed would solve the problem, while supplying the user with a "full >> set". For small matrices or really sparse ones it won't be much of a >> problem I guess (?). > > If you don't mind it being slow, an easy way to get slices along > non-native axes is to convert the matrix format first. For example, > >>>> csc.tocsr()[i, :] > > does the trick :) Okay! One more question related to this though ;-) Is there a function that does the equivalent of PySparse's dot(A,B) := transp(A)*B in scipy sparse? I see a dot() but it looks like it doesn't do the transpose... transp(A)*B ( or A*transp(B) depending on the compressed format) is fast when done in 'one pass' as you don't need the transposition, but slow if you do it with a transposition in python? Perhaps I should mention that -all parts together- what I'm looking for is a function which will give me: sparse_matrix[:,x] * (sparse_matrix[:,y])^T and/or (sparse_matrix[x,:])^T * sparse_matrix[y,:] ( depending on the representation of the matrix one is fast and the other isn't ) ...which basically is the dot-product of the two rows in the matrix... - bram -- MTG - http://www.mtg.upf.edu/ The Freesound Project - http://freesound.iua.upf.edu Smartelectronix - http://www.smartelectronix.com Musicdsp - http://www.musicdsp.org Office Telephone - +34 935 422 101 From agomez at imim.es Wed May 17 11:40:23 2006 From: agomez at imim.es (=?iso-8859-1?Q?G=D3MEZ_GARRIDO=2C_ALEXANDRE?=) Date: Wed, 17 May 2006 17:40:23 +0200 Subject: [SciPy-user] scipy 0.3.2 versus scipy 0.4.8 Message-ID: <75F30C917142A34DB6D2FA75521125091236CA@basquet.imim.es> Dear all, I'm confused with the Scipy versions and its relationships with Numpy and Numeric. I have understood that the old Scipy (0.3.2 version) use Numeric and the new version (0.4.8) use Numpy. But I have a difference of very great speed among them in a script which integrate a ode's system. I have made comparisions with the same script in the same PC. One time I ran using scipy 0.3.2 with Numeric and later I uninstalled scipy and numeric and installed scipy 0.4.8 and numpy 0.9.6 and I run again using the new versions. The first time I take 7 seconds and the other 40 seconds. My question is, Is the old scipy fast than the new scipy? or Do I have any installation problem? However, I have followed the webpages instructions during the installation. My script is: from scipy import * def func(x, t, *args): xdot = [0.0, 5.0, 0.0, 15.0, 0.0, 0.0, 0.0] xdot[0] = + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 xdot[1] = - (x[1] * beta) + x[4] * beta xdot[2] = - (x[2] * beta) + x[5] * beta xdot[3] = + x[6] * beta - (x[3] * beta) xdot[4] = + alpha0 + (alpha + (x[3])**(n) * alpha1) / ((K)**(n) + (x[3])**(n)) - (k1 * x[4]) xdot[5] = + alpha0 + (alpha + (x[1])**(n) * alpha1) / ((K)**(n) + (x[1])**(n)) - (k1 * x[5]) xdot[6] = - (k1 * x[6]) + alpha0 + (alpha + (x[2])**(n) * alpha1) / ((K)**(n) + (x[2])**(n)) g.write('%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n'%(t, xdot[0], xdot[1], xdot[2], xdot[3], xdot[4], xdot[5], xdot[6])) return xdot t = arange(0, 12.01, 0.01) alpha0 = 0.0 alpha1 = 0.0 K = 1.0 beta = 5.0 n = 2.1 k1 = 1.0 alpha = 250.0 cell = 1.0 parameters = [alpha0, alpha1, K, beta, n, k1, alpha, cell] x_0 = [0.0, 5.0, 0.0, 15.0, 0.0, 0.0, 0.0] g = open('veloc.out', 'w') args = (parameters,g) for i in range(100): x = integrate.odeint(func, x_0, t, args) Many thanks! ?lex G?mez Garrido From nomo17k at gmail.com Wed May 17 15:06:38 2006 From: nomo17k at gmail.com (Taro Sato) Date: Wed, 17 May 2006 12:06:38 -0700 Subject: [SciPy-user] floating point exception in interpolate.splrep Message-ID: I'm trying to smooth a bunch of spectra using splrep. Each spectrum comes with an inverse-variance vector, so I'm using that to weight data points (actually taking square-root to convert them to 1/sigma, as suggested in the documentation). All the spectra come from a single model spectrum which is perturbed by an assumed uncertainty distribution; I do this using the inverse variance (which stays constant). Essentially I'm trying to do a set of Monte Carlo. The problem is that splrep blows up on me ("Floating point exception") for *some* set of spectra generated as above. It appears something is going wrong with the fortran or at the c layer, since the error is not caught and thrown as a python exception. When I don't feed the splrep with a weight vector, I never get this error. It seems the combination of x,y, and w that ends up causing the error (especially something in relation to the combination of y and w), but I haven't been able to nail down the cause. I'm using scipy 0.4.9.1882 and numpy 0.9.7.2401 on linux. I attach three files I use to reproduce the error on my machine. I'd appreciate if there are any suggestions or things I can try to improve the situation. I'm not very experienced in using debugging tools but I'm willing to try anything at this point... Thank you for your time, Taro -- BEGIN OUTPUT --------- [splrep]$ ./test.py this one is fine: [array([ 8434.59, 8434.59, 8434.59, 8434.59, 8637.34, 8637.34, 8637.34, 8637.34]), array([ 0.98574233, 1.03529744, 0.95357713, 1.02495985]), 3] this one blows up on me: Floating point exception -- END OUTPUT ------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: test.py Type: text/x-python Size: 584 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bad.dat Type: application/octet-stream Size: 16578 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: good.dat Type: application/octet-stream Size: 16576 bytes Desc: not available URL: From oliphant.travis at ieee.org Wed May 17 15:17:10 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Wed, 17 May 2006 13:17:10 -0600 Subject: [SciPy-user] scipy 0.3.2 versus scipy 0.4.8 In-Reply-To: <75F30C917142A34DB6D2FA75521125091236CA@basquet.imim.es> References: <75F30C917142A34DB6D2FA75521125091236CA@basquet.imim.es> Message-ID: <446B76B6.6040401@ieee.org> G?MEZ GARRIDO wrote: > Dear all, > > I'm confused with the Scipy versions and its relationships with Numpy and Numeric. I have understood that the old Scipy (0.3.2 version) use Numeric and the new version (0.4.8) use Numpy. > > But I have a difference of very great speed among them in a script which integrate a ode's system. I have made comparisions with the same script in the same PC. One time I ran using scipy 0.3.2 with Numeric and later I uninstalled scipy and numeric and installed scipy 0.4.8 and numpy 0.9.6 and I run again using the new versions. The first time I take 7 seconds and the other 40 seconds. My question is, Is the old scipy fast than the new scipy? or Do I have any installation problem? However, I have followed the webpages instructions during the installation. > > My script is: > > from scipy import * > def func(x, t, *args): > xdot = [0.0, 5.0, 0.0, 15.0, 0.0, 0.0, 0.0] > xdot[0] = + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 > xdot[1] = - (x[1] * beta) + x[4] * beta > xdot[2] = - (x[2] * beta) + x[5] * beta > xdot[3] = + x[6] * beta - (x[3] * beta) > xdot[4] = + alpha0 + (alpha + (x[3])**(n) * alpha1) / ((K)**(n) + (x[3])**(n)) - (k1 * x[4]) > xdot[5] = + alpha0 + (alpha + (x[1])**(n) * alpha1) / ((K)**(n) + (x[1])**(n)) - (k1 * x[5]) > xdot[6] = - (k1 * x[6]) + alpha0 + (alpha + (x[2])**(n) * alpha1) / ((K)**(n) + (x[2])**(n)) > g.write('%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n'%(t, xdot[0], xdot[1], xdot[2], xdot[3], xdot[4], xdot[5], xdot[6])) > return xdot > t = arange(0, 12.01, 0.01) > alpha0 = 0.0 > alpha1 = 0.0 > K = 1.0 > beta = 5.0 > n = 2.1 > k1 = 1.0 > alpha = 250.0 > cell = 1.0 > parameters = [alpha0, alpha1, K, beta, n, k1, alpha, cell] > x_0 = [0.0, 5.0, 0.0, 15.0, 0.0, 0.0, 0.0] > g = open('veloc.out', 'w') > args = (parameters,g) > for i in range(100): > x = integrate.odeint(func, x_0, t, args) > > > The speed difference here is very likely related to the fact that selection from arrays now returns numpy scalars instead of standard Python scalars. The arithmetic for these scalars is done using ufuncs instead of the builtin Python arithmetic. Since your inner-most function uses a lot of scalar arithmetic, I'm pretty sure that that is the slow-down. The scalar math module in NumPy version 0.9.8 is intended to speed these operations up. Your feedback after making use of the scalarmath module will be greatly appreciated. The scalarmath module still goes through ufuncs for certain mixed-mode operations which means that certain commutative operations will be slower written one way then the other. I don't like the current situation and am looking for other options. -Travis From oliphant.travis at ieee.org Wed May 17 15:24:34 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Wed, 17 May 2006 13:24:34 -0600 Subject: [SciPy-user] floating point exception in interpolate.splrep In-Reply-To: References: Message-ID: <446B7872.30008@ieee.org> Taro Sato wrote: > > The problem is that splrep blows up on me ("Floating point exception") > for *some* set of spectra generated as above. It appears something is > going wrong with the fortran or at the c layer, since the error is not > caught and thrown as a python exception. When I don't feed the splrep > with a weight vector, I never get this error. It seems the > combination of x,y, and w that ends up causing the error (especially > something in relation to the combination of y and w), but I haven't > been able to nail down the cause. > Hmm.. I could not reproduce your problems. But, I did get an error on trying to read the data which might be related to what you are experiencing. I re-wrote your data-reader to use N.fromfile and I am able to process both data sets on my system. Attached is a new test.py file. The output for me is: this one is fine: [array([ 8434.59, 8434.59, 8434.59, 8434.59, 8637.34, 8637.34, 8637.34, 8637.34]), array([ 0.98574233, 1.03529744, 0.95357713, 1.02495985]), 3] this one blows up on me: [array([ 8434.59, 8434.59, 8434.59, 8434.59, 8439.35, 8441.56, 8443.78, 8446.32, 8448.53, 8452.97, 8454.23, 8455.5 , 8456.77, 8457.72, 8462.15, 8463.42, 8464.37, 8465.63, 8466.58, 8471.01, 8473.54, 8475.76, 8480.18, 8482.71, 8484.93, 8486.19, 8487.14, 8488.41, 8489.35, 8491.88, 8494.1 , 8498.52, 8500.73, 8502.94, 8505.15, 8565.39, 8567.91, 8570.11, 8572.31, 8574.52, 8577.03, 8579.24, 8581.44, 8583.64, 8584.9 , 8586.16, 8588.36, 8592.76, 8594.96, 8597.16, 8599.36, 8601.56, 8602.82, 8604.07, 8605.33, 8606.27, 8608.47, 8610.67, 8612.87, 8615.07, 8617.26, 8619.46, 8624.17, 8626.37, 8628.56, 8632.95, 8635.15, 8637.34, 8637.34, 8637.34, 8637.34]), array([ 1.07589861, 1.02817507, 1.08372402, 0.9114803 , 0.94299956, 0.95789916, 1.02202109, 1.05618611, 1.00462551, 1.07798136, 1.01052857, 1.0328747 , 0.9467201 , 1.01270335, 0.91429359, 0.7120375 , 1.05477716, 0.99154392, 1.02731091, 0.95687507, 1.03872999, 1.03814115, 0.8908353 , 0.98334153, 0.9952056 , 0.97676375, 0.89048608, 1.03076696, 0.9388103 , 1.13722853, 0.96864699, 1.13317883, 0.20448457, 1.81984553, 0.93736762, 0.99092773, 0.80330809, 1.09974255, 0.85392611, 0.95819376, 0.99843669, 1.02753442, 0.9534409 , 1.06403877, 0.92242399, 1.11529781, 0.94891023, 1.07147791, 0.7969011 , 1.15341046, 0.91926053, 1.04193898, 0.95864187, 1.07439548, 0.92865081, 0.95699696, 1.27573009, 0.87867803, 1.0324601 , 1.06097156, 0.80526327, 1.1116092 , 0.89534713, 1.07307086, 0.86588936, 1.13292644, 0.86201935]), 3] -Travis -------------- next part -------------- A non-text attachment was scrubbed... Name: test.py Type: text/x-python Size: 461 bytes Desc: not available URL: From nomo17k at gmail.com Wed May 17 16:22:25 2006 From: nomo17k at gmail.com (Taro Sato) Date: Wed, 17 May 2006 20:22:25 +0000 (UTC) Subject: [SciPy-user] floating point exception in interpolate.splrep References: <446B7872.30008@ieee.org> Message-ID: Travis Oliphant ieee.org> writes: > > Taro Sato wrote: > > with a weight vector, I never get this error. It seems the > > combination of x,y, and w that ends up causing the error (especially > > something in relation to the combination of y and w), but I haven't > > been able to nail down the cause. > > > > Hmm.. I could not reproduce your problems. But, I did get an error on > trying to read the data which might be related to what you are > experiencing. I re-wrote your data-reader to use N.fromfile and I am > able to process both data sets on my system. Attached is a new test.py > file. > I tried the revised version of the data-reader, but I still get exactly the same error as before on my machine. Could this be a plat-form dependent compilation issue? I have the same problem with both my desktop and laptop running Debian, with pretty much the same setting (so these won't help me track down...) I build scipy/numpy from source from the subversion repository, following exactly the unofficial instructions written by Steve Baum (without atlas). I have gcc version 3.3.5 (Debian 1:3.3.5-13). I'd appreciate any suggestions for me to track down the cause! Thanks, Taro From oliphant.travis at ieee.org Wed May 17 17:23:57 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Wed, 17 May 2006 15:23:57 -0600 Subject: [SciPy-user] floating point exception in interpolate.splrep In-Reply-To: References: <446B7872.30008@ieee.org> Message-ID: <446B946D.4010309@ieee.org> Taro Sato wrote: > Travis Oliphant ieee.org> writes: > > >> Taro Sato wrote: >> >>> with a weight vector, I never get this error. It seems the >>> combination of x,y, and w that ends up causing the error (especially >>> something in relation to the combination of y and w), but I haven't >>> been able to nail down the cause. >>> >>> >> Hmm.. I could not reproduce your problems. But, I did get an error on >> trying to read the data which might be related to what you are >> experiencing. I re-wrote your data-reader to use N.fromfile and I am >> able to process both data sets on my system. Attached is a new test.py >> file. >> >> > > > I tried the revised version of the data-reader, but I still get exactly the same > error as before on my machine. Could this be a plat-form dependent compilation > issue? I have the same problem with both my desktop and laptop running Debian, > with pretty much the same setting (so these won't help me track down...) > Yes, it could be, I have read of problems with bugs in Debian's version of gcc. But, I don't know much about them. Something about using SSE doesn't quite work right. You could use gdb to track down where the floating-point exception is occurring, but if it is a platform-dependent compilation problem, that won't help much. Sorry I can't be of more help. -Travis From strawman at astraw.com Wed May 17 20:28:01 2006 From: strawman at astraw.com (Andrew Straw) Date: Wed, 17 May 2006 17:28:01 -0700 Subject: [SciPy-user] floating point exception in interpolate.splrep In-Reply-To: References: Message-ID: <446BBF91.8010403@astraw.com> GNU libc version 2.3.2 has a bug[1] "feclearexcept() error on CPUs with SSE" (fixed in 2.3.3) which has been submitted to Debian[2] but not fixed in sarge. See http://www.its.caltech.edu/~astraw/coding.html#id3 for more information. [1] http://sources.redhat.com/bugzilla/show_bug.cgi?id=10 [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279294 From nomo17k at gmail.com Wed May 17 20:45:56 2006 From: nomo17k at gmail.com (Taro Sato) Date: Thu, 18 May 2006 00:45:56 +0000 (UTC) Subject: [SciPy-user] floating point exception in interpolate.splrep References: <446BBF91.8010403@astraw.com> Message-ID: Andrew Straw astraw.com> writes: > > GNU libc version 2.3.2 has a bug[1] "feclearexcept() error on CPUs with > SSE" (fixed in 2.3.3) which has been submitted to Debian[2] but not > fixed in sarge. See http://www.its.caltech.edu/~astraw/coding.html#id3 > for more information. > > [1] http://sources.redhat.com/bugzilla/show_bug.cgi?id=10 > [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279294 > Just for completeness --- indeed this was the cause of the problem. Thank you very much for all who responded to and pointed me in the right direction! Even Debian isn't perfect! Taro From stephen.walton at csun.edu Wed May 17 21:47:23 2006 From: stephen.walton at csun.edu (Stephen Walton) Date: Wed, 17 May 2006 18:47:23 -0700 Subject: [SciPy-user] Fastest way to calculate masked values? In-Reply-To: <16016.1146641367@www088.gmx.net> References: <16016.1146641367@www088.gmx.net> Message-ID: <446BD22B.5000506@csun.edu> Jose Luis Gomez Dans wrote: >Hi! >I have written some code that calculates some statistics from regions of an >array. These regions are defined by a mask array. This mask array has >defines a number of regions in the first array which are to be grouped >together (i.e., work out the mean of all elements in the data array where >the mask array is some_value). > >I use Enthought Python (and thus Numeric 23.4) for ease of installation in >my work computer, and so far, what I have come up with works, but is quite >slow: >for n in mask_vals: > t = ravel(where (mask == n,data_array, 0.0)) > val = mean ( compress ( t>0.0, t ) ) > > This is a bit of an old message, but no one's responded and I'm doing something very similar. I rather suspect that the slowness in your code (and my very similar code) is the multiple passes through data_array. It may be that code which makes only one pass through the array would be faster. That is, find the maximum value of mask_vals, allocate a vals[] and count[] array of that size, and walk the array once. Add the value of data_array[k] to the appropriate element of vals[] and increment the corresponding element of count[] by 1, then divide vals by count at the end. From agomez at imim.es Thu May 18 05:16:51 2006 From: agomez at imim.es (=?iso-8859-1?Q?G=D3MEZ_GARRIDO=2C_ALEXANDRE?=) Date: Thu, 18 May 2006 11:16:51 +0200 Subject: [SciPy-user] scipy 0.3.2 versus scipy 0.4.8 References: <75F30C917142A34DB6D2FA75521125091236CA@basquet.imim.es> <446B76B6.6040401@ieee.org> Message-ID: <75F30C917142A34DB6D2FA75521125091236CD@basquet.imim.es> Thank you for your answer. In order to have a fast method I am going to use the old Scipy at the moment. But, do you think that this problem will be solved in future versions? I have tried with different numpy versions, and the reults are: - with numpy 0.9.5: +- 1m10" - with numpy 0.9.6: +- 40" - with numpy 0.9.8: +- 12" But all versions are slower than scipy 0.3.2 with Numeric (7") Thanks ?lex G?mez Garrido Computational Biochemistry and Biophysics lab Research Unit on Biomedical Informatics (GRIB) - IMIM/UPF C/ Doctor Aiguader, 80; 08003 Barcelona (Spain) Tel: +34 93 221 1009 ext 2619 // Fax: +34 93 221 3237 http://diana.imim.es -----Mensaje original----- De: scipy-user-bounces at scipy.net en nombre de Travis Oliphant Enviado el: mi? 17/05/2006 21:17 Para: SciPy Users List Asunto: Re: [SciPy-user] scipy 0.3.2 versus scipy 0.4.8 G?MEZ GARRIDO wrote: > Dear all, > > I'm confused with the Scipy versions and its relationships with Numpy and Numeric. I have understood that the old Scipy (0.3.2 version) use Numeric and the new version (0.4.8) use Numpy. > > But I have a difference of very great speed among them in a script which integrate a ode's system. I have made comparisions with the same script in the same PC. One time I ran using scipy 0.3.2 with Numeric and later I uninstalled scipy and numeric and installed scipy 0.4.8 and numpy 0.9.6 and I run again using the new versions. The first time I take 7 seconds and the other 40 seconds. My question is, Is the old scipy fast than the new scipy? or Do I have any installation problem? However, I have followed the webpages instructions during the installation. > > My script is: > > from scipy import * > def func(x, t, *args): > xdot = [0.0, 5.0, 0.0, 15.0, 0.0, 0.0, 0.0] > xdot[0] = + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 > xdot[1] = - (x[1] * beta) + x[4] * beta > xdot[2] = - (x[2] * beta) + x[5] * beta > xdot[3] = + x[6] * beta - (x[3] * beta) > xdot[4] = + alpha0 + (alpha + (x[3])**(n) * alpha1) / ((K)**(n) + (x[3])**(n)) - (k1 * x[4]) > xdot[5] = + alpha0 + (alpha + (x[1])**(n) * alpha1) / ((K)**(n) + (x[1])**(n)) - (k1 * x[5]) > xdot[6] = - (k1 * x[6]) + alpha0 + (alpha + (x[2])**(n) * alpha1) / ((K)**(n) + (x[2])**(n)) > g.write('%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n'%(t, xdot[0], xdot[1], xdot[2], xdot[3], xdot[4], xdot[5], xdot[6])) > return xdot > t = arange(0, 12.01, 0.01) > alpha0 = 0.0 > alpha1 = 0.0 > K = 1.0 > beta = 5.0 > n = 2.1 > k1 = 1.0 > alpha = 250.0 > cell = 1.0 > parameters = [alpha0, alpha1, K, beta, n, k1, alpha, cell] > x_0 = [0.0, 5.0, 0.0, 15.0, 0.0, 0.0, 0.0] > g = open('veloc.out', 'w') > args = (parameters,g) > for i in range(100): > x = integrate.odeint(func, x_0, t, args) > > > The speed difference here is very likely related to the fact that selection from arrays now returns numpy scalars instead of standard Python scalars. The arithmetic for these scalars is done using ufuncs instead of the builtin Python arithmetic. Since your inner-most function uses a lot of scalar arithmetic, I'm pretty sure that that is the slow-down. The scalar math module in NumPy version 0.9.8 is intended to speed these operations up. Your feedback after making use of the scalarmath module will be greatly appreciated. The scalarmath module still goes through ufuncs for certain mixed-mode operations which means that certain commutative operations will be slower written one way then the other. I don't like the current situation and am looking for other options. -Travis _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user From SMLidia at lbl.gov Thu May 18 11:26:07 2006 From: SMLidia at lbl.gov (Steve Lidia) Date: Thu, 18 May 2006 08:26:07 -0700 Subject: [SciPy-user] (no subject) Message-ID: <176AC468-81BE-4A8B-A340-7AB70DCE4222@lbl.gov> Hi folks, I'm looking for a simple example of constructing a least squares fit to a multi-component function, ie. fit one set of parameters to the function f=(f1,f2,f3,...) where f1, f2, f3, ... all take the same parameters but have (somewhat) different functional forms and different data to fit to. Is there a simple example somewhere that I can adapt? Please cc your reply to this email directly. Thanks, Steve __________________________________________ Steve Lidia Center For Beam Physics MS 71R0259 Lawrence Berkeley National Laboratory 1 Cyclotron Road Berkeley, CA 94720 USA +1.510.486.6101 __________________________________________ From ryanlists at gmail.com Thu May 18 13:51:57 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Thu, 18 May 2006 13:51:57 -0400 Subject: [SciPy-user] (no subject) In-Reply-To: <176AC468-81BE-4A8B-A340-7AB70DCE4222@lbl.gov> References: <176AC468-81BE-4A8B-A340-7AB70DCE4222@lbl.gov> Message-ID: I think this can be done really simply using sciy.optimize.fmin Create a function that takes a vector of input coefficents and returns a scalar value you want to minimze - the sum of the squared error. Then pass that function to fmin: scipy.optimize.fmin(myfunc,[initial_guess_vector]) Check out help(scipy.optimize.fmin) and let me know if you need more help getting started. Ryan On 5/18/06, Steve Lidia wrote: > Hi folks, > > I'm looking for a simple example of constructing a least squares fit > to a multi-component function, ie. fit one set of parameters to the > function f=(f1,f2,f3,...) where f1, f2, f3, ... all take the same > parameters but have (somewhat) different functional forms and > different data to fit to. > > Is there a simple example somewhere that I can adapt? > > Please cc your reply to this email directly. > > Thanks, > > Steve > > __________________________________________ > Steve Lidia > Center For Beam Physics > MS 71R0259 > Lawrence Berkeley National Laboratory > 1 Cyclotron Road > Berkeley, CA 94720 USA > +1.510.486.6101 > __________________________________________ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From citrog at gmail.com Thu May 18 14:32:01 2006 From: citrog at gmail.com (Gil Citro) Date: Thu, 18 May 2006 14:32:01 -0400 Subject: [SciPy-user] Floating point exception when testing SciPy 0.4.8 Message-ID: <9c80f12d0605181132o459dbd51s7f0e467dfd6f6ce4@mail.gmail.com> I have installed SciPy 0.4.8 on a Debian Sarge box with an Athlon 64 (but running the 32 bit version of Debian) and 1 GB of memory. When I try test it with scipy.test (level=1) I get a floating point error. Here is the output from scipy.test followed by other diagnostic info requested in the INSTALL.txt file. I also am attaching a gzipped file containing the output of the scipy installation command. If anyone has any suggestions about how to troubleshoot this, I'd appreciate it. Thanks. Gil CItro >>> import scipy >>> scipy.test(level=1) Overwriting fft= from scipy.fftpack.basic (was from numpy.dft.fftpack) Overwriting ifft= from scipy.fftpack.basic (was from numpy.dft.fftpack) Found 4 tests for scipy.io.array_import Found 128 tests for scipy.linalg.fblas Found 397 tests for scipy.ndimage Found 10 tests for scipy.integrate.quadpack Found 95 tests for scipy.stats.stats Found 36 tests for scipy.linalg.decomp Found 89 tests for scipy.sparse.sparse Found 20 tests for scipy.fftpack.pseudo_diffs Found 6 tests for scipy.optimize.optimize Found 70 tests for scipy.stats.distributions Found 12 tests for scipy.io.mmio Found 1 tests for scipy.integrate Found 4 tests for scipy.linalg.lapack Found 18 tests for scipy.fftpack.basic Found 1 tests for scipy.optimize.zeros Found 5 tests for scipy.interpolate.fitpack Found 41 tests for scipy.linalg.basic Found 2 tests for scipy.maxentropy.maxentropy Found 341 tests for scipy.special.basic Found 128 tests for scipy.lib.blas.fblas Found 7 tests for scipy.linalg.matfuncs Found 42 tests for scipy.lib.lapack Found 1 tests for scipy.optimize.cobyla Found 16 tests for scipy.lib.blas Found 10 tests for scipy.stats.morestats Found 14 tests for scipy.linalg.blas Found 4 tests for scipy.fftpack.helper Found 4 tests for scipy.signal.signaltools Found 0 tests for __main__ Don't worry about a warning regarding the number of bytes read. Warning: 1000000 bytes requested, 20 bytes read. .......caxpy:n=4 ..caxpy:n=3 ....ccopy:n=4 ..ccopy:n=3 ..Floating point exception [root at bayes root]> python -c 'from numpy.f2py.diagnose import run; run()' ------ os.name='posix' ------ sys.platform='linux2' ------ sys.version: 2.3.5 (#2, Sep 4 2005, 22:01:42) [GCC 3.3.5 (Debian 1:3.3.5-13)] ------ sys.prefix: /usr ------ sys.path=':/usr/lib/python23.zip:/usr/lib/python2.3:/usr/lib/python2.3/plat-linux2:/usr/lib/python2.3/lib-tk:/usr/lib/python2.3/lib-dynload:/usr/local/lib/python2.3/site-packages:/usr/lib/python2.3/site-packages:/usr/lib/python2.3/site-packages/Numeric:/usr/lib/python2.3/site-packages/PIL:/usr/lib/python2.3/site-packages/gtk-2.0:/usr/lib/python2.3/site-packages/vtk_python:/usr/lib/site-python' ------ Found Numeric version '23.8' in /usr/lib/python2.3/site-packages/Numeric/Numeric.pyc Found numarray version '1.1.1' in /usr/lib/python2.3/site-packages/numarray/__init__.pyc Found new numpy version '0.9.6' in /usr/lib/python2.3/site-packages/numpy/__init__.pyc Found f2py2e version '2_2236' in /usr/lib/python2.3/site-packages/numpy/f2py/f2py2e.pyc Found numpy.distutils version '0.4.0' in '/usr/lib/python2.3/site-packages/numpy/distutils/__init__.pyc' ------ Importing numpy.distutils.fcompiler ... ok ------ Checking availability of supported Fortran compilers: customize CompaqFCompiler customize NoneFCompiler customize AbsoftFCompiler Could not locate executable ifort Could not locate executable ifc Could not locate executable ifort Could not locate executable efort Could not locate executable efc customize IntelFCompiler Could not locate executable gfortran Could not locate executable f95 customize GnuFCompiler customize SunFCompiler customize VastFCompiler customize GnuFCompiler customize IbmFCompiler customize Gnu95FCompiler customize IntelVisualFCompiler customize G95FCompiler customize IntelItaniumFCompiler customize PGroupFCompiler customize LaheyFCompiler customize CompaqVisualFCompiler customize MipsFCompiler customize HPUXFCompiler customize IntelItaniumVisualFCompiler customize NAGFCompiler List of available Fortran compilers: --fcompiler=gnu GNU Fortran Compiler (3.3.5) List of unavailable Fortran compilers: --fcompiler=absoft Absoft Corp Fortran Compiler --fcompiler=compaq Compaq Fortran Compiler --fcompiler=compaqv DIGITAL|Compaq Visual Fortran Compiler --fcompiler=g95 GNU Fortran 95 Compiler --fcompiler=gnu95 GNU 95 Fortran Compiler --fcompiler=hpux HP Fortran 90 Compiler --fcompiler=ibm IBM XL Fortran Compiler --fcompiler=intel Intel Fortran Compiler for 32-bit apps --fcompiler=intele Intel Fortran Compiler for Itanium apps --fcompiler=intelev Intel Visual Fortran Compiler for Itanium apps --fcompiler=intelv Intel Visual Fortran Compiler for 32-bit apps --fcompiler=lahey Lahey/Fujitsu Fortran 95 Compiler --fcompiler=mips MIPSpro Fortran Compiler --fcompiler=nag NAGWare Fortran 95 Compiler --fcompiler=none Fake Fortran compiler --fcompiler=pg Portland Group Fortran Compiler --fcompiler=sun Sun|Forte Fortran 95 Compiler --fcompiler=vast Pacific-Sierra Research Fortran 90 Compiler List of unimplemented Fortran compilers: --fcompiler=f Fortran Company/NAG F Compiler For compiler details, run 'config_fc --verbose' setup command. ------ Importing numpy.distutils.cpuinfo ... ok ------ CPU information: getNCPUs has_3dnow has_3dnowext has_mmx has_sse has_sse2 is_32bit is_AMD is_Athlon64 is_singleCPU ------ -------------- next part -------------- A non-text attachment was scrubbed... Name: scipy-build.gz Type: application/x-gzip Size: 1600 bytes Desc: not available URL: From strawman at astraw.com Thu May 18 15:03:22 2006 From: strawman at astraw.com (Andrew Straw) Date: Thu, 18 May 2006 12:03:22 -0700 Subject: [SciPy-user] Floating point exception when testing SciPy 0.4.8 In-Reply-To: <9c80f12d0605181132o459dbd51s7f0e467dfd6f6ce4@mail.gmail.com> References: <9c80f12d0605181132o459dbd51s7f0e467dfd6f6ce4@mail.gmail.com> Message-ID: <446CC4FA.4040700@astraw.com> Gil Citro wrote: > I have installed SciPy 0.4.8 on a Debian Sarge box with an Athlon 64 > (but running the 32 bit version of Debian) and 1 GB of memory. When I > try test it with > > scipy.test (level=1) > > I get a floating point error. GNU libc version 2.3.2 has a bug[1] "feclearexcept() error on CPUs with SSE" (fixed in 2.3.3) which has been submitted to Debian[2] but not fixed in sarge. See http://www.its.caltech.edu/~astraw/coding.html#id3 for more information. [1] http://sources.redhat.com/bugzilla/show_bug.cgi?id=10 [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279294 I'm starting to feel like a broken record... I wish Debian had fixed this. From robert.kern at gmail.com Thu May 18 15:08:13 2006 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 18 May 2006 14:08:13 -0500 Subject: [SciPy-user] Floating point exception when testing SciPy 0.4.8 In-Reply-To: <9c80f12d0605181132o459dbd51s7f0e467dfd6f6ce4@mail.gmail.com> References: <9c80f12d0605181132o459dbd51s7f0e467dfd6f6ce4@mail.gmail.com> Message-ID: <446CC61D.8070901@gmail.com> Gil Citro wrote: > I have installed SciPy 0.4.8 on a Debian Sarge box with an Athlon 64 > (but running the 32 bit version of Debian) and 1 GB of memory. When I > try test it with > > scipy.test (level=1) > > I get a floating point error. Here is the output from scipy.test > followed by other diagnostic info requested in the INSTALL.txt file. > I also am attaching a gzipped file containing the output of the scipy > installation command. Copying Andrew Straw's email from yesterday: """ GNU libc version 2.3.2 has a bug[1] "feclearexcept() error on CPUs with SSE" (fixed in 2.3.3) which has been submitted to Debian[2] but not fixed in sarge. See http://www.its.caltech.edu/~astraw/coding.html#id3 for more information. [1] http://sources.redhat.com/bugzilla/show_bug.cgi?id=10 [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279294 """ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From citrog at gmail.com Thu May 18 15:50:56 2006 From: citrog at gmail.com (Gil Citro) Date: Thu, 18 May 2006 15:50:56 -0400 Subject: [SciPy-user] SciPy Test Error Message-ID: <9c80f12d0605181250r42f3d394o852f80b926d56f30@mail.gmail.com> Thanks again for the help with the floating point exception. After installing the packages pointed to here http://www.its.caltech.edu/~astraw/coding.html#id3 the floating point exception went away. However, I did get the error below. Unfortunately, it's not reproducible. If anyone has any suggestions about how to reproduce it, let me know. Otherwise it looks like SciPy is working for me. Thanks again. Gil ====================================================================== FAIL: check_rvs (scipy.stats.tests.test_distributions.test_zipf) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/stats/tests/test_distributions.py", line 174, in check_rvs assert(numpy.all(vals >= 1)) AssertionError ---------------------------------------------------------------------- Ran 1506 tests in 5.603s From robert.kern at gmail.com Thu May 18 15:54:56 2006 From: robert.kern at gmail.com (Robert Kern) Date: Thu, 18 May 2006 14:54:56 -0500 Subject: [SciPy-user] SciPy Test Error In-Reply-To: <9c80f12d0605181250r42f3d394o852f80b926d56f30@mail.gmail.com> References: <9c80f12d0605181250r42f3d394o852f80b926d56f30@mail.gmail.com> Message-ID: <446CD110.9030409@gmail.com> Gil Citro wrote: > Thanks again for the help with the floating point exception. After > installing the packages pointed to here > > http://www.its.caltech.edu/~astraw/coding.html#id3 > > the floating point exception went away. However, I did get the error > below. Unfortunately, it's not reproducible. If anyone has any > suggestions about how to reproduce it, let me know. Otherwise it > looks like SciPy is working for me. Thanks again. > > Gil > > ====================================================================== > FAIL: check_rvs (scipy.stats.tests.test_distributions.test_zipf) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/usr/lib/python2.3/site-packages/scipy/stats/tests/test_distributions.py", > line 174, in check_rvs > assert(numpy.all(vals >= 1)) > AssertionError > > ---------------------------------------------------------------------- > Ran 1506 tests in 5.603s Its one of the statistical tests of the pseudorandom number generators. They will fail every once in a while if everything is working correctly. If they fail every time, then there is a bug. I believe there is some code that exists to repeat the test if it fails once, but I think *that* part is currently buggy. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From schofield at ftw.at Fri May 19 04:37:34 2006 From: schofield at ftw.at (Ed Schofield) Date: Fri, 19 May 2006 10:37:34 +0200 Subject: [SciPy-user] sparse+slice? (and hello!) In-Reply-To: <446B3D51.1030809@iua.upf.edu> References: <446ACE69.4050104@iua.upf.edu> <446AF035.3070808@iua.upf.edu> <446B06D7.3070203@ftw.at> <446B3D51.1030809@iua.upf.edu> Message-ID: On 17/05/2006, at 5:12 PM, Bram de Jong - MTG wrote: > Ed Schofield wrote: >>> Perhaps slicing along the non-native axes could be supported as >>> well, >>> even if it's really slow... A simple docstring with a message >>> about the >>> speed would solve the problem, while supplying the user with a "full >>> set". For small matrices or really sparse ones it won't be much of a >>> problem I guess (?). >> >> If you don't mind it being slow, an easy way to get slices along >> non-native axes is to convert the matrix format first. For example, >> >>>>> csc.tocsr()[i, :] >> >> does the trick :) > > Okay! > > One more question related to this though ;-) > > Is there a function that does the equivalent of PySparse's dot(A,B) := > transp(A)*B in scipy sparse? I see a dot() but it looks like it > doesn't > do the transpose... Ah, this looks like a bug. I'll try to fix this so dot() does take the transpose. The current behaviour with transpose and conjugate operations seems inconsistent in a few other places. > transp(A)*B ( or A*transp(B) depending on the compressed format) is > fast > when done in 'one pass' as you don't need the transposition, but > slow if > you do it with a transposition in python? Actually, it's very fast if you have a CSR or CSC matrix, since it just toggles the format between the two. It doesn't even need to copy the data. So just use A.T * B for now, until I fix the dot function. In your notation you'll want sparse_matrix.T * sparse_matrix -- Ed From nwagner at iam.uni-stuttgart.de Fri May 19 09:08:37 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Fri, 19 May 2006 15:08:37 +0200 Subject: [SciPy-user] Direct sum in numpy/scipy ? Message-ID: <446DC355.8000408@iam.uni-stuttgart.de> Hi all, How can I build a direct sum of two matrices in numpy/scipy ? Nils http://mathworld.wolfram.com/DirectSum.html http://en.wikipedia.org/wiki/Direct_sum_(matrix) From satyaupadhya at yahoo.co.in Fri May 19 09:14:54 2006 From: satyaupadhya at yahoo.co.in (Satya Upadhya) Date: Fri, 19 May 2006 14:14:54 +0100 (BST) Subject: [SciPy-user] Matrix query Message-ID: <20060519131454.49061.qmail@web8512.mail.in.yahoo.com> Dear Python Users and Gurus, My problem is that i have a distance matrix obtained from the software package PHYLIP. I have placed it in a text file, and using ordinary python i am able to save the matrix elements as a multidimensional array. My problem is that i wish to now convert this multidimensional array into a matrix and subsequently i wish to find the eigenvectors and eigenvalues of this matrix. I tried using scipy (and also earlier the Numeric and LinearAlgebra modules) but i am facing problems. I can generate a new matrix using scipy (and also with Numeric/LinearAlgebra) and can obtain the corresponding eigenvectors. But i am facing a real problem in making scipy accept my multidimensional array as a matrix it can recognize. Please help/give a pointer to a similar query. Thanking you, Satya --------------------------------- Do you have a question on a topic you cant find an Answer to. Try Yahoo! Answers India Get the all new Yahoo! Messenger Beta Now -------------- next part -------------- An HTML attachment was scrubbed... URL: From wbaxter at gmail.com Fri May 19 09:41:31 2006 From: wbaxter at gmail.com (Bill Baxter) Date: Fri, 19 May 2006 22:41:31 +0900 Subject: [SciPy-user] Direct sum in numpy/scipy ? In-Reply-To: <446DC355.8000408@iam.uni-stuttgart.de> References: <446DC355.8000408@iam.uni-stuttgart.de> Message-ID: On 5/19/06, Nils Wagner wrote:Hi all, > How can I build a direct sum of two matrices in numpy/scipy ? Is there something wrong with just allocating the target matrix and assigning the parts to it? Like so: dsum = num.zeros( num.add(a.shape,b.shape) ) dsum[:a.shape[0],:a.shape[1]]=a dsum[a.shape[0]:,a.shape[1]:]=b Full example: >>> import numpy as num >>> a=num.arange(0,12).reshape(3,4) >>> b=num.arange(0,6).reshape(3,2) >>> a array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> b array([[0, 1], [2, 3], [4, 5]]) >>> dsum = num.zeros( num.add(a.shape,b.shape) ) >>> dsum.shape (6, 6) >>> dsum[:a.shape[0],:a.shape[1]]=a >>> dsum[a.shape[0]:,a.shape[1]:]=b >>> dsum array([[ 0, 1, 2, 3, 0, 0], [ 4, 5, 6, 7, 0, 0], [ 8, 9, 10, 11, 0, 0], [ 0, 0, 0, 0, 0, 1], [ 0, 0, 0, 0, 2, 3], [ 0, 0, 0, 0, 4, 5]]) Or maybe you wanted a sparse result? --bb -------------- next part -------------- An HTML attachment was scrubbed... URL: From nwagner at iam.uni-stuttgart.de Fri May 19 10:26:54 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Fri, 19 May 2006 16:26:54 +0200 Subject: [SciPy-user] Direct sum in numpy/scipy ? In-Reply-To: References: <446DC355.8000408@iam.uni-stuttgart.de> Message-ID: <446DD5AE.1000505@iam.uni-stuttgart.de> Bill Baxter wrote: > On 5/19/06, *Nils Wagner* > wrote:Hi all, > > > How can I build a direct sum of two matrices in numpy/scipy ? > > Is there something wrong with just allocating the target matrix and > assigning the parts to it? > Like so: > dsum = num.zeros( num.add(a.shape,b.shape) ) > dsum[:a.shape[0],:a.shape[1]]=a > dsum[a.shape [0]:,a.shape[1]:]=b > > > Full example: > >>> import numpy as num > >>> a=num.arange(0,12).reshape(3,4) > >>> b=num.arange(0,6).reshape(3,2) > >>> a > array([[ 0, 1, 2, 3], > [ 4, 5, 6, 7], > [ 8, 9, 10, 11]]) > >>> b > array([[0, 1], > [2, 3], > [4, 5]]) > > > >>> dsum = num.zeros( num.add(a.shape,b.shape) ) > >>> dsum.shape > (6, 6) > >>> dsum[: a.shape[0],:a.shape[1]]=a > >>> dsum[a.shape[0]:,a.shape[1]:]=b > >>> dsum > array([[ 0, 1, 2, 3, 0, 0], > [ 4, 5, 6, 7, 0, 0], > [ 8, 9, 10, 11, 0, 0], > [ 0, 0, 0, 0, 0, 1], > [ 0, 0, 0, 0, 2, 3], > [ 0, 0, 0, 0, 4, 5]]) > > > Or maybe you wanted a sparse result? > Thank you for your rapid reply. Is it really necessary to initialize the array num.zeros( num.add(a.shape,b.shape) ) ? Nils > --bb > ------------------------------------------------------------------------ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From listservs at mac.com Fri May 19 11:45:34 2006 From: listservs at mac.com (listservs at mac.com) Date: Fri, 19 May 2006 11:45:34 -0400 Subject: [SciPy-user] (no subject) Message-ID: <13942D76-F051-47EB-9E92-1FBE67DF8129@mac.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have a list of arrays that I was hoping to cast to an array of arrays: [array([[0, 0], [1, 2], [1, 3], [1, 4], [1, 5], [2, 2], [0, 0], [2, 2], [0, 0], [0, 0], [1, 2], [0, 2], [1, 2], [0, 3], [3, 4]]), array([[0, 0], [0, 0], [1, 1], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]), array([[1, 1], [0, 0], [0, 0], [1, 1], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [1, 1], [1, 1], [0, 0], [0, 0], [0, 0]])] However, when I call array() on this object, I get: In [31]: array(sampler.data) - ------------------------------------------------------------------------ - --- exceptions.TypeError Traceback (most recent call last) /Users/chris/Research/Manatee/Mortality/ TypeError: an integer is required What am I doing wrong here? I dont see why this should not work. Thanks, Chris - -- Christopher Fonnesbeck + Atlanta, GA + fonnesbeck at mac.com + Contact me on AOL IM using email address -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) iD8DBQFEbegekeka2iCbE4wRAnS9AJ9gftgf90iXQ0YreXt14R07p+KFdACeOV0U FgCxCTUf2uA8aYTP0qWYRb4= =z5Us -----END PGP SIGNATURE----- From morovia at rediffmail.com Fri May 19 12:00:10 2006 From: morovia at rediffmail.com (morovia) Date: 19 May 2006 16:00:10 -0000 Subject: [SciPy-user] matplotlib error after numpy 0.9.8 installation Message-ID: <20060519160010.9198.qmail@webmail50.rediffmail.com> Hello, Did anyone have matplotlib working after recent numpy 0.9.8 version installation. I tried to reinstall matplotlib after numpy installation. I got the error which I appended below. Thanks, Best regards, Morovia. from pylab import * The import of the numpy version of the _transforms module, _ns_transforms, failed. This is is either because numpy was unavailable when matplotlib was compiled, because a dependency of _ns_transforms could not be satisfied, or because the build flag for this module was turned off in setup.py. If it appears that _ns_transforms was not built, make sure you have a working copy of numpy and then re-install matplotlib. Otherwise, the following traceback gives more details: Traceback (most recent call last): File "/disk2/data/cd/user10/bin/myprogs/mpfit-current.py", line 11, in ? from pylab import * File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/pylab.py", line 200, in ? from axes import Axes, PolarAxes File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/axes.py", line 14, in? from artist import Artist, setp File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/artist.py", line 4, in ? from transforms import identity_transform File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/transforms.py", line 189, in ? from _transforms import Value, Point, Interval, Bbox, Affine File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/_transforms.py", line17, in ? from matplotlib._ns_transforms import * ImportError: /disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/_ns_transforms.so: undefined symbol: _ZNSs4_Rep20_S_empty_rep_storageE -------------- next part -------------- An HTML attachment was scrubbed... URL: From fperez.net at gmail.com Fri May 19 12:12:40 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 19 May 2006 10:12:40 -0600 Subject: [SciPy-user] Direct sum in numpy/scipy ? In-Reply-To: <446DD5AE.1000505@iam.uni-stuttgart.de> References: <446DC355.8000408@iam.uni-stuttgart.de> <446DD5AE.1000505@iam.uni-stuttgart.de> Message-ID: On 5/19/06, Nils Wagner wrote: > Thank you for your rapid reply. Is it really necessary to initialize the > array num.zeros( num.add(a.shape,b.shape) ) ? empty() should do. f From robert.kern at gmail.com Fri May 19 12:15:51 2006 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 19 May 2006 11:15:51 -0500 Subject: [SciPy-user] Direct sum in numpy/scipy ? In-Reply-To: References: <446DC355.8000408@iam.uni-stuttgart.de> <446DD5AE.1000505@iam.uni-stuttgart.de> Message-ID: <446DEF37.3020004@gmail.com> Fernando Perez wrote: > On 5/19/06, Nils Wagner wrote: > >>Thank you for your rapid reply. Is it really necessary to initialize the >>array num.zeros( num.add(a.shape,b.shape) ) ? > > empty() should do. The block-off-diagonals need to be zero. So, Nils: yes. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From cookedm at physics.mcmaster.ca Fri May 19 13:37:06 2006 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Fri, 19 May 2006 13:37:06 -0400 Subject: [SciPy-user] matplotlib error after numpy 0.9.8 installation In-Reply-To: <20060519160010.9198.qmail@webmail50.rediffmail.com> (morovia@rediffmail.com's message of "19 May 2006 16:00:10 -0000") References: <20060519160010.9198.qmail@webmail50.rediffmail.com> Message-ID: "morovia" writes: > Hello, > > Did anyone have matplotlib working after recent numpy > 0.9.8 version installation. I tried to reinstall matplotlib > after numpy installation. I got the error which I appended > below. It works for me (well, the subversion version of matplotlib). Did you remove the build/ directory in your matplotlib source directory first? That can screw things up. And for a good measure remove the installed version first from site-packages/ before reinstalling. > Thanks, > Best regards, > Morovia. > > from pylab import * > > The import of the numpy version of the _transforms module, > _ns_transforms, failed. This is is either because numpy was > unavailable when matplotlib was compiled, because a dependency of > _ns_transforms could not be satisfied, or because the build flag for > this module was turned off in setup.py. If it appears that > _ns_transforms was not built, make sure you have a working copy of > numpy and then re-install matplotlib. Otherwise, the following > traceback gives more details: > > Traceback (most recent call last): > File "/disk2/data/cd/user10/bin/myprogs/mpfit-current.py", line 11, in ? > from pylab import * > File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/pylab.py", line 1, in ? > from matplotlib.pylab import * > File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/pylab.py", line 200, in ? > from axes import Axes, PolarAxes > File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/axes.py", line 14, in? > from artist import Artist, setp > File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/artist.py", line 4, in ? > from transforms import identity_transform > File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/transforms.py", line 189, in ? > from _transforms import Value, Point, Interval, Bbox, Affine > File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/_transforms.py", line17, in ? > from matplotlib._ns_transforms import * > ImportError: /disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/matplotlib/_ns_transforms.so: undefined symbol: _ZNSs4_Rep20_S_empty_rep_storageE > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From schofield at ftw.at Fri May 19 13:41:07 2006 From: schofield at ftw.at (Ed Schofield) Date: Fri, 19 May 2006 19:41:07 +0200 Subject: [SciPy-user] (no subject) In-Reply-To: <13942D76-F051-47EB-9E92-1FBE67DF8129@mac.com> References: <13942D76-F051-47EB-9E92-1FBE67DF8129@mac.com> Message-ID: <446E0333.9050108@ftw.at> listservs at mac.com wrote: > I have a list of arrays that I was hoping to cast to an array of > arrays: > > [array([[0, 0], > [1, 2], > [1, 3], > [1, 4], > [1, 5], > [2, 2], > [0, 0], > [2, 2], > [0, 0], > [0, 0], > [1, 2], > [0, 2], > [1, 2], > [0, 3], > [3, 4]]), > array([[0, 0], > [0, 0], > [1, 1], > [0, 0], > [0, 0], > [0, 0], > [0, 0], > [0, 0], > [0, 0], > [0, 0], > [0, 0], > [0, 0]]), > array([[1, 1], > [0, 0], > [0, 0], > [1, 1], > [0, 0], > [0, 0], > [0, 0], > [0, 0], > [0, 0], > [0, 0], > [1, 1], > [1, 1], > [0, 0], > [0, 0], > [0, 0]])] > > However, when I call array() on this object, I get: > > In [31]: array(sampler.data) > ------------------------------------------------------------------------ > --- > exceptions.TypeError Traceback (most > recent call last) > > /Users/chris/Research/Manatee/Mortality/ > > TypeError: an integer is required > > > What am I doing wrong here? I dont see why this should not work. It looks like your arrays are of different lengths. They'd need to have the same lengths to layer them above each other as a 3d array. But I'd agree that the exception string could be more informative ... -- Ed From fperez.net at gmail.com Fri May 19 13:47:24 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Fri, 19 May 2006 11:47:24 -0600 Subject: [SciPy-user] Direct sum in numpy/scipy ? In-Reply-To: <446DEF37.3020004@gmail.com> References: <446DC355.8000408@iam.uni-stuttgart.de> <446DD5AE.1000505@iam.uni-stuttgart.de> <446DEF37.3020004@gmail.com> Message-ID: On 5/19/06, Robert Kern wrote: > Fernando Perez wrote: > > On 5/19/06, Nils Wagner wrote: > > > >>Thank you for your rapid reply. Is it really necessary to initialize the > >>array num.zeros( num.add(a.shape,b.shape) ) ? > > > > empty() should do. > > The block-off-diagonals need to be zero. So, Nils: yes. Note to self: disable the Send button before there's enough caffeine in the bloodstream :) Cheers, f From lev at columbia.edu Fri May 19 13:52:21 2006 From: lev at columbia.edu (Lev Givon) Date: Fri, 19 May 2006 13:52:21 -0400 Subject: [SciPy-user] matplotlib error after numpy 0.9.8 installation In-Reply-To: <20060519160010.9198.qmail@webmail50.rediffmail.com> References: <20060519160010.9198.qmail@webmail50.rediffmail.com> Message-ID: <20060519175221.GD9048@avicenna.cc.columbia.edu> Received from morovia on Fri, May 19, 2006 at 12:00:10PM EDT: > > Hello, > > Did anyone have matplotlib working after recent numpy > 0.9.8 version installation. I tried to reinstall matplotlib > after numpy installation. I got the error which I appended > below. > > Thanks, > Best regards, > Morovia. > (snip) I was able to rebuild and use matplotlib 0.87.2 with numpy 0.9.8 successfully. L.G. From nwagner at iam.uni-stuttgart.de Fri May 19 13:55:44 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Fri, 19 May 2006 19:55:44 +0200 Subject: [SciPy-user] Direct sum in numpy/scipy ? In-Reply-To: References: <446DC355.8000408@iam.uni-stuttgart.de> <446DD5AE.1000505@iam.uni-stuttgart.de> <446DEF37.3020004@gmail.com> Message-ID: On Fri, 19 May 2006 11:47:24 -0600 "Fernando Perez" wrote: > On 5/19/06, Robert Kern wrote: >> Fernando Perez wrote: >> > On 5/19/06, Nils Wagner >>wrote: >> > >> >>Thank you for your rapid reply. Is it really necessary >>to initialize the >> >>array num.zeros( num.add(a.shape,b.shape) ) ? >> > >> > empty() should do. >> >> The block-off-diagonals need to be zero. So, Nils: yes. > > Note to self: disable the Send button before there's >enough caffeine > in the bloodstream :) > > Cheers, > > f > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user And the direct sum for sparse matrices - how about that ? Nils From fonnesbeck at mac.com Fri May 19 14:21:20 2006 From: fonnesbeck at mac.com (Christopher Fonnesbeck) Date: Fri, 19 May 2006 14:21:20 -0400 Subject: [SciPy-user] (no subject) In-Reply-To: <446E0333.9050108@ftw.at> References: <13942D76-F051-47EB-9E92-1FBE67DF8129@mac.com> <446E0333.9050108@ftw.at> Message-ID: <514EFE68-F015-4C17-AD47-64431E2E5FE3@mac.com> On May 19, 2006, at 1:41 PM, Ed Schofield wrote: > It looks like your arrays are of different lengths. They'd need to > have > the same lengths to layer them above each other as a 3d array. > > But I'd agree that the exception string could be more informative ... You are right; thanks. I wasnt getting the data I thought I was. Sorry for the oversight. C. -- Christopher Fonnesbeck + Atlanta, GA + fonnesbeck at mac.com + Contact me on AOL IM using email address -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2365 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: From nztideman at yahoo.co.nz Fri May 19 18:15:59 2006 From: nztideman at yahoo.co.nz (Derek Goring) Date: Sat, 20 May 2006 10:15:59 +1200 (NZST) Subject: [SciPy-user] SciPy vs numpy Message-ID: <20060519221600.56147.qmail@web53910.mail.yahoo.com> This may seem like a really dumb question, but: If I have SciPy, do I need numpy? Then, in code that has numpy.xxx, can I simply replace it with scipy.xxx? The reason I ask is that I could not locate a debian package of numpy for my Xandros Networks to install. Then it occurred to me that maybe I didn't need numpy anyway. Is this correct? Derek ________________ Derek Goring Mulgor Consulting Ltd 24 Brockworth Place Christchurch, New Zealand Phone: 64 3 343 5400 Mobile: 64 272 777 639 Website: www.mulgor.co.nz Send instant messages to your online friends http://au.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Fri May 19 18:27:14 2006 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 19 May 2006 17:27:14 -0500 Subject: [SciPy-user] SciPy vs numpy In-Reply-To: <20060519221600.56147.qmail@web53910.mail.yahoo.com> References: <20060519221600.56147.qmail@web53910.mail.yahoo.com> Message-ID: <446E4642.7030106@gmail.com> Derek Goring wrote: > This may seem like a really dumb question, but: > If I have SciPy, do I need numpy? > Then, in code that has numpy.xxx, can I simply replace it with scipy.xxx? > > The reason I ask is that I could not locate a debian package of numpy > for my Xandros Networks to install. Then it occurred to me that maybe I > didn't need numpy anyway. Is this correct? scipy 0.4+ requires numpy. scipy 0.3.x requires Numeric. The Debian package you are looking at is almost certainly scipy 0.3.x, which is *not* a replacement for numpy. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From aisaac at american.edu Fri May 19 19:50:39 2006 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 19 May 2006 19:50:39 -0400 Subject: [SciPy-user] SciPy vs numpy In-Reply-To: <20060519221600.56147.qmail@web53910.mail.yahoo.com> References: <20060519221600.56147.qmail@web53910.mail.yahoo.com> Message-ID: On Sat, 20 May 2006, (NZST) Derek Goring apparently wrote: > SciPy, do I need numpy? http://www.scipy.org/Download hth, Alan Isaac From nztideman at yahoo.co.nz Sat May 20 00:47:30 2006 From: nztideman at yahoo.co.nz (Derek Goring) Date: Sat, 20 May 2006 16:47:30 +1200 (NZST) Subject: [SciPy-user] SciPy vs numpy In-Reply-To: <446E4642.7030106@gmail.com> Message-ID: <20060520044730.98184.qmail@web53909.mail.yahoo.com> Robert Kern wrote: scipy 0.4+ requires numpy. scipy 0.3.x requires Numeric. The Debian package you are looking at is almost certainly scipy 0.3.x, which is *not* a replacement for numpy. This is very confusing........... I'm running Xandros and I've used Xandros Networks to install the Python packages. According to my system, I have Python2.3 installed and along with it numeric, numeric-ext, matplotlib, scipy and several other packages. When I go look at /usr/lib/python2.3/site-packages/Numeric the only reference to numpy is _numpy.so. And if I try to import numpy, it says there is no module called numpy. What have I done wrong? Also, when I try to import pylab this is what I get: >>> import pylab Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/pylab.py", line 1, in ? from matplotlib.pylab import * File "/usr/lib/python2.3/site-packages/matplotlib/pylab.py", line 199, in ? import backends File "/usr/lib/python2.3/site-packages/matplotlib/backends/__init__.py", line19, in ? globals(),locals(),[backend_name]) File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtkagg.py", line 11, in ? from backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\ File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py", line 21, in ? from backend_gdk import RendererGDK File "/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gdk.py", line 31, in ? import gtk, pango File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line 37, in ? from _gtk import * RuntimeError: could not open display ________________ Derek Goring Mulgor Consulting Ltd 24 Brockworth Place Christchurch, New Zealand Phone: 64 3 343 5400 Mobile: 64 272 777 639 Website: www.mulgor.co.nz Send instant messages to your online friends http://au.messenger.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Sat May 20 02:45:51 2006 From: robert.kern at gmail.com (Robert Kern) Date: Sat, 20 May 2006 01:45:51 -0500 Subject: [SciPy-user] SciPy vs numpy In-Reply-To: <20060520044730.98184.qmail@web53909.mail.yahoo.com> References: <20060520044730.98184.qmail@web53909.mail.yahoo.com> Message-ID: <446EBB1F.8060803@gmail.com> Derek Goring wrote: > > */Robert Kern /* wrote: > > scipy 0.4+ requires numpy. scipy 0.3.x requires Numeric. The Debian > package you > are looking at is almost certainly scipy 0.3.x, which is *not* a > replacement for > numpy. > > This is very confusing........... > I'm running Xandros and I've used Xandros Networks to install the Python > packages. > According to my system, I have Python2.3 installed and along with it > numeric, numeric-ext, matplotlib, scipy and several other packages. > When I go look at /usr/lib/python2.3/site-packages/Numeric the only > reference to numpy is _numpy.so. And if I try to import numpy, it says > there is no module called numpy. > > What have I done wrong? You've done nothing wrong, but the packages in Xandros are old. For the history of Numeric and numpy, please read http://www.scipy.org/History_of_SciPy The short form: numpy is a rewrite of Numeric and obsoletes it. However, there is the unfortunate history of "NumPy" being a nickname for Numeric. If you want to use actively developed code, then you will have to install numpy and scipy 0.4 from source instead of relying on the Xandros packages. > Also, when I try to import pylab this is what I get: > >>>> import pylab > Traceback (most recent call last): > File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line > 37, in ? > from _gtk import * > RuntimeError: could not open display It means that it cannot open an X11 window. You need to be running an X server for the UI parts of matplotlib to work. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From fredantispam at free.fr Sat May 20 10:48:15 2006 From: fredantispam at free.fr (fred) Date: Sat, 20 May 2006 16:48:15 +0200 Subject: [SciPy-user] bessel jn In-Reply-To: References: <44638B63.80605@free.fr> Message-ID: <446F2C2F.2030000@free.fr> Hi all, I want to display cylindrical resonator eigenmodes using imv's mayavi & scipy bessel functions. (see attached file). Almost works fine, I can display TE modes on Ex and Ey : ./foo 1 1 1 TE_Ex ./foo 1 1 1 TE_Ey But I can't display module of E = sqrt(Ex*Ex + Ey*Ey) : ./foo 1 1 1 TE_Ev I get an error message : Traceback (most recent call last): File "./foo.py", line 99, in ? v = imv.surf(x, y, TE_Ev) File "/usr/lib/python2.3/site-packages/mayavi/tools/imv.py", line 256, in surf zval = Numeric.ravel(sampler(x, y, z, f_args=f_args, f_keyw=f_keyw)) File "/usr/lib/python2.3/site-packages/mayavi/tools/imv.py", line 186, in sampler Numeric.transpose(ya[:,Numeric.NewAxis] + File "./foo.py", line 80, in TE_Ev return (sqrt(TE_Ex(x,y)*TE_Ex(x,y) + TE_Ey(x,y)*TE_Ey(x,y))) OverflowError: math range error It seems it comes from bessel functions because, without it, it works fine. What's wrong ? Thanks in advance. Cheers, -- Dr. Fred. -------------- next part -------------- A non-text attachment was scrubbed... Name: foo.py Type: text/x-python Size: 2493 bytes Desc: not available URL: From fredantispam at free.fr Sat May 20 15:17:01 2006 From: fredantispam at free.fr (fred) Date: Sat, 20 May 2006 21:17:01 +0200 Subject: [SciPy-user] zeros of bessel jv In-Reply-To: <446F2C2F.2030000@free.fr> References: <44638B63.80605@free.fr> <446F2C2F.2030000@free.fr> Message-ID: <446F6B2D.3050709@free.fr> Re, There is jn_zeros() (& jnp_zeros()) to find zeros of the 1st kind Bessel Jn (& its first derivative Jn') function. How can one find zeros of 2nd kind Bessel Jv function (and its first derivative Jv') ? Cheers, -- Dr. Fred. From alpha-scipy at dinomight.de Sun May 21 15:36:12 2006 From: alpha-scipy at dinomight.de (Alpha) Date: Sun, 21 May 2006 21:36:12 +0200 Subject: [SciPy-user] fft-problems Message-ID: <20060521213612.0fd31420@Kakao> Hello everybody, playing around with scipy I'm stuck with a problem with fftconvolve in scipy.signal and other fft-related stuff. Fft operations yield too many zeros, much to high coefficients and many NANs in the matrix. The code below illustrates my problem. I'd be thankful for any help or comments. Thanks, Alpha import scipy from scipy import * a = array([[1,1,1],[1,1,1],[1,1,1]]) print(a) print(scipy.signal.convolve(a,a)) print(scipy.signal.fftconvolve(a,a)) # both results should be equal or at leas similar, yet they aren't This is the output on my system: >>> print(a) [[1 1 1] [1 1 1] [1 1 1]] >>> print(scipy.signal.convolve(a,a)) [[1 2 3 2 1] [2 4 6 4 2] [3 6 9 6 3] [2 4 6 4 2] [1 2 3 2 1]] >>> print(scipy.signal.fftconvolve(a,a)) [[ 2.54728497e+014 2.40207507e+287 1.09183674e+277 1.98812999e+286 1.42688102e+286] [ 8.09194231e+284 4.34718284e+284 -6.99555293e+281 6.99555647e+281 -4.34718284e+284] [ 6.80511448e+286 -1.42688102e+286 -1.98812999e+286 0.00000000e+000 0.00000000e+000] [ 0.00000000e+000 0.00000000e+000 0.00000000e+000 0.00000000e+000 0.00000000e+000] [ 0.00000000e+000 0.00000000e+000 0.00000000e+000 0.00000000e+000 0.00000000e+000]] -- From fredantispam at free.fr Sun May 21 19:09:48 2006 From: fredantispam at free.fr (fred) Date: Mon, 22 May 2006 01:09:48 +0200 Subject: [SciPy-user] bessel jn In-Reply-To: <446F2C2F.2030000@free.fr> References: <44638B63.80605@free.fr> <446F2C2F.2030000@free.fr> Message-ID: <4470F33C.5010707@free.fr> fred a ?crit : > Hi all, > > I want to display cylindrical resonator eigenmodes using imv's mayavi & > scipy bessel functions. > (see attached file). > > Almost works fine, I can display TE modes on Ex and Ey : > ./foo 1 1 1 TE_Ex > ./foo 1 1 1 TE_Ey > > But I can't display module of E = sqrt(Ex*Ex + Ey*Ey) : > ./foo 1 1 1 TE_Ev Ok, seems that python does not handle correctly jn(r)/r for r = 0 (NaN) whereas limit exists. Two solutions : 1) if r = 0, I can set r=1e-5 and it works fine. 2) But I could also calculate limit of jn(r)/r in r = 0. How can I do this ? I read numpy doc and saw nothing. Cheers, -- Fred. From arnd.baecker at web.de Mon May 22 01:47:54 2006 From: arnd.baecker at web.de (Arnd Baecker) Date: Mon, 22 May 2006 07:47:54 +0200 (CEST) Subject: [SciPy-user] bessel jn In-Reply-To: <4470F33C.5010707@free.fr> References: <44638B63.80605@free.fr> <446F2C2F.2030000@free.fr> <4470F33C.5010707@free.fr> Message-ID: Moin, On Mon, 22 May 2006, fred wrote: > fred a ?crit : > > Hi all, > > > > I want to display cylindrical resonator eigenmodes using imv's mayavi & > > scipy bessel functions. > > (see attached file). > > > > Almost works fine, I can display TE modes on Ex and Ey : > > ./foo 1 1 1 TE_Ex > > ./foo 1 1 1 TE_Ey > > > > But I can't display module of E = sqrt(Ex*Ex + Ey*Ey) : > > ./foo 1 1 1 TE_Ev > Ok, seems that python does not handle correctly jn(r)/r for r = 0 (NaN) > whereas limit exists. Depends on n. For n=0 the limit is +infinity. Independent of this, python *does* handle everything correctly. For n>0 consider the expansion of J_n(r) around r=0 (eg. consult Abramowitz/Stegun) and work out the result analytically. You may use the resulting formula for a small range of values of r. > Two solutions : > 1) if r = 0, I can set r=1e-5 and it works fine. > 2) But I could also calculate limit of jn(r)/r in r = 0. > How can I do this ? > I read numpy doc and saw nothing. Well, the guide to numpy and numpy docs contain quite a lot, but don't aim at substituting a book on calculus. Best, Arnd From fredantispam at free.fr Mon May 22 02:03:37 2006 From: fredantispam at free.fr (fred) Date: Mon, 22 May 2006 08:03:37 +0200 Subject: [SciPy-user] bessel jn In-Reply-To: References: <44638B63.80605@free.fr> <446F2C2F.2030000@free.fr> <4470F33C.5010707@free.fr> Message-ID: <44715439.4000201@free.fr> Arnd Baecker a ?crit : > Depends on n. For n=0 the limit is +infinity. > Independent of this, python *does* handle everything correctly. I was thinking that Jn(r)/r for n>0 in r=0 was not a problem for python. > For n>0 consider the expansion of J_n(r) around r=0 > (eg. consult Abramowitz/Stegun) and work out the result analytically. > You may use the resulting formula for a small range of values of r. Ok. > >>Two solutions : >>1) if r = 0, I can set r=1e-5 and it works fine. >>2) But I could also calculate limit of jn(r)/r in r = 0. >>How can I do this ? >>I read numpy doc and saw nothing. > > Well, the guide to numpy and numpy docs contain quite a lot, > but don't aim at substituting a book on calculus. I was meaning that there is in doc methods to calculate primitive for example, so why not limit in x=0. Cheers, -- Fred. From robert.kern at gmail.com Mon May 22 02:13:21 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 22 May 2006 01:13:21 -0500 Subject: [SciPy-user] bessel jn In-Reply-To: <44715439.4000201@free.fr> References: <44638B63.80605@free.fr> <446F2C2F.2030000@free.fr> <4470F33C.5010707@free.fr> <44715439.4000201@free.fr> Message-ID: <44715681.4060402@gmail.com> fred wrote: > Arnd Baecker a ?crit : > >>Depends on n. For n=0 the limit is +infinity. >>Independent of this, python *does* handle everything correctly. > > I was thinking that Jn(r)/r for n>0 in r=0 was not a problem for python. And Python does indeed give you the correct answer for the calculation you asked it to perform. 0.0 / 0.0 must give a NaN in a correct IEEE-754 floating point implementation. If you want to calculate something else, then you need to tell it to calculate something else. >>>Two solutions : >>>1) if r = 0, I can set r=1e-5 and it works fine. >>>2) But I could also calculate limit of jn(r)/r in r = 0. >>>How can I do this ? >>>I read numpy doc and saw nothing. >> >>Well, the guide to numpy and numpy docs contain quite a lot, >>but don't aim at substituting a book on calculus. > > I was meaning that there is in doc methods to calculate primitive for > example, > so why not limit in x=0. It's somewhat out-of-scope for the book. It's not a general numerical methods text. There are other resources for that. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From nwagner at iam.uni-stuttgart.de Mon May 22 08:05:05 2006 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Mon, 22 May 2006 14:05:05 +0200 Subject: [SciPy-user] isodd(A), iseven(A) Message-ID: <4471A8F1.5080609@iam.uni-stuttgart.de> Hi all, Has someone written a function that determines which elements of an array are odd/even numbers ? Any pointer would be appreciated. Nils From robert.kern at gmail.com Mon May 22 08:06:56 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 22 May 2006 07:06:56 -0500 Subject: [SciPy-user] isodd(A), iseven(A) In-Reply-To: <4471A8F1.5080609@iam.uni-stuttgart.de> References: <4471A8F1.5080609@iam.uni-stuttgart.de> Message-ID: <4471A960.2080904@gmail.com> Nils Wagner wrote: > Hi all, > > Has someone written a function that determines which elements of an > array are odd/even numbers ? > > Any pointer would be appreciated. some_array % 2 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From lev at columbia.edu Mon May 22 09:20:29 2006 From: lev at columbia.edu (Lev Givon) Date: Mon, 22 May 2006 09:20:29 -0400 Subject: [SciPy-user] fft-problems In-Reply-To: <20060521213612.0fd31420@Kakao> References: <20060521213612.0fd31420@Kakao> Message-ID: <20060522132029.GF28457@avicenna.cc.columbia.edu> Received from Alpha on Sun, May 21, 2006 at 03:36:12PM EDT: > Hello everybody, > > playing around with scipy I'm stuck with a problem with fftconvolve > in scipy.signal and other fft-related stuff. Fft operations yield too > many zeros, much to high coefficients and many NANs in the matrix. > > The code below illustrates my problem. I'd be thankful for any help > or comments. > > Thanks, > Alpha > > > > import scipy > from scipy import * > a = array([[1,1,1],[1,1,1],[1,1,1]]) > print(a) > print(scipy.signal.convolve(a,a)) > print(scipy.signal.fftconvolve(a,a)) > # both results should be equal or at leas similar, yet they aren't > > > This is the output on my system: > >>> print(a) > [[1 1 1] > [1 1 1] > [1 1 1]] > > >>> print(scipy.signal.convolve(a,a)) > [[1 2 3 2 1] > [2 4 6 4 2] > [3 6 9 6 3] > [2 4 6 4 2] > [1 2 3 2 1]] > > >>> print(scipy.signal.fftconvolve(a,a)) > [[ 2.54728497e+014 2.40207507e+287 1.09183674e+277 > 1.98812999e+286 1.42688102e+286] > [ 8.09194231e+284 4.34718284e+284 -6.99555293e+281 > 6.99555647e+281 -4.34718284e+284] > [ 6.80511448e+286 -1.42688102e+286 -1.98812999e+286 > 0.00000000e+000 0.00000000e+000] > [ 0.00000000e+000 0.00000000e+000 0.00000000e+000 > 0.00000000e+000 0.00000000e+000] > [ 0.00000000e+000 0.00000000e+000 0.00000000e+000 > 0.00000000e+000 0.00000000e+000]] > > -- > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user convolve and fftconvolve returned consistent answers when I tried the above code on scipy 0.4.8 built with numpy 0.9.8 and fftw 3.0.1. L.G. From hugovdm at gmail.com Mon May 22 10:50:00 2006 From: hugovdm at gmail.com (Hugo van der Merwe) Date: Mon, 22 May 2006 16:50:00 +0200 Subject: [SciPy-user] linalg.lstsq: inconsistent return "type"? In-Reply-To: <37f261b0605110328p51bdc7e7l36e1706dfb56d6ec@mail.gmail.com> References: <37f261b0605110328p51bdc7e7l36e1706dfb56d6ec@mail.gmail.com> Message-ID: <37f261b0605220750i4385798eoa56755c8a201b0cb@mail.gmail.com> (Message below was rejected on 11th due to me not being subscribed) ---------- Forwarded message ---------- From: Hugo van der Merwe Date: May 11, 2006 12:28 PM Subject: linalg.lstsq: inconsistent return "type"? To: scipy-user at scipy.net Consider the attached example, which solves for three parameters, first given four samples (overspecified), then three (precisely specified), then two (underspecified)... In the first two cases lstsq returns a 1D array as expected. In the last case, it returns a 2D array (with size 3x1). Is this correct behaviour? I would have expected 1D return values consistently... Also, replacing "from scipy import linalg" with "from numpy import linalg" fixes the behaviour, thus numpy does the right thing, scipy not. Comments? Thanks, Hugo van der Merwe -------------- next part -------------- A non-text attachment was scrubbed... Name: testlstsq.py Type: text/x-python Size: 574 bytes Desc: not available URL: From chanley at stsci.edu Mon May 22 13:01:42 2006 From: chanley at stsci.edu (Christopher Hanley) Date: Mon, 22 May 2006 13:01:42 -0400 Subject: [SciPy-user] PYFITS 1.1 "beta" release Message-ID: <4471EE76.9030906@stsci.edu> ------------------ | PYFITS Release | ------------------ Space Telescope Science Institute is pleased to announce the "beta" release of PyFITS 1.1. This release includes support for both the NUMPY and NUMARRAY array packages. This software can be downloaded at: http://www.stsci.edu/resources/software_hardware/pyfits/Download The NUMPY support in PyFITS is not nearly as well tested as the NUMARRAY support. We expect that you will encounter bugs. Please send bug reports to "help at stsci.edu". We intend to support NUMARRAY and NUMPY simultaneously for a transition period of no less than 1 year. Eventually, however, support for NUMARRAY will disappear. During this period, it is likely that new features will appear only for NUMPY. The support for NUMARRAY will primarily be to fix serious bugs and handle platform updates. ----------- | Version | ----------- Version 1.1b; May 22, 2006 ------------------------------- | Major Changes since v1.1a2 | ------------------------------- * Modified verify method of _Verify class to eliminate printing of warning messages when an exception is raised. * The following problems have been corrected in the NUMPY version of PYFITS as of NUMPY version 0.9.8: - It is now possible to create single field recarrays using string format input. - NUMPY has corrected a problem in which field access in recarrays was broken when the field name matched a class method or attribute. - NUMPY now properly handles byte-ordering when using index arrays. ------------------------- | Software Requirements | ------------------------- PyFITS Version 1.1a2 REQUIRES: * Python 2.3 or later * NUMPY 0.9.8 or NUMARRAY --------------------- | Installing PyFITS | --------------------- PyFITS 1.1b is distributed as a Python distutils module. Installation simply involves unpacking the package and executing % python setup.py install to install it in Python's site-packages directory. Alternatively the command %python setup.py install --local="/destination/directory/" will install PyFITS in an arbitrary directory which should be placed on PYTHONPATH. Once numarray or numpy has been installed, then PyFITS should be available for use under Python. ----------------- | Download Site | ----------------- http://www.stsci.edu/resources/software_hardware/pyfits/Download ---------- | Usage | ---------- Users will issue an "import pyfits" command as in the past. However, the use of the NUMPY or NUMARRAY version of PyFITS will be controlled by an environment variable called NUMERIX. Set NUMERIX to 'numarray' for the NUMARRAY version of PyFITS. Set NUMERIX to 'numpy' for the NUMPY version of pyfits. If only one array package is installed, that package's version of PyFITS will be imported. If both packages are installed the NUMERIX value is used to decide which version to import. If no NUMERIX value is set then the NUMARRAY version of PyFITS will be imported. Anything else will raise an exception upon import. --------------- | Bug Reports | --------------- Please send all PyFITS bug reports to help at stsci.edu ------------------ | Advanced Users | ------------------ Users who would like the "bleeding" edge of PyFITS can retrieve the software from our SUBVERSION repository hosted at: http://astropy.scipy.org/svn/pyfits/trunk We also provide a Trac site at: http://projects.scipy.org/astropy/pyfits/wiki -- Christopher Hanley Systems Software Engineer Space Telescope Science Institute 3700 San Martin Drive Baltimore MD, 21218 (410) 338-4338 From jdhunter at ace.bsd.uchicago.edu Mon May 22 13:09:40 2006 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Mon, 22 May 2006 12:09:40 -0500 Subject: [SciPy-user] PSF mentors, score request Message-ID: <87very6l63.fsf@peds-pc311.bsd.uchicago.edu> Those of you who are PSF mentors for the summer of code, could I ask you to take a look at Edin's resubmitted proposal for enhancing mathtext http://code.google.com/soc/psf/app.html?csaid=edin.salkovic%40gmail.com%3A048a69f9%3A96f5f65b Google will be funding 25 PSF projects, and this one will need a higher score to make the cut. I think the work he is proposing will be a nice enhancement to the mathtext facility which is used by both matplotlib and chaco, and since one of Edin's goals is to refactor mathtext into a standalone project, it should see some usage beyond those two projects. Thanks! JDH From ajikoe at gmail.com Mon May 22 18:26:10 2006 From: ajikoe at gmail.com (Pujo Aji) Date: Tue, 23 May 2006 00:26:10 +0200 Subject: [SciPy-user] problem testing weave in windows xp Message-ID: Hello I use python 2.4.3 windows xp sp2, scipy 0.4.8 When I test scipy.weave I have got the following message: C:\>python Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import scipy >>> import scipy.weave >>> scipy.weave.test() Found 16 tests for scipy.weave.slice_handler Found 0 tests for scipy.weave.c_spec Found 2 tests for scipy.weave.blitz_tools building extensions here: c:\docume~1\ajikoe\locals~1\temp\ajikoe\python24_compiled\m3 Found 1 tests for scipy.weave.ext_tools Found 74 tests for scipy.weave.size_check Found 9 tests for scipy.weave.build_tools Found 0 tests for scipy.weave.inline_tools Found 1 tests for scipy.weave.ast_tools Found 0 tests for scipy.weave.wx_spec Found 3 tests for scipy.weave.standard_array_spec Found 26 tests for scipy.weave.catalog Found 0 tests for __main__ ...............................EE..............E..E........E................EE...............warning: specified build_dir '_bad_path_' does not exist or is not writable. Trying de .....warning: specified build_dir '_bad_path_' does not exist or is not writable. Trying default locations ................................removing 'c:\docume~1\ajikoe\locals~1\temp\tmpf8pwkecat_test' (and everything under it) error removing c:\docume~1\ajikoe\locals~1\temp\tmpf8pwkecat_test: c:\docume~1\ajikoe\locals~1\temp\tmpf8pwkecat_test\win3224compiled_catalog: Permission denied error removing c:\docume~1\ajikoe\locals~1\temp\tmpf8pwkecat_test: c:\docume~1\ajikoe\locals~1\temp\tmpf8pwkecat_test: Directory not empty .removing 'c:\docume~1\ajikoe\locals~1\temp\tmpcpvsaicat_test' (and everything under it) . ====================================================================== ERROR: check_error1 (scipy.weave.tests.test_size_check.test_dummy_array) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 99, in check_error1 self.generic_error_test(x,y) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 134, in generic_error_test self.generic_test('',x,y) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 131, in generic_test self.assert_array_equal('',actual,desired) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 110, in assert_array_equal assert(actual == desired) File "C:\Python24\Lib\site-packages\scipy\weave\size_check.py", line 122, in __cmp__ if len(self.shape) == len(other.shape) == 0: AttributeError: 'tuple' object has no attribute 'shape' ====================================================================== ERROR: check_error2 (scipy.weave.tests.test_size_check.test_dummy_array) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 102, in check_error2 self.generic_error_test(x,y) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 134, in generic_error_test self.generic_test('',x,y) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 131, in generic_test self.assert_array_equal('',actual,desired) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 110, in assert_array_equal assert(actual == desired) File "C:\Python24\Lib\site-packages\scipy\weave\size_check.py", line 122, in __cmp__ if len(self.shape) == len(other.shape) == 0: AttributeError: 'tuple' object has no attribute 'shape' ====================================================================== ERROR: check_1d_3 ( scipy.weave.tests.test_size_check.test_dummy_array_indexing) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 207, in check_1d_3 if nx.which[0] != "numarray": AttributeError: 'module' object has no attribute 'which' ====================================================================== ERROR: check_1d_6 ( scipy.weave.tests.test_size_check.test_dummy_array_indexing) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 214, in check_1d_6 if nx.which[0] != "numarray": AttributeError: 'module' object has no attribute 'which' ====================================================================== ERROR: through a bunch of different indexes at it for good measure. ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 265, in check_1d_random self.generic_1d('a[%s:%s:%s]' %(beg,end,step)) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 174, in generic_1d self.generic_wrap(a,expr) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 164, in generic_wrap desired = array(eval(expr).shape) File "", line 0, in ? ValueError: slice step cannot be zero ====================================================================== ERROR: through a bunch of different indexes at it for good measure. ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 289, in check_2d_random self.generic_2d(expr) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 177, in generic_2d self.generic_wrap(a,expr) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 164, in generic_wrap desired = array(eval(expr).shape) File "", line 0, in ? ValueError: slice step cannot be zero ====================================================================== ERROR: through a bunch of different indexes at it for good measure. ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 303, in check_3d_random self.generic_3d(expr) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 180, in generic_3d self.generic_wrap(a,expr) File "C:\Python24\Lib\site-packages\scipy\weave\tests\test_size_check.py", line 164, in generic_wrap desired = array(eval(expr).shape) File "", line 0, in ? ValueError: slice step cannot be zero ---------------------------------------------------------------------- Ran 132 tests in 3.535s FAILED (errors=7) >>> Please help. Sincerely Yours, pujo -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajikoe at gmail.com Mon May 22 18:38:42 2006 From: ajikoe at gmail.com (Pujo Aji) Date: Tue, 23 May 2006 00:38:42 +0200 Subject: [SciPy-user] No scipy.ga and scipy.cow ? Message-ID: Hello, Is scipy.ga and scipy.cow removed from scipy 0.4.8 ? Thanks, pujo -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Mon May 22 20:01:37 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 22 May 2006 19:01:37 -0500 Subject: [SciPy-user] No scipy.ga and scipy.cow ? In-Reply-To: References: Message-ID: <447250E1.4090406@gmail.com> Pujo Aji wrote: > Hello, > > Is scipy.ga and scipy.cow removed from scipy 0.4.8 ? They have been moved to scipy.sandbox.ga and scipy.sandbox.cow until someone volunteers to maintain them and get them working with numpy. Please read the file Lib/sandbox/setup.py to learn how to enable building them. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From alpha-scipy at dinomight.de Mon May 22 20:09:38 2006 From: alpha-scipy at dinomight.de (Alpha) Date: Tue, 23 May 2006 02:09:38 +0200 Subject: [SciPy-user] fft-problems In-Reply-To: <20060522132029.GF28457@avicenna.cc.columbia.edu> References: <20060521213612.0fd31420@Kakao> <20060522132029.GF28457@avicenna.cc.columbia.edu> Message-ID: <20060523020938.4e4a5fdd@Kakao> On Mon, 22 May 2006 09:20:29 -0400 Lev Givon wrote: [...] > > FFT operations yield too many zeros, much to high coefficients and > > many NANs in the matrix. > > [...] > convolve and fftconvolve returned consistent answers when I tried > the above code on scipy 0.4.8 built with numpy 0.9.8 and fftw 3.0.1. > Thanks. That cheered me up. I deinstalled the precomplied fftw and compiled the package myself and now it works. Alpha -- From bhisma at gmail.com Mon May 22 20:48:59 2006 From: bhisma at gmail.com (Bhismadev Chakrabarti) Date: Tue, 23 May 2006 01:48:59 +0100 Subject: [SciPy-user] numpy installation problems: please help! Message-ID: dear scipy/numpy experts, i am trying to set up scipy in my (multi-user) debian system, and am facing some teething trouble in installing its prerequisite, numpy. the error message is pasted below. i have installed Python 2.4.3 on my userspace, and the installation worked fine. however, while installing numpy, i find ( see the last two lines of this error message) it is trying to access /usr/lib/python2.3 which is an installation by the system administrator that i don't want it to look for. i would be very grateful if someone could please suggest me a way so that numpy ( and later on, scipy) does not look for other installations of Python and basically help me get this thing to work! i really appreciate any help! many thanks, bhisma psych5$ cd ../numpy-0.9.8 psych5$ rm -fr build psych5$ python setup.py install Running from numpy source directory. non-existing path in 'numpy/distutils': 'site.cfg' F2PY Version 2_2522 Traceback (most recent call last): File "setup.py", line 84, in ? setup_package() File "setup.py", line 77, in setup_package configuration=configuration ) File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 /numpy/distutils/core.py", line 140, in setup config = configuration() File "setup.py", line 43, in configuration config.add_subpackage('numpy') File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 /numpy/distutils/misc_util. py", line 740, in add_subpackage caller_level = 2) File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 /numpy/distutils/misc_util. py", line 723, in get_subpackage caller_level = caller_level + 1) File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 /numpy/distutils/misc_util. py", line 670, in _get_configuration_from_setup_py config = setup_module.configuration(*args) File "./numpy/setup.py", line 9, in configuration config.add_subpackage('core') File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 /numpy/distutils/misc_util. py", line 740, in add_subpackage caller_level = 2) File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 /numpy/distutils/misc_util. py", line 723, in get_subpackage caller_level = caller_level + 1) File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 /numpy/distutils/misc_util. py", line 670, in _get_configuration_from_setup_py config = setup_module.configuration(*args) File "numpy/core/setup.py", line 11, in configuration from numpy.distutils.system_info import get_info, default_lib_dirs File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 /numpy/distutils/system_inf o.py", line 152, in ? so_ext = get_config_vars('SO')[0] or '' File "/usr/lib/python2.3/distutils/sysconfig.py", line 490, in get_config_vars func() File "/usr/lib/python2.3/distutils/sysconfig.py", line 360, in _init_posix raise DistutilsPlatformError(my_msg) distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/lib/python2.3/config/Makefile (No such file or directory) psych5$ -- _______________________________ Bhismadev Chakrabarti Department of Psychiatry University of Cambridge Cambridge, UK -------------- next part -------------- An HTML attachment was scrubbed... URL: From cookedm at physics.mcmaster.ca Mon May 22 21:18:43 2006 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Mon, 22 May 2006 21:18:43 -0400 Subject: [SciPy-user] numpy installation problems: please help! In-Reply-To: References: Message-ID: <20060523011843.GA13247@arbutus.physics.mcmaster.ca> On Tue, May 23, 2006 at 01:48:59AM +0100, Bhismadev Chakrabarti wrote: > dear scipy/numpy experts, > > i am trying to set up scipy in my (multi-user) debian system, and am facing > some teething trouble in installing its prerequisite, numpy. the error > message is pasted below. > i have installed Python 2.4.3 on my userspace, and the installation worked > fine. however, while installing numpy, i find ( see the last two lines of > this error message) it is trying to access /usr/lib/python2.3 which is an > installation by the system administrator that i don't want it to look for. Are you sure that the command 'python' you use below is actually the one you've installed (i.e., 2.4)? It looks like it's actually 2.3, and that you do not have the python2.3-dev package installed. Double-check the version with 'python -V'. If you're sure it's the right one, check if you have a PYTHONPATH environment variable set that may be trying to pick up the 2.3 library. It could be easier to ask your sysadmin to install python 2.4 (it's in the latest stable Debian release, and in unstable and testing), and make sure that the python2.4-dev package is installed. > i would be very grateful if someone could please suggest me a way so that > numpy ( and later on, scipy) does not look for other installations of Python > and basically help me get this thing to work! > > i really appreciate any help! > many thanks, > bhisma > > > psych5$ cd ../numpy-0.9.8 > psych5$ rm -fr build > psych5$ python setup.py install > Running from numpy source directory. > non-existing path in 'numpy/distutils': 'site.cfg' > F2PY Version 2_2522 > Traceback (most recent call last): > File "setup.py", line 84, in ? > setup_package() > File "setup.py", line 77, in setup_package > configuration=configuration ) > File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 > /numpy/distutils/core.py", > line 140, in setup > config = configuration() > File "setup.py", line 43, in configuration > config.add_subpackage('numpy') > File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 > /numpy/distutils/misc_util. > py", line 740, in add_subpackage > caller_level = 2) > File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 > /numpy/distutils/misc_util. > py", line 723, in get_subpackage > caller_level = caller_level + 1) > File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 > /numpy/distutils/misc_util. > py", line 670, in _get_configuration_from_setup_py > config = setup_module.configuration(*args) > File "./numpy/setup.py", line 9, in configuration > config.add_subpackage('core') > File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 > /numpy/distutils/misc_util. > py", line 740, in add_subpackage > caller_level = 2) > File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 > /numpy/distutils/misc_util. > py", line 723, in get_subpackage > caller_level = caller_level + 1) > File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 > /numpy/distutils/misc_util. > py", line 670, in _get_configuration_from_setup_py > config = setup_module.configuration(*args) > File "numpy/core/setup.py", line 11, in configuration > from numpy.distutils.system_info import get_info, default_lib_dirs > File "/data2/bc249/new_dir/Python-2.4.3/numpy-0.9.8 > /numpy/distutils/system_inf > o.py", line 152, in ? > so_ext = get_config_vars('SO')[0] or '' > File "/usr/lib/python2.3/distutils/sysconfig.py", line 490, in > get_config_vars > func() > File "/usr/lib/python2.3/distutils/sysconfig.py", line 360, in _init_posix > raise DistutilsPlatformError(my_msg) > distutils.errors.DistutilsPlatformError: invalid Python installation: unable > to > open /usr/lib/python2.3/config/Makefile (No such file or directory) > psych5$ > > > -- > _______________________________ > > Bhismadev Chakrabarti > Department of Psychiatry > University of Cambridge > Cambridge, UK > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From ajikoe at gmail.com Tue May 23 04:41:28 2006 From: ajikoe at gmail.com (Pujo Aji) Date: Tue, 23 May 2006 10:41:28 +0200 Subject: [SciPy-user] No scipy.ga and scipy.cow ? In-Reply-To: <447250E1.4090406@gmail.com> References: <447250E1.4090406@gmail.com> Message-ID: thanks.... pujo On 5/23/06, Robert Kern wrote: > > Pujo Aji wrote: > > Hello, > > > > Is scipy.ga and scipy.cow removed from scipy 0.4.8 ? > > They have been moved to scipy.sandbox.ga and scipy.sandbox.cow until > someone > volunteers to maintain them and get them working with numpy. Please read > the > file Lib/sandbox/setup.py to learn how to enable building them. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma > that is made terrible by our own mad attempt to interpret it as though it > had > an underlying truth." > -- Umberto Eco > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryanlists at gmail.com Tue May 23 13:15:37 2006 From: ryanlists at gmail.com (Ryan Krauss) Date: Tue, 23 May 2006 13:15:37 -0400 Subject: [SciPy-user] fmin convergence Message-ID: Does anyone have any good references to papers on Nelder-Mead simplex algorithm (i.e. optimize.fmin)? My advisor is asking me questions about convergence guarantees. I sort of accept that there may not be any, but fmin is working better than any of the other opimization routines for my problem. Are there any convergence proofs for the other minimization methods in scipy.optimize? Thanks, Ryan From jeff.hammerbacher at gmail.com Tue May 23 14:05:01 2006 From: jeff.hammerbacher at gmail.com (Jeff Hammerbacher) Date: Tue, 23 May 2006 11:05:01 -0700 Subject: [SciPy-user] fmin convergence In-Reply-To: References: Message-ID: Ryan, Convergence results are only known for limited 1- and 2-dim cases: http://oldweb.cecm.sfu.ca/AAS/coope.pdf. Regards, Jeff On 5/23/06, Ryan Krauss wrote: > > Does anyone have any good references to papers on Nelder-Mead simplex > algorithm (i.e. optimize.fmin)? My advisor is asking me questions > about convergence guarantees. I sort of accept that there may not be > any, but fmin is working better than any of the other opimization > routines for my problem. > > Are there any convergence proofs for the other minimization methods in > scipy.optimize? > > Thanks, > > Ryan > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kollmann at telbiomed.at Tue May 23 15:55:08 2006 From: kollmann at telbiomed.at (Alexander Kollmann) Date: Tue, 23 May 2006 21:55:08 +0200 Subject: [SciPy-user] spline <-> NaN Message-ID: Hi, How can I calculate the spline from an input array (time-series) which contains 'NaN'. I'm using the "splprep" and the "splev" function. Without NaN everything works fine but in the case of NaN the spline algoritms seems not to work and there is also no error message. Example: y = array([113.0, 112.0, 113.0, 111.0, 110.0, NaN, NaN, NaN, NaN, NaN, NaN, 111.0, 108.0, 109.0]) max = len(y) x = arange(0,max,1) spline_coeffs=interpolate.splrep(x,y,s=0) y_spline=interpolate.splev(x,spline_coeffs,der=0) Thanks, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From novak at ucolick.org Tue May 23 16:08:38 2006 From: novak at ucolick.org (Gregory Novak) Date: Tue, 23 May 2006 13:08:38 -0700 Subject: [SciPy-user] IPython + Emacs + pdb + Exceptions Message-ID: I'm dusting off an IPython installation and it seems to me that the behavior of IPython + Emacs has changed since I last used it. Or at least I can't figure out how to enable the behavior I want. I run IPython under Emacs using python-mode.el, ipython.el, and py-shell. It used to be the case that when I turned on %PDB in IPython and then my code raised an exception, Emacs would immediately split the window and show the source code that caused the exception in one window, with the *Python* buffer in the other window. If I then typed 'up' or 'down' to move up and down the stack frames, I Emacs would again move to the relevant code snippet. I really liked that behavior, but now I just get a traceback. I can't seem to figure out how to get it back. I've tried both Emacs 21.4 and a recent (early May) CVS build of Emacs. I'm using ipython and python-mode.el from Fink on OS X 10.4: i python-mode 1:1.0-2 Emacs - python edit mode i ipython-py23 0.7.1-1 Replacement interactive Python interpreter Any advice is appreciated... Thanks! Greg From robert.kern at gmail.com Tue May 23 16:14:27 2006 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 23 May 2006 15:14:27 -0500 Subject: [SciPy-user] IPython + Emacs + pdb + Exceptions In-Reply-To: References: Message-ID: <44736D23.7040501@gmail.com> Gregory Novak wrote: > I'm dusting off an IPython installation and it seems to me that the > behavior of IPython + Emacs has changed since I last used it. Or at > least I can't figure out how to enable the behavior I want. You will probably want to ask on the ipython-user list: http://scipy.net/mailman/listinfo/ipython-user -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From novak at ucolick.org Tue May 23 16:21:16 2006 From: novak at ucolick.org (Gregory Novak) Date: Tue, 23 May 2006 13:21:16 -0700 Subject: [SciPy-user] IPython + Emacs + pdb + Exceptions In-Reply-To: <44736D23.7040501@gmail.com> (Robert Kern's message of "Tue, 23 May 2006 15:14:27 -0500") References: <44736D23.7040501@gmail.com> Message-ID: Robert Kern writes: > You will probably want to ask on the ipython-user list: Apologies, I didn't realize that there was a separate list. Greg From robert.kern at gmail.com Tue May 23 17:10:39 2006 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 23 May 2006 16:10:39 -0500 Subject: [SciPy-user] IPython + Emacs + pdb + Exceptions In-Reply-To: References: <44736D23.7040501@gmail.com> Message-ID: <44737A4F.8060909@gmail.com> Gregory Novak wrote: > Robert Kern writes: > >>You will probably want to ask on the ipython-user list: > > Apologies, I didn't realize that there was a separate list. No worries. I just wanted to make sure you get your question in front of the best people to answer it. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From grante at visi.com Tue May 23 17:12:53 2006 From: grante at visi.com (Grant Edwards) Date: Tue, 23 May 2006 21:12:53 +0000 (UTC) Subject: [SciPy-user] spline <-> NaN References: Message-ID: On 2006-05-23, Alexander Kollmann wrote: > How can I calculate the spline from an input array (time-series) which > contains 'NaN'. I'm using the "splprep" and the "splev" function. That depends. How do you want the curve to behave in the region where it's undefined? -- Grant Edwards grante Yow! Hmmm... A hash-singer at and a cross-eyed guy were visi.com SLEEPING on a deserted island, when... From haase at msg.ucsf.edu Wed May 24 01:15:24 2006 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Tue, 23 May 2006 22:15:24 -0700 Subject: [SciPy-user] using enthought packages with Python 2.4 Message-ID: <4473EBEC.6090107@msg.ucsf.edu> Hi! I'm trying to get in touch with the Enthought people... I'm ultimately interested in using numpy and Enthought's traits. So far I'm still using numarray. I was reading http://www.enthought.com/enthought/wiki/NumpyPort (There is a typo: The rest of this page is obsolute. should be: The rest of this page is obsolete. ) What worries me is the statement: '''When using enthought with Python 2.4, the applications behave incorrectly. So use Python 2.3. ''' I just did the step from Python 2.2 directly to 2.4 - it would be painful to go back to 2.3 - to say the least ;-( Do people here have experience with Enthought's traits package ? I'm interested mostly in the simple fact that it claims to "streamline" the GUI development for simple (scientific) parameter entry fields. We often have a bunch of simple numeric parameters, some input/output filenames, and it would be great to have a "notebook"(wx) "advanced tab view" for miscellaneous parameters. Is this something that traits could do easily. Thanks, Sebastian Haase UCSF From robert.kern at gmail.com Wed May 24 01:30:34 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 24 May 2006 00:30:34 -0500 Subject: [SciPy-user] using enthought packages with Python 2.4 In-Reply-To: <4473EBEC.6090107@msg.ucsf.edu> References: <4473EBEC.6090107@msg.ucsf.edu> Message-ID: <4473EF7A.1050206@gmail.com> Sebastian Haase wrote: > Hi! > I'm trying to get in touch with the Enthought people... Well, most of us are here, but you might want to try the enthought-dev mailing list for enthought package-specific stuff. https://mail.enthought.com/mailman/listinfo/enthought-dev > I'm ultimately interested in using numpy and Enthought's traits. > So far I'm still using numarray. > I was reading > http://www.enthought.com/enthought/wiki/NumpyPort > (There is a typo: The rest of this page is obsolute. > should be: The rest of this page is obsolete. ) > What worries me is the statement: > '''When using enthought with Python 2.4, the applications > behave incorrectly. So use Python 2.3. > ''' > I just did the step from Python 2.2 directly to 2.4 - it would be > painful to go back to 2.3 - to say the least ;-( I have no problems using the enthought package on Linux with numpy and Python 2.4 . Pearu's warning on that page is probably too strong. I strongly suspect that the problems he was experiencing have nothing to do with Python 2.4 in general, but more likely that the particular Windows builds of the supporting libraries (wxPython in particular) that he was using were not quite correct. > Do people here have experience with Enthought's traits package ? Mostly us Enthought people, but yes. > I'm interested mostly in the simple fact that it claims to "streamline" > the GUI development for simple (scientific) parameter entry fields. > We often have a bunch of simple numeric parameters, some input/output > filenames, and it would be great to have a "notebook"(wx) "advanced tab > view" for miscellaneous parameters. Is this something that traits could > do easily. Yes. Take a look at the Traits UI demo in "enthought/traits/ui/demos/Traits UI Demo/demo.py" See if the stuff there strikes your fancy. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From kollmann at telbiomed.at Wed May 24 03:02:24 2006 From: kollmann at telbiomed.at (Alexander Kollmann) Date: Wed, 24 May 2006 09:02:24 +0200 Subject: [SciPy-user] spline <-> NaN References: Message-ID: Hi, in the first step linear interpolation would be helpful. Thanks, Alex "Grant Edwards" schrieb im Newsbeitrag news:e4vtsl$mf7$1 at sea.gmane.org... > On 2006-05-23, Alexander Kollmann wrote: > >> How can I calculate the spline from an input array (time-series) which >> contains 'NaN'. I'm using the "splprep" and the "splev" function. > > That depends. How do you want the curve to behave in the > region where it's undefined? > > -- > Grant Edwards grante Yow! Hmmm... A > hash-singer > at and a cross-eyed guy > were > visi.com SLEEPING on a deserted > island, when... From fullung at gmail.com Wed May 24 03:46:48 2006 From: fullung at gmail.com (Albert Strasheim) Date: Wed, 24 May 2006 09:46:48 +0200 Subject: [SciPy-user] Summer of Code: pylibsvm accepted! Message-ID: <002501c67f06$36380490$0a84a8c0@dsp.sun.ac.za> Hello all I just received confirmation from Google that my proposal for adding Support Vector Machine support to SciPy has been accepted. :-) Thanks very much to Robert Kern and Dave Kammeyer for their help so far. Dave will also be mentoring the project (thanks also to the other volunteers). The original proposal is here: http://students.ee.sun.ac.za/~albert/pylibsvm/ I've done quite a bit of work on the code since posting the proposal, so the timeline might change slightly, but I am still planning to have a first cut of the code in the SciPy sandbox by the end of June, with the final code done by the middle of August. If you're interested to see how this project progresses, check the URL mentioned above, starting in a day or two. Regards, Albert From joris at ster.kuleuven.ac.be Wed May 24 06:05:06 2006 From: joris at ster.kuleuven.ac.be (joris at ster.kuleuven.ac.be) Date: Wed, 24 May 2006 12:05:06 +0200 Subject: [SciPy-user] Nelder-Mead Message-ID: <1148465106.44742fd247342@webmail.ster.kuleuven.be> Hi Ryan, > My advisor is asking me questions about convergence guarantees. To my knowledge there is no sufficiently general mathematical convergence proof for the Nelder-Mead algorithm. In fact, it is known that the Nelder-Mead can sometimes fail to converge, especially when the dimension of the search space is large. In such cases, the simplex is moving perpendicular to the gradient. It is also known that the simplex sometimes can become degenerate after which is has to be reinitialised. Having said that, you should know that there is another simplex method, invented by Torczon in 1989 which is more robust than the Nelder-Mead algorithm but at the price of slower convergence. The Torczon simplex doesn't change shape, only size, and it tries to replace the best simplex corner rather than the worse simplex corner. The algorithm is mathematically more tractable and Torczon has a "convergence proof", of course with idealised assumptions. > Are there any convergence proofs for the other minimization > methods in scipy.optimize? I don't think so. Optimization is an art, not an exact science. Even an algorithm as simple as the Newton one can easily fail, for example because the Jacobian is ill-conditioned, or because an iteration step leads again to an earlier point so that infinite looping occurs. Cheers, Joris Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm From markus.weimer at gmail.com Wed May 24 08:01:22 2006 From: markus.weimer at gmail.com (Markus Weimer) Date: Wed, 24 May 2006 14:01:22 +0200 Subject: [SciPy-user] Summer of Code: pylibsvm accepted! In-Reply-To: <002501c67f06$36380490$0a84a8c0@dsp.sun.ac.za> References: <002501c67f06$36380490$0a84a8c0@dsp.sun.ac.za> Message-ID: <57be15330605240501n65453b16x97d81b56ae5d1d11@mail.gmail.com> Hi, I just received confirmation from Google that my proposal for adding Support > Vector Machine support to SciPy has been accepted. :-) That's great news. Just a feature question: Will that library allow me to write my kernel function in python? That would be really useful for fast prototyping ;-) Greetings, Markus -------------- next part -------------- An HTML attachment was scrubbed... URL: From edin.salkovic at gmail.com Wed May 24 10:10:57 2006 From: edin.salkovic at gmail.com (=?UTF-8?Q?Edin_Salkovi=C4=87?=) Date: Wed, 24 May 2006 16:10:57 +0200 Subject: [SciPy-user] Summer of Code: enhancements to mathtext accepted! Message-ID: <63eb7fa90605240710t6ccb5debq41ade7b06a3db466@mail.gmail.com> Robert, John and others... Thanks! Especially Robert (He was the first to read the mentor FAQ :) No comes the "hard part". From schofield at ftw.at Wed May 24 10:45:35 2006 From: schofield at ftw.at (Ed Schofield) Date: Wed, 24 May 2006 16:45:35 +0200 Subject: [SciPy-user] ANN: SciPy 0.4.9 released Message-ID: <4474718F.2090101@ftw.at> =========================== SciPy 0.4.9 Scientific tools for Python =========================== I'm pleased to announce the release of SciPy 0.4.9. This version adds support for NumPy version 0.9.8. It also has enhancements to sparse matrices, including a new linear solver module with UMFPACK support, and new support for fitting conditional maximum entropy models. This release also fixes bugs in ndimage, sparse, stats, weave, and other packages. It is available for download from http://www.scipy.org/Download as a source tarball for Linux/Solaris/OS X/BSD/Windows (64-bit and 32-bit) and as an executable installer for Win32. More information on SciPy is available at http://www.scipy.org/ =========================== SciPy is an Open Source library of scientific tools for Python. It contains a variety of high-level science and engineering modules, including modules for statistics, optimization, integration, linear algebra, Fourier transforms, signal and image processing, genetic algorithms, ODE solvers, special functions, and more. From grante at visi.com Wed May 24 11:05:43 2006 From: grante at visi.com (Grant Edwards) Date: Wed, 24 May 2006 15:05:43 +0000 (UTC) Subject: [SciPy-user] spline <-> NaN References: Message-ID: On 2006-05-24, Alexander Kollmann wrote: > in the first step linear interpolation would be helpful. I would suggest 1. Just delete the points that are undefined, then fit the spline curve. 2. Fill them in yourself with linearly interpolated values, then fit the spline. -- Grant Edwards grante Yow! Yow! Are we in the at perfect mood? visi.com From ajikoe at gmail.com Wed May 24 11:46:49 2006 From: ajikoe at gmail.com (Pujo Aji) Date: Wed, 24 May 2006 17:46:49 +0200 Subject: [SciPy-user] scipy.weave.test error Message-ID: Hello I have scipy 0.4.9. I the scipy.weave.test() produce error. This also not work in scipy 0.4.8 Is that normal ? Thanks, pujo -------------- next part -------------- An HTML attachment was scrubbed... URL: From morovia at rediffmail.com Wed May 24 13:10:00 2006 From: morovia at rediffmail.com (morovia) Date: 24 May 2006 17:10:00 -0000 Subject: [SciPy-user] scipy -0.4.9 test(10,10) failed Message-ID: <20060524171000.8463.qmail@webmail57.rediffmail.com> Hello, I tried to update scipy 0.4.9 and the build process went well. However, when tried testing using scipy.test(10,10), I have appended the part of the output below. Thanks Morovia. >>> import numpy,scipy >>> print numpy.__version__ 0.9.8 >>> print scipy.__version__ 0.4.9 ====================================================================== ERROR: check_integer (scipy.io.tests.test_array_import.test_read_array) ---------------------------------------------------------------------- Traceback (most recent call last): File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/scipy/io/tests/test_array_import.py", line 55, in check_integer from scipy import stats File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/scipy/stats/__init__.py", line 7, in ? from stats import * File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/scipy/stats/stats.py", line 191, in ? import scipy.special as special File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/scipy/special/__init__.py", line 10, in ? import orthogonal File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/scipy/special/orthogonal.py", line 66, in ? from scipy.linalg import eig File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/scipy/linalg/__init__.py", line 8, in ? from basic import * File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/scipy/linalg/basic.py", line 17, in ? from flinalg import get_flinalg_funcs File "/disk2/data/cd/user10/bin/python243/lib/python2.4/site-packages/scipy/linalg/flinalg.py", line 15, in ? from numpy.distutils.misc_util import PostponedException ImportError: cannot import name PostponedException ---------------------------------------------------------------------- Ran 712 tests in 53.266s FAILED (errors=1) -------------- next part -------------- An HTML attachment was scrubbed... URL: From strawman at astraw.com Wed May 24 17:27:12 2006 From: strawman at astraw.com (Andrew Straw) Date: Wed, 24 May 2006 14:27:12 -0700 Subject: [SciPy-user] numpy installation problems: please help! In-Reply-To: References: Message-ID: <4474CFB0.1000504@astraw.com> You need to install python2.3-dev (IIRC that's what it's called). > psych5$ python setup.py install > [snip] > distutils.errors.DistutilsPlatformError: invalid Python installation: > unable to > open /usr/lib/python2.3/config/Makefile (No such file or directory) From fullung at gmail.com Wed May 24 18:08:03 2006 From: fullung at gmail.com (Albert Strasheim) Date: Thu, 25 May 2006 00:08:03 +0200 Subject: [SciPy-user] Summer of Code: pylibsvm accepted! In-Reply-To: <57be15330605240501n65453b16x97d81b56ae5d1d11@mail.gmail.com> Message-ID: <00f501c67f7e$873c4a40$0a84a8c0@dsp.sun.ac.za> Hey Markus > I just received confirmation from Google that my proposal for adding > Support > Vector Machine support to SciPy has been accepted. :-) > > That's great news. Just a feature question: Will that library allow me to > write my kernel function in python? That would be really useful for fast > prototyping ;-) I'm certainly going to be looking at adding this feature. libsvm 2.82 doesn't have a clean way of specifying a custom kernel function, but there are a few options: - precompute the kernel matrix in Python and use libsvm 2.82's precomputed kernel feature - look at other SVM backends like libsvmTL that has support for custom kernel functions - as a last resort, modify libsvm I'm going to think a bit about the implications of the first option when dealing with large datasets or interesting kernel functions, but I think this would be a good way to go. Regards, Albert From haase at msg.ucsf.edu Wed May 24 19:19:22 2006 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Wed, 24 May 2006 16:19:22 -0700 Subject: [SciPy-user] using enthought packages with Python 2.4 In-Reply-To: <4473EF7A.1050206@gmail.com> References: <4473EBEC.6090107@msg.ucsf.edu> <4473EF7A.1050206@gmail.com> Message-ID: <200605241619.23134.haase@msg.ucsf.edu> Thanks for the reply. I did svn co https://svn.enthought.com/svn/enthought/trunk enthought and after building numpy and scipy, I tried building enthought with numpy support: cd enthought/trunk/src/lib/enthought/ export NUMERIX=numpy python setup_numpy.py build now it complains about vtk module missing. Can I not just build enthought traits (for numpy) without having to do everything else at the same time ? (I'm running Debian sarge with python 2.4 and there is no python2.4-pyvtk package -- I just started building VTK5 from source but I expect this to turn into a big hole ...) Thanks, Sebastian Haase On Tuesday 23 May 2006 22:30, Robert Kern wrote: > Sebastian Haase wrote: > > Hi! > > I'm trying to get in touch with the Enthought people... > > Well, most of us are here, but you might want to try the enthought-dev > mailing list for enthought package-specific stuff. > > https://mail.enthought.com/mailman/listinfo/enthought-dev > > > I'm ultimately interested in using numpy and Enthought's traits. > > So far I'm still using numarray. > > I was reading > > http://www.enthought.com/enthought/wiki/NumpyPort > > (There is a typo: The rest of this page is obsolute. > > should be: The rest of this page is obsolete. ) > > What worries me is the statement: > > '''When using enthought with Python 2.4, the applications > > behave incorrectly. So use Python 2.3. > > ''' > > I just did the step from Python 2.2 directly to 2.4 - it would be > > painful to go back to 2.3 - to say the least ;-( > > I have no problems using the enthought package on Linux with numpy and > Python 2.4 . Pearu's warning on that page is probably too strong. I > strongly suspect that the problems he was experiencing have nothing to do > with Python 2.4 in general, but more likely that the particular Windows > builds of the supporting libraries (wxPython in particular) that he was > using were not quite correct. > > > Do people here have experience with Enthought's traits package ? > > Mostly us Enthought people, but yes. > > > I'm interested mostly in the simple fact that it claims to "streamline" > > the GUI development for simple (scientific) parameter entry fields. > > We often have a bunch of simple numeric parameters, some input/output > > filenames, and it would be great to have a "notebook"(wx) "advanced tab > > view" for miscellaneous parameters. Is this something that traits could > > do easily. > > Yes. Take a look at the Traits UI demo in > > "enthought/traits/ui/demos/Traits UI Demo/demo.py" > > See if the stuff there strikes your fancy. From wbaxter at gmail.com Wed May 24 19:26:53 2006 From: wbaxter at gmail.com (Bill Baxter) Date: Thu, 25 May 2006 08:26:53 +0900 Subject: [SciPy-user] Summer of Code: pylibsvm accepted! In-Reply-To: <002501c67f06$36380490$0a84a8c0@dsp.sun.ac.za> References: <002501c67f06$36380490$0a84a8c0@dsp.sun.ac.za> Message-ID: That is great news! Congratulations. I'm also looking forward to seeing the results. Having this in SciPy will be great. --Bill On 5/24/06, Albert Strasheim wrote: > > Hello all > > I just received confirmation from Google that my proposal for adding > Support > Vector Machine support to SciPy has been accepted. :-) > > Thanks very much to Robert Kern and Dave Kammeyer for their help so far. > Dave will also be mentoring the project (thanks also to the other > volunteers). > > The original proposal is here: > > http://students.ee.sun.ac.za/~albert/pylibsvm/ > > I've done quite a bit of work on the code since posting the proposal, so > the > timeline might change slightly, but I am still planning to have a first > cut > of the code in the SciPy sandbox by the end of June, with the final code > done by the middle of August. > > If you're interested to see how this project progresses, check the URL > mentioned above, starting in a day or two. > > Regards, > > Albert > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Wed May 24 19:42:31 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 24 May 2006 18:42:31 -0500 Subject: [SciPy-user] using enthought packages with Python 2.4 In-Reply-To: <200605241619.23134.haase@msg.ucsf.edu> References: <4473EBEC.6090107@msg.ucsf.edu> <4473EF7A.1050206@gmail.com> <200605241619.23134.haase@msg.ucsf.edu> Message-ID: <4474EF67.7040505@gmail.com> Sebastian Haase wrote: > Thanks for the reply. > I did > svn co https://svn.enthought.com/svn/enthought/trunk enthought > and after building numpy and scipy, I tried building enthought with numpy > support: > cd enthought/trunk/src/lib/enthought/ > export NUMERIX=numpy > python setup_numpy.py build > now it complains about vtk module missing. > > Can I not just build enthought traits (for numpy) without having to do > everything else at the same time ? We're working on making the individual subpackages easily, independently installable. In the meantime, you can edit setup_numpy.py to comment out the lines where it adds the "mayavi" and "tvtk" subpackages. > (I'm running Debian sarge with python 2.4 and there is no python2.4-pyvtk > package -- I just started building VTK5 from source but I expect this to turn > into a big hole ...) Indeed, the package is python-vtk. python-pyvtk is a module that lets you read and create VTK-format files, not the bindings to VTK itself. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From steve at shrogers.com Wed May 24 21:27:02 2006 From: steve at shrogers.com (Steven H. Rogers) Date: Wed, 24 May 2006 19:27:02 -0600 Subject: [SciPy-user] Summer of Code: pylibsvm accepted! In-Reply-To: <002501c67f06$36380490$0a84a8c0@dsp.sun.ac.za> References: <002501c67f06$36380490$0a84a8c0@dsp.sun.ac.za> Message-ID: <447507E6.5030200@shrogers.com> Congratulations! I'm looking forward to seeing this Regards, Steve /////////////////////// Albert Strasheim wrote: > Hello all > > I just received confirmation from Google that my proposal for adding Support > Vector Machine support to SciPy has been accepted. :-) > > Thanks very much to Robert Kern and Dave Kammeyer for their help so far. > Dave will also be mentoring the project (thanks also to the other > volunteers). > > The original proposal is here: > > http://students.ee.sun.ac.za/~albert/pylibsvm/ > > I've done quite a bit of work on the code since posting the proposal, so the > timeline might change slightly, but I am still planning to have a first cut > of the code in the SciPy sandbox by the end of June, with the final code > done by the middle of August. > > If you're interested to see how this project progresses, check the URL > mentioned above, starting in a day or two. > > Regards, > > Albert > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > -- Steven H. Rogers, Ph.D., steve at shrogers.com Weblog: http://shrogers.com/weblog "He who refuses to do arithmetic is doomed to talk nonsense." -- John McCarthy From imcsee at gmail.com Wed May 24 22:22:51 2006 From: imcsee at gmail.com (imcs ee) Date: Thu, 25 May 2006 10:22:51 +0800 Subject: [SciPy-user] Summer of Code: pylibsvm accepted! In-Reply-To: <447507E6.5030200@shrogers.com> References: <002501c67f06$36380490$0a84a8c0@dsp.sun.ac.za> <447507E6.5030200@shrogers.com> Message-ID: Congratulation. good news. On 5/25/06, Steven H. Rogers wrote: > > Congratulations! I'm looking forward to seeing this > > Regards, > Steve > /////////////////////// > > Albert Strasheim wrote: > > Hello all > > > > I just received confirmation from Google that my proposal for adding > Support > > Vector Machine support to SciPy has been accepted. :-) > > > > Thanks very much to Robert Kern and Dave Kammeyer for their help so far. > > Dave will also be mentoring the project (thanks also to the other > > volunteers). > > > > The original proposal is here: > > > > http://students.ee.sun.ac.za/~albert/pylibsvm/ > > > > I've done quite a bit of work on the code since posting the proposal, so > the > > timeline might change slightly, but I am still planning to have a first > cut > > of the code in the SciPy sandbox by the end of June, with the final code > > done by the middle of August. > > > > If you're interested to see how this project progresses, check the URL > > mentioned above, starting in a day or two. > > > > Regards, > > > > Albert > > > > _______________________________________________ > > SciPy-user mailing list > > SciPy-user at scipy.net > > http://www.scipy.net/mailman/listinfo/scipy-user > > > > > > -- > Steven H. Rogers, Ph.D., steve at shrogers.com > Weblog: http://shrogers.com/weblog > "He who refuses to do arithmetic is doomed to talk nonsense." > -- John McCarthy > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajikoe at gmail.com Fri May 26 07:18:00 2006 From: ajikoe at gmail.com (Pujo Aji) Date: Fri, 26 May 2006 13:18:00 +0200 Subject: [SciPy-user] scipy.sqrt (-1) Message-ID: Hello, I use scipy 0.4.9: I ran scipy.sqrt(-1) hopefully it gives me 1j but I've got : -1.#IND Is that normal? Thanks, pujo -------------- next part -------------- An HTML attachment was scrubbed... URL: From wbaxter at gmail.com Fri May 26 08:04:05 2006 From: wbaxter at gmail.com (Bill Baxter) Date: Fri, 26 May 2006 21:04:05 +0900 Subject: [SciPy-user] scipy.sqrt (-1) In-Reply-To: References: Message-ID: I think that's expected. If you want to get a complex output, you have to give it a complex input like: >> scipy.sqrt(-1+0j) 1j or >> scipy.sqrt(complex(-1)) 1j --bb On 5/26/06, Pujo Aji wrote: > > Hello, > I use scipy 0.4.9: > I ran scipy.sqrt(-1) hopefully it gives me 1j but I've got : > -1.#IND > > Is that normal? > > Thanks, > pujo > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > > -- William V. Baxter III OLM Digital Kono Dens Building Rm 302 1-8-8 Wakabayashi Setagaya-ku Tokyo, Japan 154-0023 +81 (3) 3422-3380 -------------- next part -------------- An HTML attachment was scrubbed... URL: From klemm at phys.ethz.ch Fri May 26 12:45:50 2006 From: klemm at phys.ethz.ch (Hanno Klemm) Date: Fri, 26 May 2006 18:45:50 +0200 Subject: [SciPy-user] Scipy Install problem Message-ID: <447730BE.3090403@phys.ethz.ch> Hello, I have a probably simple install problem with scipy 0.4.9 on a Debian unstable box. I compiled the recent version of numpy and then scipy. Afterwards, I tried to install numpy 0.9.8 and scipy 0.4.9 on /usr/local/lib/python2.4/site-packages. Apparently the installation went fine, no complaints. However, if I then try klemm at ligeti:~> python2.4 Python 2.4.4c0 (#2, Apr 22 2006, 22:39:06) [GCC 4.0.3 (Debian 4.0.3-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import scipy import misc -> failed: list index out of range import linsolve.umfpack -> failed: list index out of range >>> And I have to admit, I don't understand the error message. If I have a look at the search path I get: >>> import sys >>> sys.path ['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', '/usr/local/lib/python2.4/site-packages/scipy', '/usr/local/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages/Numeric', '/usr/lib/python2.4/site-packages/cairo', '/usr/lib/python2.4/site-packages/gtk-2.0', '/usr/lib/site-python'] >>> Any pointers? Thanks in advance, Hanno From ajikoe at gmail.com Fri May 26 13:41:41 2006 From: ajikoe at gmail.com (Pujo Aji) Date: Fri, 26 May 2006 19:41:41 +0200 Subject: [SciPy-user] scipy.sqrt (-1) In-Reply-To: References: Message-ID: Hello, It seems that the scipy documentation should be changed a bit. It is in page 3 http://www.scipy.org/Documentation scipy tutorial: Finally, some of the basic functions like log, sqrt, and inverse trig functions have been modifed to return complex numbers instead of NaN's where appropriate (i.e. scipy.sqrt(-1) returns 1j). Thanks, pujo On 5/26/06, Bill Baxter wrote: > > I think that's expected. If you want to get a complex output, you have to > give it a complex input like: > >> scipy.sqrt(-1+0j) > 1j > or > >> scipy.sqrt(complex(-1)) > 1j > > > --bb > > On 5/26/06, Pujo Aji wrote: > > > Hello, > I use scipy 0.4.9: > I ran scipy.sqrt(-1) hopefully it gives me 1j but I've got : > -1.#IND > > Is that normal? > > Thanks, > pujo > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > > > > > -- > William V. Baxter III > OLM Digital > Kono Dens Building Rm 302 > 1-8-8 Wakabayashi Setagaya-ku > Tokyo, Japan 154-0023 > +81 (3) 3422-3380 > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Fri May 26 14:21:04 2006 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 26 May 2006 13:21:04 -0500 Subject: [SciPy-user] scipy.sqrt (-1) In-Reply-To: References: Message-ID: <44774710.30004@gmail.com> Pujo Aji wrote: > Hello, > > It seems that the scipy documentation should be changed a bit. > It is in page 3 http://www.scipy.org/Documentation scipy tutorial: > Finally, some of the basic functions like log, sqrt, and inverse trig > functions have been modifed to return > complex numbers instead of NaN's where appropriate ( i.e. scipy.sqrt(-1) > returns 1j). That tutorial is out-of-date and refers to scipy 0.3, not 0.4. scipy no longer overrides numpy's definitions of basic functions. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From haase at msg.ucsf.edu Fri May 26 19:46:53 2006 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Fri, 26 May 2006 16:46:53 -0700 Subject: [SciPy-user] using enthought packages with Python 2.4 In-Reply-To: <4474EF67.7040505@gmail.com> References: <4473EBEC.6090107@msg.ucsf.edu> <200605241619.23134.haase@msg.ucsf.edu> <4474EF67.7040505@gmail.com> Message-ID: <200605261646.54027.haase@msg.ucsf.edu> Hi, I get an error message complaining about missing include tvtk/src/array_ext.c:9:33: Numeric/arrayobject.h: No such file or directory It should look for numpy/arrayobject.h instead - since I'm calling python setup_numpy.py build right !? (This is just a dumb bug report - no harm intended - please ignore if known) - Sebastian Haase On Wednesday 24 May 2006 16:42, Robert Kern wrote: > Sebastian Haase wrote: > > Thanks for the reply. > > I did > > svn co https://svn.enthought.com/svn/enthought/trunk enthought > > and after building numpy and scipy, I tried building enthought with numpy > > support: > > cd enthought/trunk/src/lib/enthought/ > > export NUMERIX=numpy > > python setup_numpy.py build > > now it complains about vtk module missing. > > > > Can I not just build enthought traits (for numpy) without having to do > > everything else at the same time ? > > We're working on making the individual subpackages easily, independently > installable. In the meantime, you can edit setup_numpy.py to comment out > the lines where it adds the "mayavi" and "tvtk" subpackages. > > > (I'm running Debian sarge with python 2.4 and there is no python2.4-pyvtk > > package -- I just started building VTK5 from source but I expect this to > > turn into a big hole ...) > > Indeed, the package is python-vtk. python-pyvtk is a module that lets you > read and create VTK-format files, not the bindings to VTK itself. From haase at msg.ucsf.edu Fri May 26 20:31:23 2006 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Fri, 26 May 2006 17:31:23 -0700 Subject: [SciPy-user] using enthought packages with Python 2.4 In-Reply-To: <200605261646.54027.haase@msg.ucsf.edu> References: <4473EBEC.6090107@msg.ucsf.edu> <4474EF67.7040505@gmail.com> <200605261646.54027.haase@msg.ucsf.edu> Message-ID: <200605261731.24154.haase@msg.ucsf.edu> Hi, After commenting out kiva and tvtk I could get setup_numpy.py to run through all the way. But trying out any traits related demo or example gives below error trace back: ValueError: Rick's installer is broken With help of strace it looks like it is maybe looking for pyface/images.zip What is this ? I did not run any "setup install" - I just put .../enthought/src/lib/enthought/build/lib.linux-i686-2.4 into my PYTHONPATH env-variable. Traceback (most recent call last): File "demo.py", line 514, in ? view = demo_view ) ] ) File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/traits/ui/editors.py", line 200, in TreeEditor return toolkit().tree_editor( *args, **traits ) File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/traits/ui/wx/toolkit.py", line 494, in tree_editor import tree_editor as te File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/traits/ui/wx/tree_editor.py", line 58, in ? from enthought.pyface.dock.core \ File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/pyface/dock/core.py", line 23, in ? from dock_window \ File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/pyface/dock/dock_window.py", line 55, in ? from dock_sizer \ File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/pyface/dock/dock_sizer.py", line 240, in ? DockImages = DockImages() File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/pyface/dock/dock_sizer.py", line 222, in __init__ self._close_tab = self.close_tab.create_image().ConvertToBitmap() File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/pyface/image_resource.py", line 98, in create_image image = self._get_image_not_found_image() File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/pyface/image_resource.py", line 160, in _get_image_not_found_image image = IMAGE_NOT_FOUND.create_image() File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/pyface/image_resource.py", line 98, in create_image image = self._get_image_not_found_image() File "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/enthought/pyface/image_resource.py", line 165, in _get_image_not_found_image raise ValueError("Rick's installer is broken") ValueError: Rick's installer is broken - Thanks, Sebastian. From haase at msg.ucsf.edu Fri May 26 20:41:25 2006 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Fri, 26 May 2006 17:41:25 -0700 Subject: [SciPy-user] using enthought packages with Python 2.4 In-Reply-To: <200605261731.24154.haase@msg.ucsf.edu> References: <4473EBEC.6090107@msg.ucsf.edu> <200605261646.54027.haase@msg.ucsf.edu> <200605261731.24154.haase@msg.ucsf.edu> Message-ID: <200605261741.25484.haase@msg.ucsf.edu> PLEASE IGNORE MY LAST QUESTION. I found the solution. I just needed to put the images directory from src/lib/enthought/pyface into the build/lib.linux-i686-2.4 tree. I supposed this would have been copied by a setup install. -Sebastian. On Friday 26 May 2006 17:31, Sebastian Haase wrote: > Hi, > After commenting out kiva and tvtk I could get setup_numpy.py to run > through all the way. > But trying out any traits related demo or example gives below error trace > back: > ValueError: Rick's installer is broken > > With help of strace it looks like it is maybe looking for > pyface/images.zip What is this ? > I did not run any "setup install" - I just put > .../enthought/src/lib/enthought/build/lib.linux-i686-2.4 into my > PYTHONPATH env-variable. > > > Traceback (most recent call last): > File "demo.py", line 514, in ? > view = demo_view ) ] ) > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/traits/ui/editors.py", line 200, in TreeEditor > return toolkit().tree_editor( *args, **traits ) > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/traits/ui/wx/toolkit.py", line 494, in tree_editor > import tree_editor as te > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/traits/ui/wx/tree_editor.py", line 58, in ? > from enthought.pyface.dock.core \ > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/pyface/dock/core.py", line 23, in ? > from dock_window \ > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/pyface/dock/dock_window.py", line 55, in ? > from dock_sizer \ > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/pyface/dock/dock_sizer.py", line 240, in ? > DockImages = DockImages() > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/pyface/dock/dock_sizer.py", line 222, in __init__ > self._close_tab = self.close_tab.create_image().ConvertToBitmap() > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/pyface/image_resource.py", line 98, in create_image > image = self._get_image_not_found_image() > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/pyface/image_resource.py", line 160, in _get_image_not_found_image > image = IMAGE_NOT_FOUND.create_image() > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/pyface/image_resource.py", line 98, in create_image > image = self._get_image_not_found_image() > File > "/home/haase/myCVS/enthought/src/lib/enthought/build/lib.linux-i686-2.4/ent >hought/pyface/image_resource.py", line 165, in _get_image_not_found_image > raise ValueError("Rick's installer is broken") > ValueError: Rick's installer is broken > > - Thanks, Sebastian. > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From seefeld at sympatico.ca Fri May 26 20:56:39 2006 From: seefeld at sympatico.ca (Stefan Seefeld) Date: Fri, 26 May 2006 20:56:39 -0400 Subject: [SciPy-user] Error building scipy-0.4.9 on FC5 Message-ID: <4477A3C7.6000809@sympatico.ca> Hi there, I'v been trying to build scipy 0.4.9 without luck. I'm using FC5, and installed numpy as an rpm package (so I thought that the corresponding lines of the install procedure were irrelevant). I get: $ python setup.py build /usr/lib/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'configuration' What am I missing ? Thanks, Stefan From robert.kern at gmail.com Fri May 26 23:34:09 2006 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 26 May 2006 22:34:09 -0500 Subject: [SciPy-user] using enthought packages with Python 2.4 In-Reply-To: <200605261646.54027.haase@msg.ucsf.edu> References: <4473EBEC.6090107@msg.ucsf.edu> <200605241619.23134.haase@msg.ucsf.edu> <4474EF67.7040505@gmail.com> <200605261646.54027.haase@msg.ucsf.edu> Message-ID: <4477C8B1.9060901@gmail.com> Sebastian Haase wrote: > Hi, > I get an error message complaining about missing include > tvtk/src/array_ext.c:9:33: Numeric/arrayobject.h: No such file or directory > > It should look for numpy/arrayobject.h instead - since I'm calling > python setup_numpy.py build > > right !? tvtk tries to build extension modules for each of numpy/Numeric/numarray if they are available; that build process predates the numpy conversion. I suspect that you have Numeric installed, but not the headers. You can edit enthought/tvtk/setup.py to comment out the lines that try to build the Numeric and numarray versions, though. > (This is just a dumb bug report - no harm intended - please ignore if known) Bug reports are great! However, I would ask that they go to enthought-dev instead of scipy-user. We also have a Trac instance for reporting bugs although installation issues are probably best suited for the mailing list: http://svn.enthought.com/enthought -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From robert.kern at gmail.com Fri May 26 23:36:27 2006 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 26 May 2006 22:36:27 -0500 Subject: [SciPy-user] using enthought packages with Python 2.4 In-Reply-To: <200605261741.25484.haase@msg.ucsf.edu> References: <4473EBEC.6090107@msg.ucsf.edu> <200605261646.54027.haase@msg.ucsf.edu> <200605261731.24154.haase@msg.ucsf.edu> <200605261741.25484.haase@msg.ucsf.edu> Message-ID: <4477C93B.5030001@gmail.com> Sebastian Haase wrote: > PLEASE IGNORE MY LAST QUESTION. > I found the solution. > I just needed to put the images directory from src/lib/enthought/pyface into > the build/lib.linux-i686-2.4 tree. > I supposed this would have been copied by a setup install. They ought to be. BTW, you might want to try python setup.py build_src build_clib build_ext --inplace and add src/lib to your PYTHONPATH. I think most of us at Enthought develop in this way for better or worse. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From robert.kern at gmail.com Fri May 26 23:37:47 2006 From: robert.kern at gmail.com (Robert Kern) Date: Fri, 26 May 2006 22:37:47 -0500 Subject: [SciPy-user] Error building scipy-0.4.9 on FC5 In-Reply-To: <4477A3C7.6000809@sympatico.ca> References: <4477A3C7.6000809@sympatico.ca> Message-ID: <4477C98B.3000903@gmail.com> Stefan Seefeld wrote: > Hi there, > > I'v been trying to build scipy 0.4.9 without luck. I'm using FC5, and installed > numpy as an rpm package (so I thought that the corresponding lines of the install > procedure were irrelevant). > I get: > > $ python setup.py build > /usr/lib/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'configuration' > > What am I missing ? You will need a more recent numpy, I believe. numpy 0.9.8 matches with scipy 0.4.9. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From aisaac at american.edu Sat May 27 04:07:01 2006 From: aisaac at american.edu (Alan G Isaac) Date: Sat, 27 May 2006 04:07:01 -0400 Subject: [SciPy-user] Nelder-Mead In-Reply-To: <1148465106.44742fd247342@webmail.ster.kuleuven.be> References: <1148465106.44742fd247342@webmail.ster.kuleuven.be> Message-ID: On Wed, 24 May 2006, joris at ster.kuleuven.ac.be apparently wrote: > you should know that there is another simplex > method, invented by Torczon in 1989 which is more robust than > the Nelder-Mead algorithm but at the price of slower convergence. > The Torczon simplex doesn't change shape, only size, and it > tries to replace the best simplex corner rather than the worse > simplex corner. The algorithm is mathematically more tractable > and Torczon has a "convergence proof", of course with idealised > assumptions. Related code is available: http://www.cs.wm.edu/~va/software/SimplexSearch/ And related papers: http://www.cs.wm.edu/~va/research/ Cheers, Alan Isaac From wegwerp at gmail.com Sat May 27 04:20:47 2006 From: wegwerp at gmail.com (weg werp) Date: Sat, 27 May 2006 10:20:47 +0200 Subject: [SciPy-user] fft crashes python Message-ID: <6f54c160605270120l6cd2730fp31da0f7c7b8f108a@mail.gmail.com> Hi group, the following crashes python: from numpy import * import scipy.signal as sig x=ones(100,dtype = float) f=sig.fft(x) So far I have only played with the basic numpy stuff, which all seems to work. I have not used much of the toolboxes, so big chance that more things are broken there. I guess there is something wrong with the pre-compiled number-crunch libraries under the hood. Note that I previously reported problems with scipy.test, see http://www.scipy.net/pipermail/scipy-user/2006-April/007751.html Since then I upgraded to the latest precompiled binaries (.9.8 and .4.9), but scipy.test(10,10) still crashes at exactly the same point. Any ideas how to solve this? I guess that compiling everything myself might solve the problem, but it would be nice for a beginner to start experimenting without having to do that. I am not so much concerned by speed just yet. Cheers, Bas From oliphant.travis at ieee.org Sat May 27 05:10:02 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Sat, 27 May 2006 03:10:02 -0600 Subject: [SciPy-user] fft crashes python In-Reply-To: <6f54c160605270120l6cd2730fp31da0f7c7b8f108a@mail.gmail.com> References: <6f54c160605270120l6cd2730fp31da0f7c7b8f108a@mail.gmail.com> Message-ID: <4478176A.5070904@ieee.org> weg werp wrote: > Hi group, > > the following crashes python: > > from numpy import * > import scipy.signal as sig > x=ones(100,dtype = float) > f=sig.fft(x) > This code works fine for me on Linux. It's hard to track down what the problem might be without more information. Perhaps you could use gdb or some other debugger to see where the crash is occurring. It would also be useful if you reported what system you are running on. If we can't re-produce the problem, then it is *very* hard to figure out what's going on. Best, -Travis From alpha-scipy at dinomight.de Sat May 27 05:51:31 2006 From: alpha-scipy at dinomight.de (Alpha) Date: Sat, 27 May 2006 11:51:31 +0200 Subject: [SciPy-user] fft crashes python In-Reply-To: <6f54c160605270120l6cd2730fp31da0f7c7b8f108a@mail.gmail.com> References: <6f54c160605270120l6cd2730fp31da0f7c7b8f108a@mail.gmail.com> Message-ID: <20060527115131.69e2bfe0@Kakao> Hello, I recently had similar problems. I could resolve them by uninstalling the precompiled fftw libraries and replacing them by a freshly downloaded and self-compiled version. Afterwards I deleted scipy from the /usr/lib/python2.3/site-packages/ directory and compiled and installed it again. Everything works fine now. I guess it might suffice to install the self-compiled fftw library. Contact me, if you need help with that. Cheers, Alpha On Sat, 27 May 2006 10:20:47 +0200 "weg werp" wrote: > Hi group, > > the following crashes python: > > from numpy import * > import scipy.signal as sig > x=ones(100,dtype = float) > f=sig.fft(x) > > So far I have only played with the basic numpy stuff, which all > seems to work. I have not used much of the toolboxes, so big chance > that more things are broken there. I guess there is something wrong > with the pre-compiled number-crunch libraries under the hood. > > Note that I previously reported problems with scipy.test, see > http://www.scipy.net/pipermail/scipy-user/2006-April/007751.html > > Since then I upgraded to the latest precompiled binaries (.9.8 and > .4.9), but scipy.test(10,10) still crashes at exactly the same > point. > > Any ideas how to solve this? I guess that compiling everything > myself might solve the problem, but it would be nice for a beginner > to start experimenting without having to do that. I am not so much > concerned by speed just yet. > > Cheers, > Bas > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From wegwerp at gmail.com Sat May 27 08:07:01 2006 From: wegwerp at gmail.com (weg werp) Date: Sat, 27 May 2006 14:07:01 +0200 Subject: [SciPy-user] fft crashes python In-Reply-To: <4478176A.5070904@ieee.org> References: <6f54c160605270120l6cd2730fp31da0f7c7b8f108a@mail.gmail.com> <4478176A.5070904@ieee.org> Message-ID: <6f54c160605270507v79a9c783g479c9cab5f2a97cf@mail.gmail.com> Hi Travis, My computer is a Athlon 1700+ with 750MB ram, running win2K and python 2.4 I am using the pre-compiled binaries for windows: numpy-0.9.8.win32-py2.4.exe scipy-0.4.9.win32-py2.4.exe After the crash, DrWatson complains about an illegal instruction, see below. With the debugger in Idle, the last message that is visible before the crash is: > scipy.fftpack.basic.fft(), line 101: return work_function(tmp,n,1,0,overwrite_x) so it is either that line or the next that is crashing. Could it be that the binaries are compiled for Intel processors that use some of the newer instructions which my Athlon doesn't like?? Cheers, Bas ******* Dr Watson log ************ Application exception occurred: App: (pid=1168) When: 27/05/2006 @ 13:34:08.334 Exception number: c000001d (illegal instruction) *----> System Information <----* Computer Name: xxx User Name: xxx Number of Processors: 1 Processor Type: x86 Family 6 Model 6 Stepping 2 Windows 2000 Version: 5.0 Current Build: 2195 Service Pack: 4 Current Type: Uniprocessor Free Registered Organization: xxx Registered Owner: xxx *----> Task List <----* 0 Idle.exe 8 System.exe 144 smss.exe 168 csrss.exe 164 winlogon.exe 216 services.exe 228 lsass.exe 404 svchost.exe 428 spoolsv.exe 456 avgamsvr.exe 472 avgupsvc.exe 500 cvpnd.exe 532 svchost.exe 568 kpf4ss.exe 616 nvsvc32.exe 664 regsvc.exe 688 MSTask.exe 752 WinMgmt.exe 768 kpf4gui.exe 780 svchost.exe 284 Explorer.exe 1108 kpf4gui.exe 1176 NetTime.exe 1184 avgcc.exe 1188 boincmgr.exe 1288 firefox.exe 1296 boinc.exe 1332 albert_4.37_win.exe 1168 pythonw.exe 1256 drwtsn32.exe 0 _Total.exe (1D000000 - 1D005000) (77F80000 - 77FFC000) (1E000000 - 1E1CA000) (7C570000 - 7C623000) (77E10000 - 77E79000) (77F40000 - 77F7C000) (7C2D0000 - 7C335000) (77D30000 - 77DA8000) (7CF30000 - 7D176000) (70A70000 - 70AD6000) (78000000 - 78045000) (71710000 - 71794000) (7C340000 - 7C396000) (1E1D0000 - 1E1DC000) (75030000 - 75044000) (75020000 - 75028000) (00B70000 - 00B7A000) (10220000 - 10321000) (76B30000 - 76B6E000) (75E60000 - 75E7A000) (10000000 - 1008F000) (7CA00000 - 7CA23000) (7CE20000 - 7CF0F000) (7C0F0000 - 7C154000) (7C740000 - 7C7CC000) (77430000 - 77441000) (1D110000 - 1D115000) (75050000 - 75058000) (10210000 - 10216000) (1EAA0000 - 1EAA9000) (1E740000 - 1E759000) (779B0000 - 77A4B000) (692E0000 - 69307000) (6F0C0000 - 6F10F000) (6A840000 - 6A869000) (6A780000 - 6A794000) (6AD40000 - 6AEFE000) (62F00000 - 62F1D000) (69D80000 - 69D88000) (64080000 - 64292000) (61980000 - 6198D000) (623C0000 - 623DE000) (6D400000 - 6D443000) (67340000 - 674F2000) (66CC0000 - 66E72000) (69500000 - 696B2000) (6FD40000 - 6FEF2000) (68BC0000 - 68BCF000) (63EC0000 - 63FA2000) (64640000 - 646E1000) (6AF80000 - 6B0F2000) (69380000 - 69390000) (01DF0000 - 022CF000) (022D0000 - 0249A000) (684C0000 - 684D0000) (024A0000 - 028FA000) (6B500000 - 6B6CA000) (02900000 - 02AAA000) (61480000 - 6148D000) (63E00000 - 63E73000) (6DD80000 - 6DD8C000) (67C00000 - 67C0C000) (6C2C0000 - 6C2D5000) (65A80000 - 65A88000) (02AB0000 - 02B1E000) (60380000 - 6038C000) (6A9C0000 - 6A9D8000) (6FBC0000 - 6FBF3000) (6B980000 - 6B9AD000) (68D00000 - 68D3E000) (69880000 - 698A4000) (02B20000 - 02B41000) (6B180000 - 6B19B000) (63080000 - 63094000) State Dump for Thread Id 0x3ac eax=00000005 ebx=00000003 ecx=0000000c edx=00000004 esi=0000006e edi=00000078 eip=6b1948df esp=0021d91c ebp=000001e0 iopl=0 nv up ei pl nz na po nc cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000206 function: 6b1948b8 8bac24fc000000 mov ebp,[esp+0xfc] ss:0021da18=000000a0 6b1948bf 4a dec edx 6b1948c0 89d0 mov eax,edx 6b1948c2 8d6c6d00 lea ebp,[ebp+ebp*2+0x0] ss:00a8a0c7=fffffd00 6b1948c6 c1e81f shr eax,0x1f 6b1948c9 896c245c mov [esp+0x5c],ebp ss:00ca7803=00000000 6b1948cd 01c2 add edx,eax 6b1948cf 8b842404010000 mov eax,[esp+0x104] ss:0021da20=00000005 6b1948d6 01c1 add ecx,eax 6b1948d8 89942490000000 mov [esp+0x90],edx ss:0021d9ac=00000004 FAULT ->6b1948df f20f10 repne ??? 6b1948e2 05a06e196b add eax,0x6b196ea0 6b1948e7 f20f10 repne ??? 6b1948ea 0db06e196b or eax,0x6b196eb0 6b1948ef f20f10 repne ??? 6b1948f2 15a86e196b adc eax,0x6b196ea8 6b1948f7 f20f10 repne ??? 6b1948fa 1db86e196b sbb eax,0x6b196eb8 6b1948ff c744245803000000 mov dword ptr [esp+0x58],0x3 ss:00ca7803=00000000 6b194907 c744245404000000 mov dword ptr [esp+0x54],0x4 ss:00ca7803=00000000 6b19490f c744245002000000 mov dword ptr [esp+0x50],0x2 ss:00ca7803=00000000 6b194917 c744244c00000000 mov dword ptr [esp+0x4c],0x0 ss:00ca7803=00000000 *----> Stack Back Trace <----* FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name 000001E0 00000000 00000000 00000000 00000000 00000000 ! *----> Raw Stack Dump <----* 0021d91c 00 00 00 00 b0 47 84 00 - 04 00 00 00 00 00 00 00 .....G.......... 0021d92c 00 00 00 00 00 00 00 00 - 50 48 84 00 64 00 00 00 ........PH..d... 0021d93c e0 ea 81 01 60 11 83 01 - 48 11 83 01 f0 37 b3 00 ....`...H....7.. 0021d94c 00 00 00 00 78 01 84 00 - 28 00 00 00 28 00 00 00 ....x...(...(... 0021d95c 28 00 00 00 28 00 00 00 - 48 11 83 01 e0 ea 81 01 (...(...H....... 0021d96c f0 37 b3 00 c7 d1 02 1e - e0 ea 81 01 e0 01 00 00 .7.............. 0021d97c 48 11 83 01 b0 44 6c 01 - a8 f4 97 9b 77 e3 e9 bf H....Dl.....w... 0021d98c ff 54 44 13 0e 6f ee 3f - 50 e9 2f 37 ef c6 d3 3f .TD..o.?P./7...? 0021d99c 5e 5a 75 04 23 cf e2 3f - e0 ea 81 01 00 00 00 00 ^Zu.#..?........ 0021d9ac 04 00 00 00 1c a2 82 01 - 03 00 00 00 a0 00 00 00 ................ 0021d9bc 50 00 00 00 ff ff ff ff - e8 47 19 1e 80 a3 60 01 P........G....`. 0021d9cc a0 55 66 01 a0 55 66 01 - 7f 02 21 00 e3 4f 19 6b .Uf..Uf...!..O.k 0021d9dc 1a 27 17 92 bf 15 00 40 - 9c f4 03 78 9c f4 03 78 .'..... at ...x...x 0021d9ec 70 40 ee 00 90 54 ea 00 - 00 00 84 00 07 00 00 00 p at ...T.......... 0021d9fc 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 24 40 ..............$@ 0021da0c 00 00 00 00 00 00 00 00 - 48 4b 84 00 a0 00 00 00 ........HK...... 0021da1c 04 00 00 00 05 00 00 00 - 78 01 84 00 98 54 ea 00 ........x....T.. 0021da2c 05 00 00 00 4c 00 00 00 - 01 00 00 00 a2 0a 19 6b ....L..........k 0021da3c 80 da 21 00 84 da 21 00 - 30 45 84 00 98 54 ea 00 ..!...!.0E...T.. 0021da4c a8 4a 84 00 d0 4a 84 00 - f8 4a 84 00 20 4b 84 00 .J...J...J.. K.. State Dump for Thread Id 0x424 eax=1006aad0 ebx=0116ff90 ecx=44553d1f edx=00000000 esi=77f88f08 edi=00000060 eip=77f88f13 esp=0116ff74 ebp=0116ff98 iopl=0 nv up ei ng nz ac po cy cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000297 function: ZwWaitForSingleObject 77f88f08 b8ea000000 mov eax,0xea 77f88f0d 8d542404 lea edx,[esp+0x4] ss:01bf9e5b=???????? 77f88f11 cd2e int 2e 77f88f13 c20c00 ret 0xc 77f88f16 8bff mov edi,edi *----> Stack Back Trace <----* FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name 0116FF98 1006AB69 00000060 000003E8 00000000 1E0525A7 ntdll!ZwWaitForSingleObject 0116FFEC 00000000 1006AAD0 00000000 00000000 000000C8 !TclpGetDate *----> Raw Stack Dump <----* 0116ff74 30 a0 59 7c 60 00 00 00 - 00 00 00 00 90 ff 16 01 0.Y|`........... 0116ff84 fc 91 b4 00 bf 9f 59 7c - 00 00 00 00 80 69 67 ff ......Y|.....ig. 0116ff94 ff ff ff ff ec ff 16 01 - 69 ab 06 10 60 00 00 00 ........i...`... 0116ffa4 e8 03 00 00 00 00 00 00 - a7 25 05 1e 30 b5 b9 31 .........%..0..1 0116ffb4 81 81 c6 01 88 b3 57 7c - 00 00 00 00 fc 91 b4 00 ......W|........ 0116ffc4 a7 25 05 1e 00 00 00 00 - 00 d0 fd 7f 1f 3d 55 44 .%...........=UD 0116ffd4 c0 ff 16 01 1f 3d 55 44 - ff ff ff ff 54 1f 5c 7c .....=UD....T.\| 0116ffe4 08 2b 57 7c 00 00 00 00 - 00 00 00 00 00 00 00 00 .+W|............ 0116fff4 d0 aa 06 10 00 00 00 00 - 00 00 00 00 c8 00 00 00 ................ 01170004 00 01 00 00 ff ee ff ee - 02 10 00 00 00 00 00 00 ................ 01170014 00 fe 00 00 00 00 10 00 - 00 20 00 00 00 02 00 00 ......... ...... 01170024 00 20 00 00 9d 02 00 00 - ff ef fd 7f 05 00 08 06 . .............. 01170034 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 01170044 98 05 17 01 0f 00 00 00 - f8 ff ff ff 50 00 17 01 ............P... 01170054 50 00 17 01 40 06 17 01 - 00 00 00 00 00 00 00 00 P... at ........... 01170064 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 01170074 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 01170084 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 01170094 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ 011700a4 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00 ................ From seefeld at sympatico.ca Sat May 27 09:08:29 2006 From: seefeld at sympatico.ca (Stefan Seefeld) Date: Sat, 27 May 2006 09:08:29 -0400 Subject: [SciPy-user] Error building scipy-0.4.9 on FC5 In-Reply-To: <4477C98B.3000903@gmail.com> References: <4477A3C7.6000809@sympatico.ca> <4477C98B.3000903@gmail.com> Message-ID: <44784F4D.60104@sympatico.ca> Robert Kern wrote: > Stefan Seefeld wrote: >> Hi there, >> >> I'v been trying to build scipy 0.4.9 without luck. I'm using FC5, and installed >> numpy as an rpm package (so I thought that the corresponding lines of the install >> procedure were irrelevant). >> I get: >> >> $ python setup.py build >> /usr/lib/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'configuration' >> >> What am I missing ? > > You will need a more recent numpy, I believe. numpy 0.9.8 matches with scipy 0.4.9. I see. What version of scipy corresponds to numpy 0.9.6 ? Thanks, Stefan From oliphant.travis at ieee.org Sat May 27 09:27:34 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Sat, 27 May 2006 07:27:34 -0600 Subject: [SciPy-user] Error building scipy-0.4.9 on FC5 In-Reply-To: <44784F4D.60104@sympatico.ca> References: <4477A3C7.6000809@sympatico.ca> <4477C98B.3000903@gmail.com> <44784F4D.60104@sympatico.ca> Message-ID: <447853C6.4090000@ieee.org> Stefan Seefeld wrote: > Robert Kern wrote: > >> Stefan Seefeld wrote: >> >>> Hi there, >>> >>> I'v been trying to build scipy 0.4.9 without luck. I'm using FC5, and installed >>> numpy as an rpm package (so I thought that the corresponding lines of the install >>> procedure were irrelevant). >>> I get: >>> >>> $ python setup.py build >>> /usr/lib/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'configuration' >>> >>> What am I missing ? >>> >> You will need a more recent numpy, I believe. numpy 0.9.8 matches with scipy 0.4.9. >> > > I see. What version of scipy corresponds to numpy 0.9.6 ? > scipy 0.4.8 is known to work with numpy 0.9.6 -Travis From seefeld at sympatico.ca Sat May 27 09:46:11 2006 From: seefeld at sympatico.ca (Stefan Seefeld) Date: Sat, 27 May 2006 09:46:11 -0400 Subject: [SciPy-user] Error building scipy-0.4.9 on FC5 In-Reply-To: <447853C6.4090000@ieee.org> References: <4477A3C7.6000809@sympatico.ca> <4477C98B.3000903@gmail.com> <44784F4D.60104@sympatico.ca> <447853C6.4090000@ieee.org> Message-ID: <44785823.1070608@sympatico.ca> Travis Oliphant wrote: > scipy 0.4.8 is known to work with numpy 0.9.6 Thanks ! I'm now trying to compile scipy 0.4.8, and I get a bunch of 'UserWarnings', all triggered by /usr/lib/python2.4/site-packages/numpy/distutils/system_info.py Finally, I get a stack trace from this exception: numpy.distutils.system_info.NotFoundError: Some third-party program or library is not found. I'm not sure whom to report this to. As I said, numpy was installed as an rpm package from Fedora. Is this a packaging error, i.e. should these dependencies be checked (and resolved) by the rpm installer ? Thanks again, Stefan From seefeld at sympatico.ca Sat May 27 10:05:01 2006 From: seefeld at sympatico.ca (Stefan Seefeld) Date: Sat, 27 May 2006 10:05:01 -0400 Subject: [SciPy-user] Error building scipy-0.4.9 on FC5 In-Reply-To: <44785823.1070608@sympatico.ca> References: <4477A3C7.6000809@sympatico.ca> <4477C98B.3000903@gmail.com> <44784F4D.60104@sympatico.ca> <447853C6.4090000@ieee.org> <44785823.1070608@sympatico.ca> Message-ID: <44785C8D.4000900@sympatico.ca> Stefan Seefeld wrote: > Finally, I get a stack trace from this exception: > > numpy.distutils.system_info.NotFoundError: Some third-party program or library is not found. I resolved the missing dependencies by installing blas-devel and lapack-devel. Could the build system be enhanced to provide a more user-friendly message (and no stack trace at all) ? For example something like "You need at least one of these libraries installed: [X, Y, Z]" Thanks. I'm now compiling scipy (0.4.8), and eventually run into this error: building 'scipy.cluster._vq' extension compiling C++ sources c++ options: '-pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC' creating build/temp.linux-i686-2.4/Lib/cluster creating build/temp.linux-i686-2.4/Lib/cluster/src compile options: '-I/usr/lib/python2.4/site-packages/numpy/core/include -I/usr/include/python2.4 -c' c++: Lib/cluster/src/vq_wrap.cpp cc1plus: error: unrecognized command line option "-fstack-protector" cc1plus: error: invalid parameter ?ssp-buffer-size? Lib/cluster/src/vq_wrap.cpp:1: error: bad value (generic) for -mtune= switch Who is providing the compilation flags ? FYI, I'm using g++ 4.1 (FC5's system compiler). Thanks for your help ! Stefan From schofield at ftw.at Sat May 27 13:04:27 2006 From: schofield at ftw.at (Ed Schofield) Date: Sat, 27 May 2006 19:04:27 +0200 Subject: [SciPy-user] fft crashes python In-Reply-To: <6f54c160605270507v79a9c783g479c9cab5f2a97cf@mail.gmail.com> References: <6f54c160605270120l6cd2730fp31da0f7c7b8f108a@mail.gmail.com> <4478176A.5070904@ieee.org> <6f54c160605270507v79a9c783g479c9cab5f2a97cf@mail.gmail.com> Message-ID: <4478869B.1030008@ftw.at> weg werp wrote: > My computer is a Athlon 1700+ with 750MB ram, running win2K and python 2.4 > I am using the pre-compiled binaries for windows: > numpy-0.9.8.win32-py2.4.exe > scipy-0.4.9.win32-py2.4.exe > > After the crash, DrWatson complains about an illegal instruction, see below. > > With the debugger in Idle, the last message that is visible before the crash is: > >> scipy.fftpack.basic.fft(), line 101: return work_function(tmp,n,1,0,overwrite_x) >> > so it is either that line or the next that is crashing. > > Could it be that the binaries are compiled for Intel processors that > use some of the newer instructions which my Athlon doesn't like?? > The binaries are compiled against ATLAS libraries compiled for the Pentium 3 with SSE 1. I think your processor _should_ support SSE 1 in theory, but perhaps this isn't quite true in practice. I've now compiled a version against ATLAS libraries for Pentium 2; you can get it from the sourceforge site as scipy-0.4.9.win32-py2.4-P2.exe. Uninstall the existing version and give this a whirl! -- Ed From wegwerp at gmail.com Sat May 27 17:14:18 2006 From: wegwerp at gmail.com (weg werp) Date: Sat, 27 May 2006 23:14:18 +0200 Subject: [SciPy-user] fft crashes python In-Reply-To: <4478869B.1030008@ftw.at> References: <6f54c160605270120l6cd2730fp31da0f7c7b8f108a@mail.gmail.com> <4478176A.5070904@ieee.org> <6f54c160605270507v79a9c783g479c9cab5f2a97cf@mail.gmail.com> <4478869B.1030008@ftw.at> Message-ID: <6f54c160605271414p23c2df5cid17418b98ee64a6f@mail.gmail.com> Hi Ed, thanks for that. I installed the new verion, but unfortunately the problem is still there in exactly the same place: signal.fft fails with a crash and scipy.test(10,10) still fails at exactly the same place, last sign of life is 'check_simple (scipy.linalg.tests.test_decomp.test_schur) ... ok'. I'll try to investigate some more when I have time. Mightbe the un-installation didn't work so well, so I will try a complete reinstall of python. It that still fails I will try to compile myself, but that is completely new territory for me. Bas On 5/27/06, Ed Schofield wrote: > weg werp wrote: > > My computer is a Athlon 1700+ with 750MB ram, running win2K and python 2.4 > > I am using the pre-compiled binaries for windows: > > numpy-0.9.8.win32-py2.4.exe > > scipy-0.4.9.win32-py2.4.exe > > > > After the crash, DrWatson complains about an illegal instruction, see below. > > > > With the debugger in Idle, the last message that is visible before the crash is: > > > >> scipy.fftpack.basic.fft(), line 101: return work_function(tmp,n,1,0,overwrite_x) > >> > > so it is either that line or the next that is crashing. > > > > Could it be that the binaries are compiled for Intel processors that > > use some of the newer instructions which my Athlon doesn't like?? > > > > The binaries are compiled against ATLAS libraries compiled for the > Pentium 3 with SSE 1. I think your processor _should_ support SSE 1 in > theory, but perhaps this isn't quite true in practice. I've now > compiled a version against ATLAS libraries for Pentium 2; you can get it > from the sourceforge site as scipy-0.4.9.win32-py2.4-P2.exe. Uninstall > the existing version and give this a whirl! > > -- Ed > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From oliphant.travis at ieee.org Sat May 27 23:29:05 2006 From: oliphant.travis at ieee.org (Travis E. Oliphant) Date: Sat, 27 May 2006 21:29:05 -0600 Subject: [SciPy-user] Looking for triangulator/interpolator In-Reply-To: <127gjvrhk7udbcc@corp.supernews.com> References: <127f313dbhl7gf4@corp.supernews.com> <127fp09e6v176a5@corp.supernews.com> <127gjvrhk7udbcc@corp.supernews.com> Message-ID: <44791901.6000603@ieee.org> Grant Edwards wrote: > On 2006-05-27, Travis E. Oliphant wrote: > >> Not that you made a bad choice. I do wonder, how much of your >> difficulty was with the interface to the underlying fitpack >> routines. > > I've no idea. I had never done anything with splines before, > so it's quite possible I just wasn't doing things right. I > never got it to work at all for non-gridded data (which is what > I needed). Since it wasn't stable even for gridded data, I > more or less gave up. > >> The interface is pretty involved as there are lots of >> parameter choices to the underlying routine. It's very >> possible the interface is broken in some strange way. > > I took a look at underlying Fortran code, but that made my > dizzy. Just to finish this thread, I should mention I spent some time yesterday looking into the details of the underlying surfit fucntion used by bisplrep. It appears to have difficulties when s=0 is used. It seems to be geared toward smoothing applications where you are trying to fit "noisy" scattered data to a smooth function. There are many warnings about choosing s to be too low. Thus, trying to use bisplrep for interpolation (instead of data smoothing) is probably going to be difficult with bisplrep. We still need a good N-d re-gridding algorithm in SciPy. -Travis From stian at soiland.no Sun May 28 13:34:31 2006 From: stian at soiland.no (Stian Soiland) Date: Sun, 28 May 2006 18:34:31 +0100 Subject: [SciPy-user] scipy not easy_install-able Message-ID: I tried, naively perhaps, to install scipy using easy_install[1]: : stain at sandra ~;sudo easy_install scipy Searching for scipy Reading http://www.python.org/pypi/scipy/ Reading http://www.scipy.org Reading http://new.scipy.org/Wiki/Download Best match: scipy 0.4.9 Downloading http://193.190.198.97/sourceforge/scipy/scipy-0.4.9.tar.gz Processing scipy-0.4.9.tar.gz Running scipy-0.4.9/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Mjgb6D/scipy-0.4.9/egg-dist-tmp-sgJBNS SandboxViolation: open('/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/testing/info.py', 'U') {} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. (..) File "setup.py", line 50, in ? File "setup.py", line 23, in setup_package File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/__init__.py", line 42, in ? __doc__ += pkgload.get_pkgdocs() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/_import_tools.py", line 319, in get_pkgdocs retstr = self._format_titles(titles) +\ File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/numpy/_import_tools.py", line 282, in _format_titles max_length = max(lengths) ValueError: max() arg is an empty sequence [1] http://peak.telecommunity.com/DevCenter/EasyInstall I don't know quite why this things happens, if it is scipy, numpy or easy_install's fault. It would be nice to install via easy_install instead of doing it manually. I am afraid I don't have time to look further into the matters right now.. I am on: OS X 10.4, Python 2.4.1, numpy 0.9.4 -- Stian S?iland Any society that would give up a little Manchester, UK liberty to gain a little security will http://soiland.no/ deserve neither and lose both. [Franklin] =/\= From robert.kern at gmail.com Mon May 29 20:48:35 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 29 May 2006 19:48:35 -0500 Subject: [SciPy-user] scipy not easy_install-able In-Reply-To: References: Message-ID: <447B9663.20006@gmail.com> Stian Soiland wrote: > I tried, naively perhaps, to install scipy using easy_install[1]: > I don't know quite why this things happens, if it is scipy, numpy or > easy_install's fault. It would be nice to install via easy_install > instead of doing it manually. I am afraid I don't have time to look > further into the matters right now.. > > I am on: OS X 10.4, Python 2.4.1, numpy 0.9.4 It's a known issue. David Cooke recently checked in some changes to numpy that should help. I have not yet tried it myself, though. However, scipy has a number of non-Python dependencies that need to be properly configured. Unless if you have them all set up and are using environment variables to tell scipy where they are (instead of using site.cfg), it is likely that "easy_install scipy" won't work anyways. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From cookedm at physics.mcmaster.ca Mon May 29 23:04:09 2006 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Mon, 29 May 2006 23:04:09 -0400 Subject: [SciPy-user] scipy not easy_install-able In-Reply-To: <447B9663.20006@gmail.com> (Robert Kern's message of "Mon, 29 May 2006 19:48:35 -0500") References: <447B9663.20006@gmail.com> Message-ID: Robert Kern writes: > Stian Soiland wrote: >> I tried, naively perhaps, to install scipy using easy_install[1]: > >> I don't know quite why this things happens, if it is scipy, numpy or >> easy_install's fault. It would be nice to install via easy_install >> instead of doing it manually. I am afraid I don't have time to look >> further into the matters right now.. >> >> I am on: OS X 10.4, Python 2.4.1, numpy 0.9.4 > > It's a known issue. David Cooke recently checked in some changes to numpy that > should help. I have not yet tried it myself, though. Numpy 0.9.8 is easy_install'able with the latest setuptools (0.6b1). I just tried, and scipy bombs out partway (looks like it doesn't build the fftpack library, so I'm guessing somewhere some dependency-generating code doesn't get called). The problem is we extend distutils (with numpy.distutils) extensively, and some of that conflicts with what setuptools does, so using easy_install is a bit fragile. (The current "fix" depends on some internal details of setuptools, hence the requirement for 0.6b1.) Making an egg is ok, and has worked for a while now. Do this: $ python setup.py build $ python -c 'import setuptools; execfile("setup.py")' bdist_egg $ easy_install dist/scipy-.egg -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From robert.kern at gmail.com Mon May 29 23:08:40 2006 From: robert.kern at gmail.com (Robert Kern) Date: Mon, 29 May 2006 22:08:40 -0500 Subject: [SciPy-user] scipy not easy_install-able In-Reply-To: References: <447B9663.20006@gmail.com> Message-ID: <447BB738.9030401@gmail.com> David M. Cooke wrote: > The problem is we extend distutils (with numpy.distutils) extensively, > and some of that conflicts with what setuptools does, so using > easy_install is a bit fragile. (The current "fix" depends on some > internal details of setuptools, hence the requirement for 0.6b1.) You may want to email Phillip about what you've done. The last time I talked to him about this, he was amenable to making changes to setuptools to help us get easy_install working with numpy.distutils, but I didn't have time to figure out exactly what needed to be done at the time. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From wegwerp at gmail.com Tue May 30 10:32:13 2006 From: wegwerp at gmail.com (weg werp) Date: Tue, 30 May 2006 16:32:13 +0200 Subject: [SciPy-user] module with physical constants Message-ID: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> Hi group, I have a background in physics and I find myself repeatedly defining things like c=3e8 when I am lazy, or c=299792458 when I need the accuracy. It would be nice to do just 'from constants import c' and get the correct value without having to grab for some handbook of physics and risk a typo. I made a small list of things I use myself. I am willing to spend some time extending the list with some more commonly used values, but only if people here find it useful for inclusion in Scipy. An obvious start would be the 'frequently used constants' table from http://physics.nist.gov/cuu/Constants/ combined with some other constans like conversion factors between imperial and SI, lightyears, arcminutes etc. If everything is defined in SI units, you could do tricks like from constants import * speed = 23454 * parsec / week # in m/s print 'your are going',speed/Mach,'times the speed of sound.' p = 18 * torr # in Pascal print 'the pressure is', p/atm, 'atmosphere or', p/psi, 'pounds per square inch'. I did some googling, and it appears that someone has done this before: http://old.scipy.org/mailinglists/mailman?fn=scipy-dev/2002-October/001259.html The problem I have with that version is that I don't like the format (it is in a dict with ugly names) and that he imports the complete CODATA set, which is too much (I think the number of users for the 'shielded helion gyromagn. ratio over 2 pi' is limited). The use case for the various uncertainties in the constants is also limited I guess. I am not planning to include the complete periodic system, just the basic stuff. I remember one language (pascal?) that had a scientific data type, which kept track of all the SI units during calculations. I have never seen anybody using such a thing, so that is probably overkill too. A simple module with some float constants is probably enough. Any interest for this or am I wasting my time? Cheers, Bas From jbattat at cfa.harvard.edu Tue May 30 10:42:06 2006 From: jbattat at cfa.harvard.edu (James Battat) Date: Tue, 30 May 2006 10:42:06 -0400 (EDT) Subject: [SciPy-user] module with physical constants In-Reply-To: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> Message-ID: > Hi group, > > I have a background in physics and I find myself repeatedly defining > things like c=3e8 when I am lazy, or c=299792458 when I need the > accuracy. It would be nice to do just > 'from constants import c' and get the correct value without having to > grab for some handbook of physics and risk a typo. > > I made a small list of things I use myself. I am willing to spend some > time extending the list with some more commonly used values, but only > if people here find it useful for inclusion in Scipy. An obvious start > would be the 'frequently used constants' table from ... > Any interest for this or am I wasting my time? I would also like to see this addition into the scipy distribution. Including the standard uncertainties (where applicable), would be desirable as well. James From alpha-scipy at dinomight.de Tue May 30 10:43:37 2006 From: alpha-scipy at dinomight.de (Alpha) Date: Tue, 30 May 2006 16:43:37 +0200 Subject: [SciPy-user] module with physical constants In-Reply-To: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> Message-ID: <20060530164337.5a6d7c2b@Kakao> Hello Group, I'd really be interestes in such a thing and I would also be interested in a scientific datatype with units. To round things up, a formula datatype would be terrific too. Im not sure, wether some of this already exists. cheers, Alpha From jonas at mwl.mit.edu Tue May 30 10:50:47 2006 From: jonas at mwl.mit.edu (Eric Jonas) Date: Tue, 30 May 2006 10:50:47 -0400 Subject: [SciPy-user] module with physical constants In-Reply-To: <20060530164337.5a6d7c2b@Kakao> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> <20060530164337.5a6d7c2b@Kakao> Message-ID: <1149000648.4105.4.camel@localhost.localdomain> Have you guys seen: http://home.tiscali.be/be052320/Unum.html It's not exactly what you're looking for, but it does have a lot of the same functionality... ...Eric On Tue, 2006-05-30 at 16:43 +0200, Alpha wrote: > Hello Group, > > I'd really be interestes in such a thing and I would also be > interested in a scientific datatype with units. > > To round things up, a formula datatype would be terrific too. > > Im not sure, wether some of this already exists. > > cheers, > > Alpha > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From wegwerp at gmail.com Tue May 30 11:00:28 2006 From: wegwerp at gmail.com (weg werp) Date: Tue, 30 May 2006 17:00:28 +0200 Subject: [SciPy-user] module with physical constants In-Reply-To: <1149000648.4105.4.camel@localhost.localdomain> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> <20060530164337.5a6d7c2b@Kakao> <1149000648.4105.4.camel@localhost.localdomain> Message-ID: <6f54c160605300800y170fb579h1e1e729f0f41ca85@mail.gmail.com> Thanks, I hadn't found that one. Looks nice. But as I said, this is overkill for me in daily use, I am mainly interested in constants. I usually write the units in the comments when it is unclear. Bas On 5/30/06, Eric Jonas wrote: > Have you guys seen: http://home.tiscali.be/be052320/Unum.html > > It's not exactly what you're looking for, but it does have a lot of the > same functionality... > ...Eric > > > On Tue, 2006-05-30 at 16:43 +0200, Alpha wrote: > > Hello Group, > > > > I'd really be interestes in such a thing and I would also be > > interested in a scientific datatype with units. > > > > To round things up, a formula datatype would be terrific too. > > > > Im not sure, wether some of this already exists. > > > > cheers, > > > > Alpha > > > > _______________________________________________ > > 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 tim.leslie at gmail.com Tue May 30 23:05:38 2006 From: tim.leslie at gmail.com (Tim Leslie) Date: Wed, 31 May 2006 13:05:38 +1000 Subject: [SciPy-user] module with physical constants In-Reply-To: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> Message-ID: On 5/31/06, weg werp wrote: > > Any interest for this or am I wasting my time? I would find a module with the constants useful. Cheers, Timl Cheers, > Bas > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliphant.travis at ieee.org Tue May 30 23:10:36 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Tue, 30 May 2006 21:10:36 -0600 Subject: [SciPy-user] module with physical constants In-Reply-To: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> Message-ID: <447D092C.9050102@ieee.org> weg werp wrote: > Hi group, > > I have a background in physics and I find myself repeatedly defining > things like c=3e8 when I am lazy, or c=299792458 when I need the > accuracy. It would be nice to do just > 'from constants import c' and get the correct value without having to > grab for some handbook of physics and risk a typo. > I think this would be a good module to have as well. > http://physics.nist.gov/cuu/Constants/ > > combined with some other constans like conversion factors between > imperial and SI, lightyears, arcminutes etc. If everything is defined > in SI units, you could do tricks like > > from constants import * > speed = 23454 * parsec / week # in m/s > print 'your are going',speed/Mach,'times the speed of sound.' > p = 18 * torr # in Pascal > print 'the pressure is', p/atm, 'atmosphere or', p/psi, 'pounds per > square inch'. > I like this style for doing unit conversions. I think keeping it simple as a module of float constants is a great idea. -Travis From robert.kern at gmail.com Tue May 30 23:24:37 2006 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 30 May 2006 22:24:37 -0500 Subject: [SciPy-user] module with physical constants In-Reply-To: <447D092C.9050102@ieee.org> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> <447D092C.9050102@ieee.org> Message-ID: <447D0C75.1080309@gmail.com> Travis Oliphant wrote: > weg werp wrote: >>http://physics.nist.gov/cuu/Constants/ >> >>combined with some other constans like conversion factors between >>imperial and SI, lightyears, arcminutes etc. If everything is defined >>in SI units, you could do tricks like >> >>from constants import * >>speed = 23454 * parsec / week # in m/s >>print 'your are going',speed/Mach,'times the speed of sound.' >>p = 18 * torr # in Pascal >>print 'the pressure is', p/atm, 'atmosphere or', p/psi, 'pounds per >>square inch'. > > I like this style for doing unit conversions. I think keeping it > simple as a module of float constants is a great idea. I would prefer that the underlying database of constants and units is that dictionary full of "ugly" names provided by Chuck so long ago. Among other things, it's programmatically accessible. A more convenient set of variable names can be glommed into a neighboring module that indexes into that dictionary. And yes, I want the full set of CODATA Recommended Values. I do have reservations about such a thing becoming *the* scipy module for doing unit conversions, though. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From oliphant.travis at ieee.org Wed May 31 00:15:52 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Tue, 30 May 2006 22:15:52 -0600 Subject: [SciPy-user] module with physical constants In-Reply-To: <447D0C75.1080309@gmail.com> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> <447D092C.9050102@ieee.org> <447D0C75.1080309@gmail.com> Message-ID: <447D1878.80702@ieee.org> Robert Kern wrote: > Travis Oliphant wrote: > >> weg werp wrote: >> > > >>> http://physics.nist.gov/cuu/Constants/ >>> >>> combined with some other constans like conversion factors between >>> imperial and SI, lightyears, arcminutes etc. If everything is defined >>> in SI units, you could do tricks like >>> >>> >> >from constants import * >> >>> speed = 23454 * parsec / week # in m/s >>> print 'your are going',speed/Mach,'times the speed of sound.' >>> p = 18 * torr # in Pascal >>> print 'the pressure is', p/atm, 'atmosphere or', p/psi, 'pounds per >>> square inch'. >>> >> I like this style for doing unit conversions. I think keeping it >> simple as a module of float constants is a great idea. >> > > I would prefer that the underlying database of constants and units is that > dictionary full of "ugly" names provided by Chuck so long ago. Among other > things, it's programmatically accessible. A more convenient set of variable > names can be glommed into a neighboring module that indexes into that dictionary. > > And yes, I want the full set of CODATA Recommended Values. > > I do have reservations about such a thing becoming *the* scipy module for doing > unit conversions, though. > Let's check PhysicalConstants.py into the sandbox along with a "simpler" constants module and start playing... -Travis From oliphant.travis at ieee.org Wed May 31 00:25:39 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Tue, 30 May 2006 22:25:39 -0600 Subject: [SciPy-user] module with physical constants In-Reply-To: <447D0C75.1080309@gmail.com> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> <447D092C.9050102@ieee.org> <447D0C75.1080309@gmail.com> Message-ID: <447D1AC3.7040800@ieee.org> Robert Kern wrote: > I would prefer that the underlying database of constants and units is that > dictionary full of "ugly" names provided by Chuck so long ago. Among other > things, it's programmatically accessible. A more convenient set of variable > names can be glommed into a neighboring module that indexes into that dictionary. > > And yes, I want the full set of CODATA Recommended Values. > > > I've checked in Chuck's PhysicalConstants.py file as physical_constants.py under the constants module in the scipy sandbox. Feel free to contribute more. -Travis From morovia at rediffmail.com Wed May 31 04:20:48 2006 From: morovia at rediffmail.com (morovia) Date: 31 May 2006 08:20:48 -0000 Subject: [SciPy-user] module with physical constants Message-ID: <20060531082048.11790.qmail@webmail57.rediffmail.com> Hello, May be interconversion between various physical units also desirable. e.g mass.changeto('kg')- yields in kilogram. Also my wish list are the chemical constants and periodic table. Thanks Morovia. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wegwerp at gmail.com Wed May 31 04:41:58 2006 From: wegwerp at gmail.com (weg werp) Date: Wed, 31 May 2006 10:41:58 +0200 Subject: [SciPy-user] module with physical constants In-Reply-To: <447D1878.80702@ieee.org> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> <447D092C.9050102@ieee.org> <447D0C75.1080309@gmail.com> <447D1878.80702@ieee.org> Message-ID: <6f54c160605310141w189b5d08tfa1d47372d8bf627@mail.gmail.com> Ok, there seems to be enough interest. I'll do as Travis says: I'll use Chucks module without modifications as a seperate module and use that as the data source for my module. I will only use the most common ones plus some extras that are not found there (inch, psi, standard atmosphere, ...). I will try to finish something in a few days. Cheers, Bas From wegwerp at gmail.com Wed May 31 04:55:35 2006 From: wegwerp at gmail.com (weg werp) Date: Wed, 31 May 2006 10:55:35 +0200 Subject: [SciPy-user] module with physical constants In-Reply-To: <20060531082048.11790.qmail@webmail57.rediffmail.com> References: <20060531082048.11790.qmail@webmail57.rediffmail.com> Message-ID: <6f54c160605310155r3065cdc6pcf6a4845c46dee3a@mail.gmail.com> > mass.changeto('kg')- yields in kilogram. I want to keep it simple: weight_in_kilos = weight_in_pounds * pound weight_in_pounds = weight_in_kilos / pound If you want to do it complicated see the unum module mentioned above. > Also my wish list are the chemical constants and periodic table. You need a complete database for that which should go into a separate module. I guess you can find the data somewhere so all you have to do is write a small interface module. I am a physicist, so keep on wishing .... Bas From dd55 at cornell.edu Wed May 31 08:03:35 2006 From: dd55 at cornell.edu (Darren Dale) Date: Wed, 31 May 2006 08:03:35 -0400 Subject: [SciPy-user] module with physical constants In-Reply-To: <447D0C75.1080309@gmail.com> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> <447D092C.9050102@ieee.org> <447D0C75.1080309@gmail.com> Message-ID: <200605310803.35753.dd55@cornell.edu> On Tuesday 30 May 2006 11:24 pm, Robert Kern wrote: > Travis Oliphant wrote: > > weg werp wrote: > >>http://physics.nist.gov/cuu/Constants/ > >> > >>combined with some other constans like conversion factors between > >>imperial and SI, lightyears, arcminutes etc. If everything is defined > >>in SI units, you could do tricks like > >> > >>from constants import * > >>speed = 23454 * parsec / week # in m/s > >>print 'your are going',speed/Mach,'times the speed of sound.' > >>p = 18 * torr # in Pascal > >>print 'the pressure is', p/atm, 'atmosphere or', p/psi, 'pounds per > >>square inch'. > > > > I like this style for doing unit conversions. I think keeping it > > simple as a module of float constants is a great idea. > > I would prefer that the underlying database of constants and units is that > dictionary full of "ugly" names provided by Chuck so long ago. Among other > things, it's programmatically accessible. A more convenient set of variable > names can be glommed into a neighboring module that indexes into that > dictionary. > > And yes, I want the full set of CODATA Recommended Values. > > I do have reservations about such a thing becoming *the* scipy module for > doing unit conversions, though. What if the constants were defined in SI, but let each constant derive from a class or classes with methods that take care of conversion to other unit systems. I was thinking of using gettable, but not settable, object properties like si, cgs, emperial... Maybe the module could even be designed such that the desired unit system is set as the default at module load time, so the user could do "c=lightspeed" instead of "c=lightspeed.cgs". This would still be compatible with further unit conversions, like "lightspeed/week". I remember trying to do conversion between electromagnetic units and SI, which I was never quite able to wrap my head around. It would really be nice to have unit conversion built in somehow. Darren From travis at enthought.com Wed May 31 10:57:47 2006 From: travis at enthought.com (Travis N. Vaught) Date: Wed, 31 May 2006 09:57:47 -0500 Subject: [SciPy-user] module with physical constants In-Reply-To: <200605310803.35753.dd55@cornell.edu> References: <6f54c160605300732u72e066c5kb2616baefc84687e@mail.gmail.com> <447D092C.9050102@ieee.org> <447D0C75.1080309@gmail.com> <200605310803.35753.dd55@cornell.edu> Message-ID: <447DAEEB.5080600@enthought.com> Darren Dale wrote: > On Tuesday 30 May 2006 11:24 pm, Robert Kern wrote: > >> Travis Oliphant wrote: >> >>> weg werp wrote: >>> >>>> http://physics.nist.gov/cuu/Constants/ >>>> >>>> combined with some other constans like conversion factors between >>>> imperial and SI, lightyears, arcminutes etc. If everything is defined >>>> in SI units, you could do tricks like >>>> >>>> >>> >from constants import * >>> >>>> speed = 23454 * parsec / week # in m/s >>>> print 'your are going',speed/Mach,'times the speed of sound.' >>>> p = 18 * torr # in Pascal >>>> print 'the pressure is', p/atm, 'atmosphere or', p/psi, 'pounds per >>>> square inch'. >>>> >>> I like this style for doing unit conversions. I think keeping it >>> simple as a module of float constants is a great idea. >>> >> I would prefer that the underlying database of constants and units is that >> dictionary full of "ugly" names provided by Chuck so long ago. Among other >> things, it's programmatically accessible. A more convenient set of variable >> names can be glommed into a neighboring module that indexes into that >> dictionary. >> >> And yes, I want the full set of CODATA Recommended Values. >> >> I do have reservations about such a thing becoming *the* scipy module for >> doing unit conversions, though. >> > > What if the constants were defined in SI, but let each constant derive from a > class or classes with methods that take care of conversion to other unit > systems. I was thinking of using gettable, but not settable, object > properties like si, cgs, emperial... Maybe the module could even be designed > such that the desired unit system is set as the default at module load time, > so the user could do "c=lightspeed" instead of "c=lightspeed.cgs". This would > still be compatible with further unit conversions, like "lightspeed/week". > > I remember trying to do conversion between electromagnetic units and SI, which > I was never quite able to wrap my head around. It would really be nice to > have unit conversion built in somehow. > > Darren > > It seems like the real thrust of this thread is to have a simple constants module(s), but the conversation has ballooned a bit into the (valid) need for a full-blown unit package. This has been don before in the Unum module mentioned as well as a units package (based on a fork of Michael Aivazis's units package) included with the Enthought Tool Suite ('ETS' -- which some folks may be surprised they already have installed if they're using a recent version of the Python Enthought Edition distro). The ETS units package could still use some work in it's handling of "unit families" (or 'measure-of') but it does provide all the functionality you're mentioning (conversion, unit systems). It's probably easier to show than to explain: C:\>python Python 2.3.5 - Enthought Edition 0.9.7 (#62, May 11 2005, 20:02:58) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from enthought.units.mass import * >>> from enthought.units.energy import * >>> from enthought.units.speed import * >>> mass = 1*kg >>> mass 1.0*kg >>> C = 299792458.0*meters_per_second # no constants included, (still guessing the right numbers) >>> C 299792458.0*m*s**-1 >>> E = mass*C**2 >>> E 89875517873681760.0*m**2*kg*s**-2 >>> joule # check to see if this is in Joules 1.0*m**2*kg*s**-2 These are obviously objects, though... >>> E.__class__ ...so you don't get the lightweight notion of simple floats assigned to symbols in the namespace as Travis O. was saying. Which begs the question of whether you really want the namespace mangling which comes from a "from constants import *" If I understand it right, I think I like Robert's dictionary idea. Travis From Michael_OKeefe at nrel.gov Wed May 31 11:29:15 2006 From: Michael_OKeefe at nrel.gov (O'Keefe, Michael) Date: Wed, 31 May 2006 09:29:15 -0600 Subject: [SciPy-user] module with physical constants Message-ID: I'm happy to see a move towards a physical constants and units package. Just thought I'd mention that another source that may be worth noting/referencing for ideas is the SIUnits module in the Modelica language: http://www.dynasim.se/ModelicaStandardLibrary/help/Modelica_SIunits.html#Modelica.SIunits This is not python (in fact it's the Modelica language) but I think one can get some ideas for a python implementation from here. -Michael FYI. For those who want to reference, Modelica is at http://www.modelica.org -----Original Message----- From: scipy-user-bounces at scipy.net [mailto:scipy-user-bounces at scipy.net] On Behalf Of Travis N. Vaught Sent: Wednesday, May 31, 2006 8:58 To: SciPy Users List Subject: Re: [SciPy-user] module with physical constants Darren Dale wrote: > On Tuesday 30 May 2006 11:24 pm, Robert Kern wrote: > >> Travis Oliphant wrote: >> >>> weg werp wrote: >>> >>>> http://physics.nist.gov/cuu/Constants/ >>>> >>>> combined with some other constans like conversion factors between >>>> imperial and SI, lightyears, arcminutes etc. If everything is defined >>>> in SI units, you could do tricks like >>>> >>>> >>> >from constants import * >>> >>>> speed = 23454 * parsec / week # in m/s >>>> print 'your are going',speed/Mach,'times the speed of sound.' >>>> p = 18 * torr # in Pascal >>>> print 'the pressure is', p/atm, 'atmosphere or', p/psi, 'pounds per >>>> square inch'. >>>> >>> I like this style for doing unit conversions. I think keeping it >>> simple as a module of float constants is a great idea. >>> >> I would prefer that the underlying database of constants and units is that >> dictionary full of "ugly" names provided by Chuck so long ago. Among other >> things, it's programmatically accessible. A more convenient set of variable >> names can be glommed into a neighboring module that indexes into that >> dictionary. >> >> And yes, I want the full set of CODATA Recommended Values. >> >> I do have reservations about such a thing becoming *the* scipy module for >> doing unit conversions, though. >> > > What if the constants were defined in SI, but let each constant derive from a > class or classes with methods that take care of conversion to other unit > systems. I was thinking of using gettable, but not settable, object > properties like si, cgs, emperial... Maybe the module could even be designed > such that the desired unit system is set as the default at module load time, > so the user could do "c=lightspeed" instead of "c=lightspeed.cgs". This would > still be compatible with further unit conversions, like "lightspeed/week". > > I remember trying to do conversion between electromagnetic units and SI, which > I was never quite able to wrap my head around. It would really be nice to > have unit conversion built in somehow. > > Darren > > It seems like the real thrust of this thread is to have a simple constants module(s), but the conversation has ballooned a bit into the (valid) need for a full-blown unit package. This has been don before in the Unum module mentioned as well as a units package (based on a fork of Michael Aivazis's units package) included with the Enthought Tool Suite ('ETS' -- which some folks may be surprised they already have installed if they're using a recent version of the Python Enthought Edition distro). The ETS units package could still use some work in it's handling of "unit families" (or 'measure-of') but it does provide all the functionality you're mentioning (conversion, unit systems). It's probably easier to show than to explain: C:\>python Python 2.3.5 - Enthought Edition 0.9.7 (#62, May 11 2005, 20:02:58) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from enthought.units.mass import * >>> from enthought.units.energy import * >>> from enthought.units.speed import * >>> mass = 1*kg >>> mass 1.0*kg >>> C = 299792458.0*meters_per_second # no constants included, (still guessing the right numbers) >>> C 299792458.0*m*s**-1 >>> E = mass*C**2 >>> E 89875517873681760.0*m**2*kg*s**-2 >>> joule # check to see if this is in Joules 1.0*m**2*kg*s**-2 These are obviously objects, though... >>> E.__class__ ...so you don't get the lightweight notion of simple floats assigned to symbols in the namespace as Travis O. was saying. Which begs the question of whether you really want the namespace mangling which comes from a "from constants import *" If I understand it right, I think I like Robert's dictionary idea. Travis _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user From R.Springuel at umit.maine.edu Wed May 31 15:18:41 2006 From: R.Springuel at umit.maine.edu (R. Padraic Springuel) Date: Wed, 31 May 2006 15:18:41 -0400 Subject: [SciPy-user] SciPy-user Digest, Vol 33, Issue 41 In-Reply-To: References: Message-ID: <447DEC11.8050700@umit.maine.edu> I've already created something similar. http://www.umit.maine.edu/~r.springuel/000CCFE8-80000018/S1EFF9C16.-1/scimath.py? It contains all the constants defined in the 77th edition of the CRC handbook in SI units (with a few exceptions). Constants are referenced both by long name (such as speed_of_light_in_vacuum) and their common abbreviation (c). Uncertainties are not included. The code is fairly well commented. -- R. Padraic Springuel Teaching Assistant Department of Physics and Astronomy University of Maine Bennett 214 Office Hours: Wednesday 3:00 - 4:00 pm; Friday 12:30 - 1:30 pm From ndcunliffe at gmail.com Wed May 31 16:24:20 2006 From: ndcunliffe at gmail.com (nicholas cunliffe) Date: Wed, 31 May 2006 22:24:20 +0200 Subject: [SciPy-user] Ipython Startup Message-ID: Hi I have installed IPyhon but cannot get it to start. When I invoke it a dos type window flashes up for a fraction of a second and then disapears. Does anyone have any suggestions? Python 2.4(207) IPython 0.6.15 Thanks N -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliphant.travis at ieee.org Wed May 31 17:43:36 2006 From: oliphant.travis at ieee.org (Travis Oliphant) Date: Wed, 31 May 2006 15:43:36 -0600 Subject: [SciPy-user] SciPy-user Digest, Vol 33, Issue 41 In-Reply-To: <447DEC11.8050700@umit.maine.edu> References: <447DEC11.8050700@umit.maine.edu> Message-ID: <447E0E08.2010100@ieee.org> R. Padraic Springuel wrote: > I've already created something similar. > > http://www.umit.maine.edu/~r.springuel/000CCFE8-80000018/S1EFF9C16.-1/scimath.py? > > It contains all the constants defined in the 77th edition of the CRC > handbook in SI units (with a few exceptions). Constants are referenced > both by long name (such as speed_of_light_in_vacuum) and their common > abbreviation (c). Uncertainties are not included. The code is fairly > well commented. > Perhaps you attached a link to the wrong file. The file you linked to looks like something from SciPy. -Travis From robert.kern at gmail.com Wed May 31 18:14:56 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 31 May 2006 17:14:56 -0500 Subject: [SciPy-user] Ipython Startup In-Reply-To: References: Message-ID: <447E1560.1000007@gmail.com> nicholas cunliffe wrote: > Hi > > I have installed IPyhon but cannot get it to start. When I invoke it a > dos type window flashes up for a fraction of a second and then > disapears. Does anyone have any suggestions? You will want to ask on ipython-user instead: http://scipy.net/mailman/listinfo/ipython-user -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From robert.kern at gmail.com Wed May 31 18:16:14 2006 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 31 May 2006 17:16:14 -0500 Subject: [SciPy-user] SciPy-user Digest, Vol 33, Issue 41 In-Reply-To: <447E0E08.2010100@ieee.org> References: <447DEC11.8050700@umit.maine.edu> <447E0E08.2010100@ieee.org> Message-ID: <447E15AE.8020801@gmail.com> Travis Oliphant wrote: > R. Padraic Springuel wrote: > >>I've already created something similar. >> >>http://www.umit.maine.edu/~r.springuel/000CCFE8-80000018/S1EFF9C16.-1/scimath.py? >> >>It contains all the constants defined in the 77th edition of the CRC >>handbook in SI units (with a few exceptions). Constants are referenced >>both by long name (such as speed_of_light_in_vacuum) and their common >>abbreviation (c). Uncertainties are not included. The code is fairly >>well commented. > > Perhaps you attached a link to the wrong file. The file you linked to > looks like something from SciPy. I believe he meant this: http://www.umit.maine.edu/~r.springuel/000CCFE8-80000018/S28ACBD32.-1/Constants.py?WasRead=1 -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From fperez.net at gmail.com Wed May 31 19:02:58 2006 From: fperez.net at gmail.com (Fernando Perez) Date: Wed, 31 May 2006 17:02:58 -0600 Subject: [SciPy-user] Ipython Startup In-Reply-To: <447E1560.1000007@gmail.com> References: <447E1560.1000007@gmail.com> Message-ID: On 5/31/06, Robert Kern wrote: > nicholas cunliffe wrote: > > Hi > > > > I have installed IPyhon but cannot get it to start. When I invoke it a > > dos type window flashes up for a fraction of a second and then > > disapears. Does anyone have any suggestions? > > You will want to ask on ipython-user instead: > > http://scipy.net/mailman/listinfo/ipython-user That's, true, but in the interest of helping a new user, here's a few hints. For further discussion, please continue on the ipython-user list, which I've cc-d on this reply to avoid polluting the scipy list further. Here goes: 1. You are using a very outdated ipython, please grab the current one from the site. 2. make sure you read and follow the full windows installation instructions: http://ipython.scipy.org/doc/manual/node2.html#SECTION00023000000000000000 They've proven to work out of the box for many users so far, so they make a good starting point. 3. AFTER you do 1 and 2, if the problem persists, try to open ipython from a regular dos terminal 'by hand'. I don't use windows myself, so I'm a bit fuzzy on the details, but the basic idea is to open a DOS terminal, then go to the folder where ipython itself is installed (I think it's typically something like C:\python24\scripts) and type c:\python24\???\python.exe ipython where the ??? means I don't really know the path to python itself on windows. This should run ipython and show you the relevant errors without closing the window. You can then paste them in an email and send that to the ipython user list, where we can help you further (other ipython developers do have windows experience, even if I don't). Cheers, f From aisaac at american.edu Wed May 31 22:57:27 2006 From: aisaac at american.edu (Alan G Isaac) Date: Wed, 31 May 2006 22:57:27 -0400 Subject: [SciPy-user] SciPy-user Digest, Vol 33, Issue 41 In-Reply-To: <447DEC11.8050700@umit.maine.edu> References: <447DEC11.8050700@umit.maine.edu> Message-ID: On Wed, 31 May 2006, "R. Padraic Springuel" apparently wrote: > I've already created something similar. No license ... Cheers, Alan Isaac