From M.Reimpell at tu-bs.de Fri Oct 1 07:24:11 2004 From: M.Reimpell at tu-bs.de (Michael Reimpell) Date: Fri, 1 Oct 2004 13:24:11 +0200 Subject: [SciPy-user] dead links on www.scipy.org Message-ID: <200410011324.11562.M.Reimpell@tu-bs.de> on: http://www.scipy.org/documentation/buildscipy.txt link: http://www.scipy.org/documentation/numarraydiscuss link: http://www.scipy.org/development/atlasbinaries/ Anyway, does someone provide a fedora apt repository for SciPy and its dependencies? Michael From narnett at mccmedia.com Fri Oct 1 10:38:04 2004 From: narnett at mccmedia.com (Nick Arnett) Date: Fri, 01 Oct 2004 07:38:04 -0700 Subject: [SciPy-user] Fixes to svd? Message-ID: <415D6BCC.2070306@mccmedia.com> In trying to use linalg.svd, I found that I had to make a couple of changes to decomp.py to get things to work... and I'm wondering if they were correct. This is my first stab at using Scipy. The first problem I hit was that Python didn't recognize the call to diag (part = diag(s)) in diagsvd. Looking around for where that seemed to live, I decided to add matrix_base to the scipy_base imports: from scipy_base import asarray_chkfinite, asarray, matrix_base ... and then changed the first line of diagsvd to: part = matrix_base.diag(s) That seems to work. Just below, also in diagsvd, Python didn't recognize "zeros", which I'm assuming it should be getting from Numeric... and although I'm certain that Scipy is supposed to use Numeric, I couldn't see where it was being imported in decomp, so I added: from Numeric import zeros Now things seem to be working and the matrix produced by diagsvd looks reasonable, though I haven't yet done any of the really big matrices I'll be processing. Any feedback on whether or not this was the appropriate way to fix things? Nick From swisher at enthought.com Fri Oct 1 10:45:45 2004 From: swisher at enthought.com (Janet Swisher) Date: Fri, 1 Oct 2004 09:45:45 -0500 Subject: [SciPy-user] dead links on www.scipy.org In-Reply-To: <200410011324.11562.M.Reimpell@tu-bs.de> Message-ID: <000c01c4a7c5$582fa590$9c01a8c0@SWISHER> Thanks for catching these. > -----Original Message----- > From: Michael Reimpell > > on: http://www.scipy.org/documentation/buildscipy.txt > link: http://www.scipy.org/documentation/numarraydiscuss Fixed to: http://www.scipy.org/documentation/numarraydiscuss.html > link: http://www.scipy.org/development/atlasbinaries/ Fixed to: http://www.scipy.org/download/atlasbinaries/ ------------------------- Janet Swisher Senior Technical Writer Enthought, Inc. 1-512-536-1057 From joe at enthought.com Sat Oct 2 17:04:06 2004 From: joe at enthought.com (Joe Cooper) Date: Sat, 02 Oct 2004 16:04:06 -0500 Subject: [SciPy-user] dead links on www.scipy.org In-Reply-To: <200410011324.11562.M.Reimpell@tu-bs.de> References: <200410011324.11562.M.Reimpell@tu-bs.de> Message-ID: <415F17C6.6020802@enthought.com> Michael Reimpell wrote: > Anyway, does someone provide a fedora apt repository for SciPy and its > dependencies? I've setup a yum repository, but it's still a bit iffy in spots (though it does work, and can be uninstalled cleanly if it doesn't work for you and you want to get rid of it). http://www.enthought.com/python/fedora/1/RPMS/ I expect it to get better soon. I've had a few offers from the community to assist with maintenance of the packages...so we'll see how things move with some more hands fixing packaging problems. From s.e.murdock at soton.ac.uk Mon Oct 4 07:23:26 2004 From: s.e.murdock at soton.ac.uk (Stuart Murdock) Date: Mon, 04 Oct 2004 12:23:26 +0100 Subject: [SciPy-user] Matrix square root Message-ID: <416132AE.4080509@soton.ac.uk> Hi I am trying to calculate the matrix square root (lets say B) of a Matrix (A) which is an array. A = array([[1,2],[3,4]]) such that A = matrixmultiply(B,B) are there any functions in SciPy to do that ? Thanks Stuart -- Stuart Murdock Ph.D, Research Fellow, Dept. of Chemistry / E-Science, University of Southampton, Highfield, Southampton, SO17 1BJ, United Kingdom http://www.biosimgrid.org From nwagner at mecha.uni-stuttgart.de Mon Oct 4 07:35:58 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon, 04 Oct 2004 13:35:58 +0200 Subject: [SciPy-user] Matrix square root In-Reply-To: <416132AE.4080509@soton.ac.uk> References: <416132AE.4080509@soton.ac.uk> Message-ID: <4161359E.8080403@mecha.uni-stuttgart.de> Stuart Murdock wrote: > Hi > > I am trying to calculate the matrix square root (lets say B) of a > Matrix (A) which is an array. > > A = array([[1,2],[3,4]]) > > such that > > A = matrixmultiply(B,B) > > are there any functions in SciPy to do that ? > > Thanks > > Stuart > AFAIK there is no direct support for sqrtm but you may use funm. >>> a = array(([1,2],[3,4])) >>> b = linalg.funm(a,sqrt) >>> b array([[ 0.55368857+0.46439416j, 0.80696073-0.21242648j], [ 1.21044109-0.31863972j, 1.76412966+0.14575444j]]) >>> dot(b,b)-a array([[ 2.22044605e-16 -3.19839641e-17j, 0.00000000e+00 -2.83518868e-17j], [ 4.44089210e-16 -1.06821019e-16j, 0.00000000e+00 -1.69677640e-17j]]) >>> HTH, Nils -- Dr.-Ing. Nils Wagner Institut A f?r Mechanik Universit?t Stuttgart Pfaffenwaldring 9 D-70550 Stuttgart Tel.: (+49) 0711 685 6262 Fax.: (+49) 0711 685 6282 E-mail: nwagner at mecha.uni-stuttgart.de URL : http://www.mecha.uni-stuttgart.de From nwagner at mecha.uni-stuttgart.de Mon Oct 4 07:44:38 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon, 04 Oct 2004 13:44:38 +0200 Subject: [SciPy-user] Matrix square root In-Reply-To: <4161359E.8080403@mecha.uni-stuttgart.de> References: <416132AE.4080509@soton.ac.uk> <4161359E.8080403@mecha.uni-stuttgart.de> Message-ID: <416137A6.6020806@mecha.uni-stuttgart.de> Nils Wagner wrote: > Stuart Murdock wrote: > >> Hi >> >> I am trying to calculate the matrix square root (lets say B) of a >> Matrix (A) which is an array. >> >> A = array([[1,2],[3,4]]) >> >> such that >> >> A = matrixmultiply(B,B) >> >> are there any functions in SciPy to do that ? >> >> Thanks >> >> Stuart >> > AFAIK there is no direct support for sqrtm but you may use funm. BTW, some algorithms for sqrtm can be found at http://www.ma.man.ac.uk/~higham/pap-mf.html This might be a starting point for an implementation of sqrtm in scipy. Any comments ? Nils > > >>> a = array(([1,2],[3,4])) > >>> b = linalg.funm(a,sqrt) > >>> b > array([[ 0.55368857+0.46439416j, 0.80696073-0.21242648j], > [ 1.21044109-0.31863972j, 1.76412966+0.14575444j]]) > >>> dot(b,b)-a > array([[ 2.22044605e-16 -3.19839641e-17j, 0.00000000e+00 > -2.83518868e-17j], > [ 4.44089210e-16 -1.06821019e-16j, 0.00000000e+00 > -1.69677640e-17j]]) > >>> > > HTH, > Nils > From pearu at scipy.org Mon Oct 4 08:31:16 2004 From: pearu at scipy.org (Pearu Peterson) Date: Mon, 4 Oct 2004 07:31:16 -0500 (CDT) Subject: [SciPy-user] Matrix square root In-Reply-To: <4161359E.8080403@mecha.uni-stuttgart.de> References: <416132AE.4080509@soton.ac.uk> <4161359E.8080403@mecha.uni-stuttgart.de> Message-ID: On Mon, 4 Oct 2004, Nils Wagner wrote: > AFAIK there is no direct support for sqrtm but you may use funm. I just discovered that there might be a bug in funm. I have added a test to scipy.linalg.test_matfuncs that demonstrates the bug. So, be aware to check the results of funm(..,sqrt). Pearu From nwagner at mecha.uni-stuttgart.de Mon Oct 4 08:33:28 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon, 04 Oct 2004 14:33:28 +0200 Subject: [SciPy-user] Matrix square root In-Reply-To: References: <416132AE.4080509@soton.ac.uk> <4161359E.8080403@mecha.uni-stuttgart.de> Message-ID: <41614318.3090106@mecha.uni-stuttgart.de> Pearu Peterson wrote: > > > On Mon, 4 Oct 2004, Nils Wagner wrote: > >> AFAIK there is no direct support for sqrtm but you may use funm. > > > I just discovered that there might be a bug in funm. I have added > a test to scipy.linalg.test_matfuncs that demonstrates the bug. > So, be aware to check the results of funm(..,sqrt). > That might give a reason to implement sqrtm seperately. What is your opinion ? Nils > Pearu > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From M.Reimpell at tu-bs.de Mon Oct 4 10:08:37 2004 From: M.Reimpell at tu-bs.de (Michael Reimpell) Date: Mon, 4 Oct 2004 16:08:37 +0200 Subject: [SciPy-user] RPM building trouble Message-ID: <200410041608.37593.M.Reimpell@tu-bs.de> There are some troubles building rpm packages: With the scipy CVS (2004-10-03) version, "python setup.py bdist_rpm --fix-python" fails, because the file "scipy_base/_compiled_base.c" contains two includes (e.g. _scipy_mapping.c), that do not handle the path correctly (therefore _scipy_mapping.c is not found). With the SciPy_complete-0.3.tar.gz version, "python setup.py bdist_rpm --fix-python" fails, because SciPy_complete-0.3/scipy_core/setup.py is missing. Also, in order to build a rpm package from scipy CVS, the scipy_distutils rpm has to be installed, but this package confilcts with the scipy rpm itself, afterwards. Also, recent versions of f2py fail completely building rpms with "python setup.py bdits_rpm --fix-python", because of path problems in setup.py (complains about missing 'src'-directory). This is a known issue at least since F2PY-2.39.235_1693. After installing scipy I stumbled across the following issues: Following the plotting tutorial on "http://www.scipy.org/documentation/plottutorial.html", I had to use gui_thread.start(use_main=1) instead of gui_thread.start(). Also plt.title('some text') fails with: "Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 144, in title _active.title.text = name AttributeError: 'instancemethod' object has no attribute 'text'". In general plotting seems to be a bit unstable: sometimes no window appears at first, but it works after restarting python and trying again. I also had a problem with the linalg module: linalg.norm(A,'fro') fails with "Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy/linalg/basic.py", line 273, in norm val = real((conjugate(x)*x).flat) NameError: global name 'real' is not defined", but linalg.norm(A,2) works without problems. Kind regards, Michael From pearu at scipy.org Mon Oct 4 11:40:09 2004 From: pearu at scipy.org (Pearu Peterson) Date: Mon, 4 Oct 2004 10:40:09 -0500 (CDT) Subject: [SciPy-user] RPM building trouble In-Reply-To: <200410041608.37593.M.Reimpell@tu-bs.de> References: <200410041608.37593.M.Reimpell@tu-bs.de> Message-ID: On Mon, 4 Oct 2004, Michael Reimpell wrote: > There are some troubles building rpm packages: > > With the scipy CVS (2004-10-03) version, > "python setup.py bdist_rpm --fix-python" > fails, because the file "scipy_base/_compiled_base.c" contains > two includes (e.g. _scipy_mapping.c), that do not handle the path correctly > (therefore _scipy_mapping.c is not found). Fixed in scipy CVS. Try python setup.py sdist -f bdist_rpm --fix-python in scipy_core directory. > With the SciPy_complete-0.3.tar.gz version, > "python setup.py bdist_rpm --fix-python" > fails, because SciPy_complete-0.3/scipy_core/setup.py is missing. You shouldn't use SciPy_complete tar-ball to build rpms. See below. > Also, in order to build a rpm package from scipy CVS, the scipy_distutils rpm > has to be installed, but this package confilcts with the scipy rpm itself, > afterwards. See http://www.scipy.org/development/packagescipy.txt In short, try the following 1) Install scipy_core needed by F2PY: cd cvs/scipy/scipy_core python setup.py sdist -f bdist_rpm --fix-python # install scipy_core rpm found in dist/ or # in build/bdist.linux-i686/rpm/RPMS/i386 2) Install F2PY needed to build scipy. 3) cd cvs/scipy #mv scipy_core scipy_core.hide # I had to do this in a redhat box # where distutils fails on bdist_rpm :( python setup.py sdist_packagers -f bdist_rpm --fix-python # install scipy rpm found in sdist or build/bdist.linux-i686/rpm/RPMS/i386 > Also, recent versions of f2py fail completely building rpms with > "python setup.py bdits_rpm --fix-python", because of path problems in setup.py > (complains about missing 'src'-directory). This is a known issue at least > since F2PY-2.39.235_1693. Hmm, just tried building F2PY-2.43.239_1835 rpms in Red Hat Linux release 9 (Shrike) and had no problems. So, try the latest version of F2PY. > After installing scipy I stumbled across the following issues: > > Following the plotting tutorial on > "http://www.scipy.org/documentation/plottutorial.html", > I had to use gui_thread.start(use_main=1) instead of gui_thread.start(). Also > plt.title('some text') fails with: > "Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 144, in > title > _active.title.text = name > AttributeError: 'instancemethod' object has no attribute 'text'". > In general plotting seems to be a bit unstable: sometimes no window appears at > first, but it works after restarting python and trying again. When use_main=1 then old hooks of gui_thread are used and these are unsupported. Try with gui_thread.start() and report any problems to this list. Of cource, it is assumed that you are using CVS version of scipy. I also get attribute error on plt.title('some text')... > I also had a problem with the linalg module: > linalg.norm(A,'fro') fails with > "Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.3/site-packages/scipy/linalg/basic.py", line 273, in > norm > val = real((conjugate(x)*x).flat) > NameError: global name 'real' is not defined", > but linalg.norm(A,2) works without problems. This is fixed in scipy CVS now. Thanks for feedback, Pearu From pearu at scipy.org Mon Oct 4 11:59:33 2004 From: pearu at scipy.org (Pearu Peterson) Date: Mon, 4 Oct 2004 10:59:33 -0500 (CDT) Subject: [SciPy-user] Matrix square root In-Reply-To: <41614318.3090106@mecha.uni-stuttgart.de> References: <416132AE.4080509@soton.ac.uk> <4161359E.8080403@mecha.uni-stuttgart.de> <41614318.3090106@mecha.uni-stuttgart.de> Message-ID: On Mon, 4 Oct 2004, Nils Wagner wrote: > Pearu Peterson wrote: >> On Mon, 4 Oct 2004, Nils Wagner wrote: >> >>> AFAIK there is no direct support for sqrtm but you may use funm. >> >> I just discovered that there might be a bug in funm. I have added >> a test to scipy.linalg.test_matfuncs that demonstrates the bug. >> So, be aware to check the results of funm(..,sqrt). >> > That might give a reason to implement sqrtm seperately. > What is your opinion ? The fact that funm is buggy does not give a good reason to implement sqrtm. The following tasks are independent: funm must be fixed and sqrtm must be implemented. Pearu From M.Reimpell at tu-bs.de Mon Oct 4 12:11:57 2004 From: M.Reimpell at tu-bs.de (Michael Reimpell) Date: Mon, 4 Oct 2004 18:11:57 +0200 Subject: [SciPy-user] RPM building trouble In-Reply-To: References: <200410041608.37593.M.Reimpell@tu-bs.de> Message-ID: <200410041811.57258.M.Reimpell@tu-bs.de> > See > http://www.scipy.org/development/packagescipy.txt The command: export CVSROOT=:pserver:anonymous at cens.ioc.ee:/home/cvs cvs -z7 co f2py2e produces: "cvs checkout: authorization failed: server cens.ioc.ee rejected access to /home/cvs for user anonymous cvs checkout: used empty password; try "cvs login" with a real password" According to their website, "http://cens.ioc.ee/projects/f2py2e/#cvs", the password is "guest". Remember, that the above lines will work, as long as your already checked in, e.g. through ssh. Kind regards, Michael From pearu at scipy.org Mon Oct 4 12:51:27 2004 From: pearu at scipy.org (Pearu Peterson) Date: Mon, 4 Oct 2004 11:51:27 -0500 (CDT) Subject: [SciPy-user] RPM building trouble In-Reply-To: <200410041811.57258.M.Reimpell@tu-bs.de> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410041811.57258.M.Reimpell@tu-bs.de> Message-ID: On Mon, 4 Oct 2004, Michael Reimpell wrote: >> See >> http://www.scipy.org/development/packagescipy.txt > > The command: > export CVSROOT=:pserver:anonymous at cens.ioc.ee:/home/cvs > cvs -z7 co f2py2e > produces: > "cvs checkout: authorization failed: server cens.ioc.ee rejected access > to /home/cvs for user anonymous > cvs checkout: used empty password; try "cvs login" with a real password" Ok, thanks. I have fixed the web page by adding cvs login # password is guest before the `cvs -z7 co f2py2e` command. > According to their website, "http://cens.ioc.ee/projects/f2py2e/#cvs", the > password is "guest". Remember, that the above lines will work, as long as > your already checked in, e.g. through ssh. Yes. Though f2py2e CVS uses pserver and ssh doesn't matter here. Pearu From M.Reimpell at tu-bs.de Tue Oct 5 02:56:28 2004 From: M.Reimpell at tu-bs.de (Michael Reimpell) Date: Tue, 5 Oct 2004 08:56:28 +0200 Subject: [SciPy-user] RPM building trouble In-Reply-To: References: <200410041608.37593.M.Reimpell@tu-bs.de> Message-ID: <200410050856.28197.M.Reimpell@tu-bs.de> > > Also, recent versions of f2py fail completely building rpms with > > "python setup.py bdits_rpm --fix-python", because of path problems in > > setup.py (complains about missing 'src'-directory). This is a known issue > > at least since F2PY-2.39.235_1693. > > Hmm, just tried building F2PY-2.43.239_1835 rpms in Red Hat Linux release > 9 (Shrike) and had no problems. So, try the latest version of F2PY. On fedora core 2 with f2py2e cvs from 2004-10-04, resp. F2PY-2.43.239_1835, python setup.py bdist_rpm --fix-python fails with output: + /usr/bin/python setup.py install --root=/var/tmp/F2PY-buildroot --record=INSTALLED_FILES F2PY Version 2.43.239_1835 Traceback (most recent call last): File "setup.py", line 131, in ? if 'install' in sys.argv and need_scipy_distutils(): File "setup.py", line 49, in need_scipy_distutils os.chdir('src') OSError: [Errno 2] No such file or directory: 'src' Error: Bad exit status from /var/tmp/rpm-tmp.28604 (%install) > When use_main=1 then old hooks of gui_thread are used and these are > unsupported. Try with gui_thread.start() and report any problems to this > list. Of cource, it is assumed that you are using CVS version of scipy. scipy CVS from 2004-10-04 from scipy import plt import gui_thread gui_thread.start() plt.plot((1,2,3)) fails with: Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 466, in plot validate_active() File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 57, in validate_active if _active is None: figure() File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 29, in figure _figure.append(plot_class(title=title)) File "/usr/lib/python2.3/site-packages/scipy/plt/wxplt.py", line 629, in __init__ wx.wxFrame.__init__(self, parent, id, title,pos,size) File "/usr/lib/python2.3/site-packages/wxPython/frames.py", line 151, in __init__ self.this = framesc.new_wxFrame(*_args,**_kwargs) File "", line 4, in new_wxFrame AttributeError: AttrHolder instance has no attribute 'result' using wxGTK-2.4.2-4.1.fc2.fr wxGTK2-2.4.2-0.fdr.2.2 wxGTK-common-2.4.2-0.fdr.2.2 wxGTK2-gl-2.4.2-0.fdr.2.2 Btw, scipy.test() fails with scipy CVS from 2004-10-04: ====================================================================== FAIL: check_bad (scipy.linalg.matfuncs.test_matfuncs.test_sqrtm) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/linalg/tests/test_matfuncs.py", line 102, in check_bad assert_array_almost_equal(dot(esa,esa),a) File "/usr/lib/python2.3/site-packages/scipy_test/testing.py", line 681, in assert_array_almost_equal assert cond,\ AssertionError: Arrays are not almost equal (mismatch 6.25%): Array 1: [[ 1. 0. 0. 0. ] [ 0. 0.03125 0. 0. ] [ 0. 0. 0.03125 0. ] [ ... Array 2: [[ 1. 0. 0. 1. ] [ 0. 0.03125 0. 0. ] [ 0. 0. 0.03125 0. ] [ ... ---------------------------------------------------------------------- Ran 944 tests in 2.290s FAILED (failures=1) Probably a typo. Kind regards, Michael From nwagner at mecha.uni-stuttgart.de Tue Oct 5 03:18:13 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 05 Oct 2004 09:18:13 +0200 Subject: [SciPy-user] RPM building trouble In-Reply-To: <200410050856.28197.M.Reimpell@tu-bs.de> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> Message-ID: <41624AB5.9030409@mecha.uni-stuttgart.de> Michael Reimpell wrote: >>>Also, recent versions of f2py fail completely building rpms with >>>"python setup.py bdits_rpm --fix-python", because of path problems in >>>setup.py (complains about missing 'src'-directory). This is a known issue >>>at least since F2PY-2.39.235_1693. >>> >>> >>Hmm, just tried building F2PY-2.43.239_1835 rpms in Red Hat Linux release >>9 (Shrike) and had no problems. So, try the latest version of F2PY. >> >> >On fedora core 2 with f2py2e cvs from 2004-10-04, resp. F2PY-2.43.239_1835, >python setup.py bdist_rpm --fix-python >fails with output: > >+ /usr/bin/python setup.py install --root=/var/tmp/F2PY-buildroot >--record=INSTALLED_FILES >F2PY Version 2.43.239_1835 >Traceback (most recent call last): > File "setup.py", line 131, in ? > if 'install' in sys.argv and need_scipy_distutils(): > File "setup.py", line 49, in need_scipy_distutils > os.chdir('src') >OSError: [Errno 2] No such file or directory: 'src' >Error: Bad exit status from /var/tmp/rpm-tmp.28604 (%install) > > > >>When use_main=1 then old hooks of gui_thread are used and these are >>unsupported. Try with gui_thread.start() and report any problems to this >>list. Of cource, it is assumed that you are using CVS version of scipy. >> >> > >scipy CVS from 2004-10-04 > > from scipy import plt > import gui_thread > gui_thread.start() > plt.plot((1,2,3)) > >fails with: > >Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 466, in >plot > validate_active() > File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 57, in >validate_active > if _active is None: figure() > File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 29, in >figure > _figure.append(plot_class(title=title)) > File "/usr/lib/python2.3/site-packages/scipy/plt/wxplt.py", line 629, in >__init__ > wx.wxFrame.__init__(self, parent, id, title,pos,size) > File "/usr/lib/python2.3/site-packages/wxPython/frames.py", line 151, in >__init__ > self.this = framesc.new_wxFrame(*_args,**_kwargs) > File "", line 4, in new_wxFrame >AttributeError: AttrHolder instance has no attribute 'result' > >using >wxGTK-2.4.2-4.1.fc2.fr >wxGTK2-2.4.2-0.fdr.2.2 >wxGTK-common-2.4.2-0.fdr.2.2 >wxGTK2-gl-2.4.2-0.fdr.2.2 > > >Btw, scipy.test() fails with scipy CVS from 2004-10-04: >====================================================================== >FAIL: check_bad (scipy.linalg.matfuncs.test_matfuncs.test_sqrtm) >---------------------------------------------------------------------- >Traceback (most recent call last): > File "/usr/lib/python2.3/site-packages/scipy/linalg/tests/test_matfuncs.py", >line 102, in check_bad > assert_array_almost_equal(dot(esa,esa),a) > File "/usr/lib/python2.3/site-packages/scipy_test/testing.py", line 681, in >assert_array_almost_equal > assert cond,\ >AssertionError: >Arrays are not almost equal (mismatch 6.25%): > Array 1: [[ 1. 0. 0. 0. ] > [ 0. 0.03125 0. 0. ] > [ 0. 0. 0.03125 0. ] > [ ... > Array 2: [[ 1. 0. 0. 1. ] > [ 0. 0.03125 0. 0. ] > [ 0. 0. 0.03125 0. ] > [ ... > > >---------------------------------------------------------------------- >Ran 944 tests in 2.290s > >FAILED (failures=1) > >Probably a typo. > > > It's not a typo, but a failure of funm(a,sqrt) see narep.py >Kind regards, >Michael > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > -- Dr.-Ing. Nils Wagner Institut A f?r Mechanik Universit?t Stuttgart Pfaffenwaldring 9 D-70550 Stuttgart Tel.: (+49) 0711 685 6262 Fax.: (+49) 0711 685 6282 E-mail: nwagner at mecha.uni-stuttgart.de URL : http://www.mecha.uni-stuttgart.de -------------- next part -------------- A non-text attachment was scrubbed... Name: narep.py Type: text/x-python Size: 350 bytes Desc: not available URL: From prabhu at aero.iitm.ernet.in Tue Oct 5 03:32:47 2004 From: prabhu at aero.iitm.ernet.in (Prabhu Ramachandran) Date: Tue, 5 Oct 2004 13:02:47 +0530 Subject: [SciPy-user] RPM building trouble In-Reply-To: <200410050856.28197.M.Reimpell@tu-bs.de> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> Message-ID: <16738.19999.871333.111905@monster.linux.in> >>>>> "MR" == Michael Reimpell writes: MR> from scipy import plt import gui_thread gui_thread.start() MR> plt.plot((1,2,3)) You should always import and start gui_thread before importing any other package that uses wxPython. But in this case that should not be a problem since plt does not import wxPython immediately. Could you please restart Python and try the same commands once again (immediately after it fails). It should work then. If it does not, please let the list know. Thanks. BTW, I am able to use gui_thread to run wxPython applications even from IDLE. I just tested with the complete wxPython demo and it runs fine from inside IDLE. cheers, prabhu From pearu at scipy.org Tue Oct 5 04:13:48 2004 From: pearu at scipy.org (Pearu Peterson) Date: Tue, 5 Oct 2004 03:13:48 -0500 (CDT) Subject: [SciPy-user] RPM building trouble In-Reply-To: <200410050856.28197.M.Reimpell@tu-bs.de> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> Message-ID: On Tue, 5 Oct 2004, Michael Reimpell wrote: > >>> Also, recent versions of f2py fail completely building rpms with >>> "python setup.py bdits_rpm --fix-python", because of path problems in >>> setup.py (complains about missing 'src'-directory). This is a known issue >>> at least since F2PY-2.39.235_1693. >> >> Hmm, just tried building F2PY-2.43.239_1835 rpms in Red Hat Linux release >> 9 (Shrike) and had no problems. So, try the latest version of F2PY. > On fedora core 2 with f2py2e cvs from 2004-10-04, resp. F2PY-2.43.239_1835, > python setup.py bdist_rpm --fix-python > fails with output: > > + /usr/bin/python setup.py install --root=/var/tmp/F2PY-buildroot > --record=INSTALLED_FILES > F2PY Version 2.43.239_1835 > Traceback (most recent call last): > File "setup.py", line 131, in ? > if 'install' in sys.argv and need_scipy_distutils(): > File "setup.py", line 49, in need_scipy_distutils > os.chdir('src') > OSError: [Errno 2] No such file or directory: 'src' > Error: Bad exit status from /var/tmp/rpm-tmp.28604 (%install) Sorry, I wasn't clear enough: to avoid the above error, use F2PY-2.43.239_1835 or higher. >> When use_main=1 then old hooks of gui_thread are used and these are >> unsupported. Try with gui_thread.start() and report any problems to this >> list. Of cource, it is assumed that you are using CVS version of scipy. > > scipy CVS from 2004-10-04 > > from scipy import plt > import gui_thread > gui_thread.start() > plt.plot((1,2,3)) Try the following commands from a fresh Python prompt: import gui_thread gui_thread.start() from scipy import plt plt.plot((1,2,3)) Hmm, I thought gui_thread would warn if there have been wx imported before gui_thread.start(). Now that I try it, also from scipy import plt import gui_thread gui_thread.start() plt.plot((1,2,3)) works fine here. > Btw, scipy.test() fails with scipy CVS from 2004-10-04: > ====================================================================== > FAIL: check_bad (scipy.linalg.matfuncs.test_matfuncs.test_sqrtm) .. > Probably a typo. Nope, its a bug. Pearu From prabhu at aero.iitm.ernet.in Tue Oct 5 04:38:03 2004 From: prabhu at aero.iitm.ernet.in (Prabhu Ramachandran) Date: Tue, 5 Oct 2004 14:08:03 +0530 Subject: [SciPy-user] RPM building trouble In-Reply-To: References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> Message-ID: <16738.23915.141839.647387@monster.linux.in> >>>>> "PP" == Pearu Peterson writes: PP> On Tue, 5 Oct 2004, Michael Reimpell wrote: [snip] PP> from scipy import plt import gui_thread gui_thread.start() PP> plt.plot((1,2,3)) PP> works fine here. Yes, I am not sure why but plt does not import wxPython till plt.plot is called. I checked sys.modules and wx is not to be seen. In [1]: from scipy import plt In [2]: import sys In [3]: [x for x in sys.modules.keys() if x.find('wx') > -1] Out[3]: [] I guess its the special import stuff thats causing this? cheers, prabhu From pearu at scipy.org Tue Oct 5 05:17:00 2004 From: pearu at scipy.org (Pearu Peterson) Date: Tue, 5 Oct 2004 04:17:00 -0500 (CDT) Subject: [SciPy-user] RPM building trouble In-Reply-To: <16738.23915.141839.647387@monster.linux.in> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> <16738.23915.141839.647387@monster.linux.in> Message-ID: On Tue, 5 Oct 2004, Prabhu Ramachandran wrote: >>>>>> "PP" == Pearu Peterson writes: > > PP> On Tue, 5 Oct 2004, Michael Reimpell wrote: > > [snip] > PP> from scipy import plt import gui_thread gui_thread.start() > PP> plt.plot((1,2,3)) > > PP> works fine here. > > Yes, I am not sure why but plt does not import wxPython till plt.plot > is called. I checked sys.modules and wx is not to be seen. > > In [1]: from scipy import plt > In [2]: import sys > In [3]: [x for x in sys.modules.keys() if x.find('wx') > -1] > Out[3]: [] > > I guess its the special import stuff thats causing this? Yes, notice that importing plt has been postponed: In [4]: repr(plt) Out[4]: "" and once ipython is trying to access plt, wxPython will be imported: In [5]: plt Out[5]: In [6]: len([x for x in sys.modules.keys() if x.find('wx') > -1]) Out[6]: 53 Pearu From M.Reimpell at tu-bs.de Tue Oct 5 04:58:25 2004 From: M.Reimpell at tu-bs.de (Michael Reimpell) Date: Tue, 5 Oct 2004 10:58:25 +0200 Subject: [SciPy-user] RPM building trouble In-Reply-To: References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> Message-ID: <200410051058.25916.M.Reimpell@tu-bs.de> > > On fedora core 2 with f2py2e cvs from 2004-10-04, resp. > > F2PY-2.43.239_1835, python setup.py bdist_rpm --fix-python > > fails with output: > Sorry, I wasn't clear enough: to avoid the above error, use > F2PY-2.43.239_1835 or higher. It seems to be a problem with rpm. On another (more updated) fedora core 2 system I managed to build the F2PY rpm from cvs checkout (2004-10-05) without any problems. Also, the Scipy_core rpm is build correctly, however the files Scipy_core-0.3.1_132.2180-1.i386.rpm and Scipy_core-debuginfo-0.3.1_132.2180-1.i386.rpm are not moved from build/bdist.linux-i686/rpm/RPMS/i386/ to the dist/ directory The same problems occurs with building SciPy, which even fails with an AssertionError: moving build/bdist.linux-i686/rpm/SRPMS/SciPy-0.3.1_285.4292-1.src.rpm -> dist Traceback (most recent call last): File "setup.py", line 112, in ? setup_package(ignore_packages) File "setup.py", line 99, in setup_package url = "http://www.scipy.org", File "/usr/lib/python2.3/site-packages/scipy_distutils/core.py", line 73, in setup return old_setup(**new_attr) File "/usr/src/build/394694-i386/install/usr/lib/python2.3/distutils/core.py", line 149, in setup File "/usr/src/build/394694-i386/install/usr/lib/python2.3/distutils/dist.py", line 907, in run_commands File "/usr/src/build/394694-i386/install/usr/lib/python2.3/distutils/dist.py", line 927, in run_command File "/usr/src/build/394694-i386/install/usr/lib/python2.3/distutils/command/bdist_rpm.py", line 316, in run AssertionError: unexpected number of RPM files found: ['build/bdist.linux-i686/rpm/RPMS/i386/SciPy-0.3.1_285.4292-1.i386.rpm', 'build/bdist.linux-i686/rpm/RPMS/i386/SciPy-debuginfo-0.3.1_285.4292-1.i386.rpm'] Building the debuginfo rpm is default behaviour in fedora core 2. Kind regards, Michael Installed rpm versions: rpm-4.3.1-0.3_27.rhfc2.at rpm-python-4.3.1-0.3_27.rhfc2.at rpm-build-4.3.1-0.3_27.rhfc2.at rpm-devel-4.3.1-0.3_27.rhfc2.at From M.Reimpell at tu-bs.de Tue Oct 5 05:11:19 2004 From: M.Reimpell at tu-bs.de (Michael Reimpell) Date: Tue, 5 Oct 2004 11:11:19 +0200 Subject: [SciPy-user] RPM building trouble In-Reply-To: References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> Message-ID: <200410051111.19217.M.Reimpell@tu-bs.de> > Try the following commands from a fresh Python prompt: > > import gui_thread > gui_thread.start() > from scipy import plt > plt.plot((1,2,3)) SciPy-0.3.1_285.4292]$ python Python 2.3.3 (#1, May 7 2004, 10:31:40) [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gui_thread >>> gui_thread.start() >>> from scipy import plt >>> plt.plot((1,2,3)) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 466, in plot validate_active() File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 57, in validate_active if _active is None: figure() File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 29, in figure _figure.append(plot_class(title=title)) File "/usr/lib/python2.3/site-packages/scipy/plt/wxplt.py", line 629, in __init__ wx.wxFrame.__init__(self, parent, id, title,pos,size) File "/usr/lib/python2.3/site-packages/wxPython/frames.py", line 151, in __init__ self.this = framesc.new_wxFrame(*_args,**_kwargs) File "", line 4, in new_wxFrame AttributeError: AttrHolder instance has no attribute 'result' with the following fedora core 2 versions of wxWindows: wxGTK-common-2.4.2-0.fdr.2.2 wxGTK2-stc-2.4.2-0.fdr.2.2 wxGTK2-2.4.2-0.fdr.2.2 wxGTK2-xrc-2.4.2-0.fdr.2.2 wxGTK2-gl-2.4.2-0.fdr.2.2 wxPythonGTK2-2.4.2.4-0.fdr.3.2 Kind regards, Michael From M.Reimpell at tu-bs.de Tue Oct 5 05:24:12 2004 From: M.Reimpell at tu-bs.de (Michael Reimpell) Date: Tue, 5 Oct 2004 11:24:12 +0200 Subject: [SciPy-user] RPM building trouble In-Reply-To: <16738.19999.871333.111905@monster.linux.in> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> <16738.19999.871333.111905@monster.linux.in> Message-ID: <200410051124.12168.M.Reimpell@tu-bs.de> > MR> from scipy import plt import gui_thread gui_thread.start() > MR> plt.plot((1,2,3)) > Could you please restart Python and try the same commands once again > (immediately after it fails). It should work then. If it does not, > please let the list know. Thanks. It does not work even when I restart Python and try again. Also, if I don't restart Python and try again, python segfaults. My problem seems to be related to the LANG shell variable: $ echo $LANG de_DE at euro $ python Python 2.3.3 (#1, May 7 2004, 10:31:40) [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gui_thread >>> gui_thread.start() >>> from scipy import plt >>> plt.plot((1,2,3)) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 466, in plot validate_active() File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 57, in validate_active if _active is None: figure() File "/usr/lib/python2.3/site-packages/scipy/plt/interface.py", line 29, in figure _figure.append(plot_class(title=title)) File "/usr/lib/python2.3/site-packages/scipy/plt/wxplt.py", line 629, in __init__ wx.wxFrame.__init__(self, parent, id, title,pos,size) File "/usr/lib/python2.3/site-packages/wxPython/frames.py", line 151, in __init__ self.this = framesc.new_wxFrame(*_args,**_kwargs) File "", line 4, in new_wxFrame AttributeError: AttrHolder instance has no attribute 'result' >>> plt.plot((1,2,3)) Speicherzugriffsfehler but with $ LANG=C python Python 2.3.3 (#1, May 7 2004, 10:31:40) [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import gui_thread >>> gui_thread.start() >>> from scipy import plt >>> plt.plot((1,2,3)) The plotting window appears as expected. Kind regards, Michael From oliphant at ee.byu.edu Tue Oct 5 05:26:52 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 05 Oct 2004 03:26:52 -0600 Subject: [SciPy-user] Matrix square root In-Reply-To: References: <416132AE.4080509@soton.ac.uk> <4161359E.8080403@mecha.uni-stuttgart.de> Message-ID: <416268DC.3060804@ee.byu.edu> Pearu Peterson wrote: > > > On Mon, 4 Oct 2004, Nils Wagner wrote: > >> AFAIK there is no direct support for sqrtm but you may use funm. > > > I just discovered that there might be a bug in funm. I have added > a test to scipy.linalg.test_matfuncs that demonstrates the bug. > So, be aware to check the results of funm(..,sqrt). As far as I undertand, the idea of a general purpose matrix function has precision problems. The algorithm in scipy is based on a published algorithm using the Schur decomposition. That is why it is usually a good idea to write separate algorithms for special matrix functions if possible. Is this really a bug, or just a problem with using the generic funm algorithm when a more accurate algorithm exists. The fact that you can return a reasonable square root for non-special matrices makes me believe that it is not a bug in funm, but a demonstration that the generic funm algorithm does not always produce the best results for specific functions of matrices. -Travis O. From nwagner at mecha.uni-stuttgart.de Tue Oct 5 07:45:05 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 05 Oct 2004 13:45:05 +0200 Subject: [SciPy-user] sqrtm Message-ID: <41628941.6060103@mecha.uni-stuttgart.de> Hi all, An entry for sqrtm in help (linalg) is missing. matrix Functions: expm --- matrix exponential using Pade approx. expm2 --- matrix exponential using Eigenvalue decomp. expm3 --- matrix exponential using Taylor-series expansion logm --- matrix logarithm cosm --- matrix cosine sinm --- matrix sine tanm --- matrix tangent coshm --- matrix hyperbolic cosine sinhm --- matrix hyperbolic sine tanhm --- matrix hyperbolic tangent signm --- matrix sign funm --- Evaluating an arbitrary matrix function. help(linalg.sqrtm) yields Help on function sqrtm in module scipy.linalg.matfuncs: sqrtm(A, disp=1) Matrix square root If disp is non-zero display warning if singular matrix. If disp is zero then return residual ||A-X*X||_F / ||A||_F Uses algorithm by Nicholas J. Higham How about help (linalg.iterative) help (linalg.iterative.*) where * = cg,cgs, qmr, gmres, bicg, bicgstab is already available. Nils From nwagner at mecha.uni-stuttgart.de Tue Oct 5 09:37:31 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 05 Oct 2004 15:37:31 +0200 Subject: [SciPy-user] from scipy.xplt import * failed Message-ID: <4162A39B.1010508@mecha.uni-stuttgart.de> in version '0.3.1_285.4312' Python 2.3.3 (#1, Apr 6 2004, 01:47:39) [GCC 3.3.3 (SuSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from scipy.xplt import * Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 303, in __getattr__ module = self._ppimport_importer() File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 262, in _ppimport_importer raise PPImportError,\ scipy_base.ppimport.PPImportError: Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 273, in _ppimport_importer module = __import__(name,None,None,['*']) File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", line 12, in ? from Mplot import * File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line 1015, in ? import colorbar File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", line 9, in ? from slice3 import * File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1581, in ? _poly_permutations4 = _construct3 (0) File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, in _construct3 mask = find_mask (below, _node_edges3 [itype]) TypeError: Array can not be safely cast to required type Nils From oliphant at ee.byu.edu Tue Oct 5 13:51:07 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 05 Oct 2004 11:51:07 -0600 Subject: [SciPy-user] from scipy.xplt import * failed In-Reply-To: <4162A39B.1010508@mecha.uni-stuttgart.de> References: <4162A39B.1010508@mecha.uni-stuttgart.de> Message-ID: <4162DF0B.1060105@ee.byu.edu> Nils Wagner wrote: > in version '0.3.1_285.4312' > > Python 2.3.3 (#1, Apr 6 2004, 01:47:39) > [GCC 3.3.3 (SuSE Linux)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>> from scipy.xplt import * >>> > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line > 303, in __getattr__ > module = self._ppimport_importer() > File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line > 262, in _ppimport_importer > raise PPImportError,\ > scipy_base.ppimport.PPImportError: Traceback (most recent call last): > File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line > 273, in _ppimport_importer > module = __import__(name,None,None,['*']) > File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", line > 12, in ? > from Mplot import * > File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line > 1015, in ? > import colorbar > File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", line > 9, in ? > from slice3 import * > File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line > 1581, in ? > _poly_permutations4 = _construct3 (0) > File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line > 1575, in _construct3 > mask = find_mask (below, _node_edges3 [itype]) > TypeError: Array can not be safely cast to required type > > This was fixed. I'm using 0.3.1_287.4322 without this problem. -Travis From prabhu at aero.iitm.ernet.in Tue Oct 5 13:52:21 2004 From: prabhu at aero.iitm.ernet.in (Prabhu Ramachandran) Date: Tue, 5 Oct 2004 23:22:21 +0530 Subject: [SciPy-user] RPM building trouble In-Reply-To: <200410051124.12168.M.Reimpell@tu-bs.de> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> <16738.19999.871333.111905@monster.linux.in> <200410051124.12168.M.Reimpell@tu-bs.de> Message-ID: <16738.57173.917046.703289@monster.linux.in> >>>>> "MR" == Michael Reimpell writes: MR> from scipy import plt import gui_thread gui_thread.start() MR> plt.plot((1,2,3)) >> Could you please restart Python and try the same commands once >> again (immediately after it fails). It should work then. If >> it does not, please let the list know. Thanks. MR> It does not work even when I restart Python and try MR> again. Also, if I don't restart Python and try again, python MR> segfaults. [...] MR> My problem seems to be related to the LANG shell variable: I am not sure what we can do to fix the problem in this case. I don't really understand why changing the LANG environment should affect the functioning of Python. So if someone has a suggestion please let the list know. cheers, prabhu From Fernando.Perez at colorado.edu Tue Oct 5 13:59:13 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Tue, 05 Oct 2004 11:59:13 -0600 Subject: [SciPy-user] RPM building trouble In-Reply-To: <16738.57173.917046.703289@monster.linux.in> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> <16738.19999.871333.111905@monster.linux.in> <200410051124.12168.M.Reimpell@tu-bs.de> <16738.57173.917046.703289@monster.linux.in> Message-ID: <4162E0F1.4000808@colorado.edu> Prabhu Ramachandran schrieb: >>>>>>"MR" == Michael Reimpell writes: > > > MR> from scipy import plt import gui_thread gui_thread.start() > MR> plt.plot((1,2,3)) > > >> Could you please restart Python and try the same commands once > >> again (immediately after it fails). It should work then. If > >> it does not, please let the list know. Thanks. > > MR> It does not work even when I restart Python and try > MR> again. Also, if I don't restart Python and try again, python > MR> segfaults. > [...] > MR> My problem seems to be related to the LANG shell variable: > > I am not sure what we can do to fix the problem in this case. I don't > really understand why changing the LANG environment should affect the > functioning of Python. So if someone has a suggestion please let the > list know. Wow. This was also the source of my problems. I'm learning german, so I've switched my desktop to planck[~]> echo $LANG de_DE.UTF-8 After setting it back to planck[~]> echo $LANG en_US.UTF-8 Both the simpleFrame and the WxDemo examples run just fine, and the errors I reported just a few minutes ago are gone. Now, as to why in hell this should matter, I have no idea. And I think it's bad: we can't exactly force users from all over the world to reset their desktops to US English, can we ? Best, f From prabhu at aero.iitm.ernet.in Tue Oct 5 14:07:26 2004 From: prabhu at aero.iitm.ernet.in (Prabhu Ramachandran) Date: Tue, 5 Oct 2004 23:37:26 +0530 Subject: [SciPy-user] RPM building trouble In-Reply-To: <4162E0F1.4000808@colorado.edu> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> <16738.19999.871333.111905@monster.linux.in> <200410051124.12168.M.Reimpell@tu-bs.de> <16738.57173.917046.703289@monster.linux.in> <4162E0F1.4000808@colorado.edu> Message-ID: <16738.58078.359300.23164@monster.linux.in> >>>>> "FP" == Fernando Perez writes: >> I am not sure what we can do to fix the problem in this case. >> I don't really understand why changing the LANG environment >> should affect the functioning of Python. So if someone has a >> suggestion please let the list know. FP> Wow. This was also the source of my problems. I'm learning FP> german, so I've switched my desktop to [...] FP> Both the simpleFrame and the WxDemo examples run just fine, FP> and the errors I reported just a few minutes ago are gone. Great! FP> Now, as to why in hell this should matter, I have no idea. FP> And I think it's bad: we can't exactly force users from all FP> over the world to reset their desktops to US English, can we ? I suspect this is a Redhat-ism. Maybe not but could be. There are reports of some users needing to do this to use Acrobat reader also. Anyway, could you please just try replacing the string in the wxPython_thread.py wrap_builtinfunction(func, call_holder) func_tmpl = """\... with func_tmpl = r"""\...""" That is make it a raw string and see if that helps? Also, in the same long string, change the call_holder.call('call_holder.result=old_func(*args,**kws)') to use a raw string. This is a shot in the dark but the only one that makes any sense (to my limited knowledge) to try. cheers, prabhu From Fernando.Perez at colorado.edu Tue Oct 5 14:22:29 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Tue, 05 Oct 2004 12:22:29 -0600 Subject: [SciPy-user] RPM building trouble In-Reply-To: <16738.58078.359300.23164@monster.linux.in> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> <16738.19999.871333.111905@monster.linux.in> <200410051124.12168.M.Reimpell@tu-bs.de> <16738.57173.917046.703289@monster.linux.in> <4162E0F1.4000808@colorado.edu> <16738.58078.359300.23164@monster.linux.in> Message-ID: <4162E665.2000708@colorado.edu> Prabhu Ramachandran schrieb: >>>>>>"FP" == Fernando Perez writes: > > > >> I am not sure what we can do to fix the problem in this case. > >> I don't really understand why changing the LANG environment > >> should affect the functioning of Python. So if someone has a > >> suggestion please let the list know. > > FP> Wow. This was also the source of my problems. I'm learning > FP> german, so I've switched my desktop to > [...] > FP> Both the simpleFrame and the WxDemo examples run just fine, > FP> and the errors I reported just a few minutes ago are gone. > > Great! > > FP> Now, as to why in hell this should matter, I have no idea. > FP> And I think it's bad: we can't exactly force users from all > FP> over the world to reset their desktops to US English, can we ? > > I suspect this is a Redhat-ism. Maybe not but could be. There are > reports of some users needing to do this to use Acrobat reader also. That's a sligthly different problem, I think. Acroread crashes in UTF-8 locales, but I think that one is an Acroread bug. Yesterday I also discovered that Mathematica won't even start (it dies with weird errors) with my de_DE.UTF-8 LANG also. So it seems like quite a bit of software out there is written with pretty hard assumptions about what LANG is :( > Anyway, could you please just try replacing the string in > the wxPython_thread.py wrap_builtinfunction(func, call_holder) > > func_tmpl = """\... > > with func_tmpl = r"""\...""" > > That is make it a raw string and see if that helps? Also, in the same > long string, change the > call_holder.call('call_holder.result=old_func(*args,**kws)') to use a > raw string. > > This is a shot in the dark but the only one that makes any sense (to > my limited knowledge) to try. Nope, no improvement. Best, f From pearu at scipy.org Tue Oct 5 15:35:05 2004 From: pearu at scipy.org (Pearu Peterson) Date: Tue, 5 Oct 2004 14:35:05 -0500 (CDT) Subject: [SciPy-user] RPM building trouble In-Reply-To: <16738.57173.917046.703289@monster.linux.in> References: <200410041608.37593.M.Reimpell@tu-bs.de> <200410050856.28197.M.Reimpell@tu-bs.de> <200410051124.12168.M.Reimpell@tu-bs.de> <16738.57173.917046.703289@monster.linux.in> Message-ID: On Tue, 5 Oct 2004, Prabhu Ramachandran wrote: > MR> My problem seems to be related to the LANG shell variable: > > I am not sure what we can do to fix the problem in this case. I don't > really understand why changing the LANG environment should affect the > functioning of Python. So if someone has a suggestion please let the > list know. May be LANG affects wxPython somehow. Anyway, one solution would be to set LANG=C or unset it in gui_thread.start() before any wx imports. See os.environ. Just an idea.. Pearu From david.grant at telus.net Tue Oct 5 17:00:09 2004 From: david.grant at telus.net (David Grant) Date: Tue, 05 Oct 2004 14:00:09 -0700 Subject: [SciPy-user] symeig Message-ID: <41630B59.3020500@telus.net> Would it be possible to add something like symeig to scipy? -------- Original Message -------- Subject: Re: [SciPy-user] First few eigenvectors of a numarray array Date: Fri, 3 Sep 2004 17:07:06 +0200 (CEST) From: p.berkes at biologie.hu-berlin.de Reply-To: SciPy Users List To: SciPy Users List Hi Stuart, in fact MDP contains a function (mdp.utils.symeig), which provides an interface to some LAPACK routines that are able to compute only the first eigenvectors of a matrix, given that it is symmetrical positive definite (which should be the case, since you're doing PCA). Pietro. On Fri, 3 Sep 2004, Gary Ruben wrote: > Hi Stuart, > > It may well not be relevant to your needs, but since you mentioned you were doing PCA, you might want to look at the MDP package which was announced on this list a few days ago. > http://mdp-toolkit.sourceforge.net/ > > Gary > > ----- Original Message ----- > From: Stuart Murdock > Date: Thu, 02 Sep 2004 19:50:57 +0000 > To: SciPy Users List > Subject: Re: [SciPy-user] First few eigenvectors of a numarray array > > > Hi Dave > > > > David Grant wrote: > > > > > When you say "top 10" do you mean the eigenvalues with the largest or > > > smallest values? > > > > > > > Primarily I would be concerned with the eigenvectors associated with the > > largest eigenvalues as presently > > I am interested in Principal Component Analysis of biomolecular > > simulation trajectories. There are ways to approximate > > the top eigenvector / eigenvalue, then get the next and so on but I was > > wondering if there were any packages with those > > types of algorithms already implemented. > > > > Thanks > > > > Stuart > > > > > I would also be interested in knowing if there is any mathematical way > > > of doing this. Sometimes for example in molecular simulations you > > > only want to calculate the ground state energy, for example, and you > > > don't care about the rest... > > > > > > Dave > > > > > > > > > Stuart Murdock wrote: > > > > > >> Hi > > >> > > >> I have a 10000 by 10000 square numarray array which I have obtained > > >> using numarray. I need to obtain the first 10 eigenvalues and > > >> eigenvectors of this so I dont want to have to calculate all > > >> eigenvectors of the matrix. Is anyone aware of any pythonic packages > > >> which > > >> can calculate, lets say, the 10 eigenvectors corresponding to the top > > >> 10 eigenvalues of a numarray array. > > >> > > >> There are a few functions which calculate all of the eigenvectors e.g. > > >> > > >> eig > > >> eigenvectors > > >> > > >> but I only want to calculate the top few. > > >> > > >> Thanks > > >> > > >> Stuart > > >> > > > > > > > > >_______________________________________________ > > >SciPy-user mailing list > > >SciPy-user at scipy.net > > >http://www.scipy.net/mailman/listinfo/scipy-user > > > > > > > > > > > > -- > > > > Stuart Murdock Ph.D, > > Research Fellow, > > Dept. of Chemistry / E-Science, > > University of Southampton, > > Highfield, Southampton, > > SO17 1BJ, United Kingdom > > > > http://www.biosimgrid.org > > > > > > > > _______________________________________________ > > 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 -- David J. Grant Get Firefox! -------------- next part -------------- A non-text attachment was scrubbed... Name: david.grant.vcf Type: text/x-vcard Size: 200 bytes Desc: not available URL: From david.grant at telus.net Tue Oct 5 17:26:07 2004 From: david.grant at telus.net (David Grant) Date: Tue, 05 Oct 2004 14:26:07 -0700 Subject: [SciPy-user] scipy snapshots Message-ID: <4163116F.7050809@telus.net> Does anyone build more recent snapshots of scipy for python 2.3 in Windows? I'd really like to get one since mdp-toolkit requires a more recent version than 0.3 Thanks, David -- David J. Grant Get Firefox! -------------- next part -------------- A non-text attachment was scrubbed... Name: david.grant.vcf Type: text/x-vcard Size: 200 bytes Desc: not available URL: From oliphant at ee.byu.edu Wed Oct 6 00:51:11 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 05 Oct 2004 22:51:11 -0600 Subject: [SciPy-user] scipy snapshots In-Reply-To: <4163116F.7050809@telus.net> References: <4163116F.7050809@telus.net> Message-ID: <416379BF.9050100@ee.byu.edu> David Grant wrote: > Does anyone build more recent snapshots of scipy for python 2.3 in > Windows? I'd really like to get one since mdp-toolkit requires a more > recent version than 0.3 I just built a windows binary from the current CVS and placed it at http://www.scipy.org/download/scipy/win32/SciPy_complete-0.3.1_287.4324.win32-py2.3.exe -Travis O. From david.grant at telus.net Wed Oct 6 01:39:59 2004 From: david.grant at telus.net (David Grant) Date: Tue, 05 Oct 2004 22:39:59 -0700 Subject: [SciPy-user] scipy snapshots In-Reply-To: <416379BF.9050100@ee.byu.edu> References: <4163116F.7050809@telus.net> <416379BF.9050100@ee.byu.edu> Message-ID: <4163852F.4090102@telus.net> Travis Oliphant wrote: > David Grant wrote: > >> Does anyone build more recent snapshots of scipy for python 2.3 in >> Windows? I'd really like to get one since mdp-toolkit requires a >> more recent version than 0.3 > > > I just built a windows binary from the current CVS and placed it at > > http://www.scipy.org/download/scipy/win32/SciPy_complete-0.3.1_287.4324.win32-py2.3.exe > > Did you do that just for me? If so, thanks a lot! Well, thanks a lot regardless. I can't WAIT to try out symeig from MDP-tookit tomorrow. I wonder if it will be any better than Heigenvalues or Heigenvectors from the Numeric class which I just discovered today. Well I think MDP uses fortran code for this, they call some LAPACK function, so hopefully it is faster! Dave -- David J. Grant Get Firefox! -------------- next part -------------- A non-text attachment was scrubbed... Name: david.grant.vcf Type: text/x-vcard Size: 200 bytes Desc: not available URL: From nwagner at mecha.uni-stuttgart.de Wed Oct 6 03:22:56 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 06 Oct 2004 09:22:56 +0200 Subject: [SciPy-user] Matrix Structure Plots in scipy ? Message-ID: <41639D50.6070209@mecha.uni-stuttgart.de> Hi all, First of all I would like to thank Pearu for implementing Matrix Market I/O support ! The number of outputs is more than described in help (io.mmio) mmread(source) Reads the contents of the Matrix Market file 'filename' into the matrix 'A'. Inputs: source - Matrix Market filename (extension .mtx) or open file object. Outputs: a - sparse or full matrix Actually b,m,n,s = mmread('young1c') should be used. Is it possible to generate matrix structure plots in scipy ? http://math.nist.gov/MatrixMarket/structureplots.html BTW, there is another "important" matrix format namely matrices generated by NASTRAN (commercial Finite Element program).There exists already a tool that can read and write both dense and sparse matrices, either real or complex, either little or big endian, and either text (any precision) or binary. You can find the code by downloading http://savannah.nongnu.org/cgi-bin/viewcvs/tops/tops/usr/extra/op4tools/ Pearu, please can you manage the support of this format in scipy too ? I believe devoutly, that many users will appreciate this feature. Thanks in advance Nils From s.e.murdock at soton.ac.uk Wed Oct 6 05:06:04 2004 From: s.e.murdock at soton.ac.uk (Stuart Murdock) Date: Wed, 06 Oct 2004 10:06:04 +0100 Subject: [SciPy-user] symeig In-Reply-To: <41630B59.3020500@telus.net> References: <41630B59.3020500@telus.net> Message-ID: <4163B57C.2020606@soton.ac.uk> Hi David Grant wrote: > Would it be possible to add something like symeig to scipy? > -------- Original Message -------- > Subject: Re: [SciPy-user] First few eigenvectors of a numarray array > Date: Fri, 3 Sep 2004 17:07:06 +0200 (CEST) > From: p.berkes at biologie.hu-berlin.de > Reply-To: SciPy Users List > To: SciPy Users List > > > > Hi Stuart, > > in fact MDP contains a function (mdp.utils.symeig), which provides > an interface to some LAPACK routines that are able to compute only > the first eigenvectors of a matrix, given that it is symmetrical > positive definite (which should be the case, since you're doing > PCA). > I have been using mdp.utils.symeig for a while now and its seems pretty good and reliable. I also find the sqrtm function from MatPy pretty good, although I did have some trouble installing it with python 2.3 but the developers havent gotten back about that. I think more functions like these in scipy would give it a real cutting edge. I only wish I had the time / money to do it. :-) Stuart > Pietro. > > > On Fri, 3 Sep 2004, Gary Ruben wrote: > >> Hi Stuart, >> >> It may well not be relevant to your needs, but since you mentioned >> you were doing PCA, you might want to look at the MDP package which >> was announced on this list a few days ago. >> http://mdp-toolkit.sourceforge.net/ >> >> Gary >> >> ----- Original Message ----- >> From: Stuart Murdock >> Date: Thu, 02 Sep 2004 19:50:57 +0000 >> To: SciPy Users List >> Subject: Re: [SciPy-user] First few eigenvectors of a numarray array >> >> > Hi Dave >> > > David Grant wrote: >> > > > When you say "top 10" do you mean the eigenvalues with the >> largest or > > smallest values? >> > > >> > > Primarily I would be concerned with the eigenvectors associated >> with the > largest eigenvalues as presently >> > I am interested in Principal Component Analysis of biomolecular > >> simulation trajectories. There are ways to approximate >> > the top eigenvector / eigenvalue, then get the next and so on but I >> was > wondering if there were any packages with those >> > types of algorithms already implemented. >> > > Thanks >> > > Stuart >> > > > I would also be interested in knowing if there is any >> mathematical way > > of doing this. Sometimes for example in >> molecular simulations you > > only want to calculate the ground state >> energy, for example, and you > > don't care about the rest... >> > > >> > > Dave >> > > >> > > >> > > Stuart Murdock wrote: >> > > >> > >> Hi >> > >> >> > >> I have a 10000 by 10000 square numarray array which I have >> obtained > >> using numarray. I need to obtain the first 10 >> eigenvalues and >> > >> eigenvectors of this so I dont want to have to calculate all > >> >> eigenvectors of the matrix. Is anyone aware of any pythonic >> packages > >> which >> > >> can calculate, lets say, the 10 eigenvectors corresponding to >> the top > >> 10 eigenvalues of a numarray array. >> > >> >> > >> There are a few functions which calculate all of the >> eigenvectors e.g. >> > >> >> > >> eig >> > >> eigenvectors >> > >> >> > >> but I only want to calculate the top few. >> > >> >> > >> Thanks >> > >> >> > >> Stuart >> > >> >> > > >> > > >> > >_______________________________________________ >> > >SciPy-user mailing list >> > >SciPy-user at scipy.net >> > >http://www.scipy.net/mailman/listinfo/scipy-user >> > > > > >> > > > -- > > Stuart Murdock Ph.D, >> > Research Fellow, >> > Dept. of Chemistry / E-Science, >> > University of Southampton, >> > Highfield, Southampton, >> > SO17 1BJ, United Kingdom >> > > http://www.biosimgrid.org >> > > > > _______________________________________________ >> > 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 > > > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > -- Stuart Murdock Ph.D, Research Fellow, Dept. of Chemistry / E-Science, University of Southampton, Highfield, Southampton, SO17 1BJ, United Kingdom http://www.biosimgrid.org From nwagner at mecha.uni-stuttgart.de Wed Oct 6 05:42:21 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 06 Oct 2004 11:42:21 +0200 Subject: [SciPy-user] from scipy.cplt import * Message-ID: <4163BDFD.90703@mecha.uni-stuttgart.de> Travis, Unfortunately, I cannot confirm your statement. >>> from scipy.xplt import * Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 303, in __getattr__ module = self._ppimport_importer() File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 262, in _ppimport_importer raise PPImportError,\ scipy_base.ppimport.PPImportError: Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 273, in _ppimport_importer module = __import__(name,None,None,['*']) File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", line 12, in ? from Mplot import * File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line 1015, in ? import colorbar File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", line 9, in ? from slice3 import * File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1581, in ? _poly_permutations4 = _construct3 (0) File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, in _construct3 mask = find_mask (below, _node_edges3 [itype]) TypeError: Array can not be safely cast to required type >>> scipy.__version__ '0.3.1_287.4326' Any pointer ? Nils From p.berkes at biologie.hu-berlin.de Wed Oct 6 06:56:09 2004 From: p.berkes at biologie.hu-berlin.de (p.berkes at biologie.hu-berlin.de) Date: Wed, 6 Oct 2004 12:56:09 +0200 (CEST) Subject: [SciPy-user] symeig In-Reply-To: <41630B59.3020500@telus.net> Message-ID: On Tue, 5 Oct 2004, David Grant wrote: > Would it be possible to add something like symeig to scipy? symeig is pretty independent from mdp. It forms a wrapper around some LAPACK routines and automatizes the choice of the algorithm that computes the (generalized) eigenvectors. Recently, we tested it with numarray and it seems to work without problems. If there is some interest, I might clean it up from any reference to mdp and submit it together with some test functions. pietro. From nwagner at mecha.uni-stuttgart.de Wed Oct 6 10:34:12 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 06 Oct 2004 16:34:12 +0200 Subject: [SciPy-user] symeig In-Reply-To: <4163B57C.2020606@soton.ac.uk> References: <41630B59.3020500@telus.net> <4163B57C.2020606@soton.ac.uk> Message-ID: <41640264.5010804@mecha.uni-stuttgart.de> Stuart Murdock wrote: > Hi > David Grant wrote: > >> Would it be possible to add something like symeig to scipy? >> -------- Original Message -------- >> Subject: Re: [SciPy-user] First few eigenvectors of a numarray array >> Date: Fri, 3 Sep 2004 17:07:06 +0200 (CEST) >> From: p.berkes at biologie.hu-berlin.de >> Reply-To: SciPy Users List >> To: SciPy Users List >> >> >> >> Hi Stuart, >> >> in fact MDP contains a function (mdp.utils.symeig), which provides >> an interface to some LAPACK routines that are able to compute only >> the first eigenvectors of a matrix, given that it is symmetrical >> positive definite (which should be the case, since you're doing >> PCA). > Why should the matrix be positive definite ? Please, can you explain that. Of course, symmetrie is clear. If you are interested in an eigenpair (x,\lambda) nearest to a prescribed shift, you can use the attached program. Nils >> > > I have been using mdp.utils.symeig for a while now and its seems > pretty good and reliable. I also find the sqrtm function from > MatPy pretty good, although I did have some trouble installing it with > python 2.3 but the developers havent gotten back about that. I think > more functions like these in scipy would give it a real cutting edge. > I only wish I had the time / money to do it. :-) > Stuart > >> Pietro. >> >> >> On Fri, 3 Sep 2004, Gary Ruben wrote: >> >>> Hi Stuart, >>> >>> It may well not be relevant to your needs, but since you mentioned >>> you were doing PCA, you might want to look at the MDP package which >>> was announced on this list a few days ago. >>> http://mdp-toolkit.sourceforge.net/ >>> >>> Gary >>> >>> ----- Original Message ----- >>> From: Stuart Murdock >>> Date: Thu, 02 Sep 2004 19:50:57 +0000 >>> To: SciPy Users List >>> Subject: Re: [SciPy-user] First few eigenvectors of a numarray array >>> >>> > Hi Dave >>> > > David Grant wrote: >>> > > > When you say "top 10" do you mean the eigenvalues with the >>> largest or > > smallest values? >>> > > >>> > > Primarily I would be concerned with the eigenvectors associated >>> with the > largest eigenvalues as presently >>> > I am interested in Principal Component Analysis of biomolecular > >>> simulation trajectories. There are ways to approximate >>> > the top eigenvector / eigenvalue, then get the next and so on but >>> I was > wondering if there were any packages with those >>> > types of algorithms already implemented. >>> > > Thanks >>> > > Stuart >>> > > > I would also be interested in knowing if there is any >>> mathematical way > > of doing this. Sometimes for example in >>> molecular simulations you > > only want to calculate the ground >>> state energy, for example, and you > > don't care about the rest... >>> > > >>> > > Dave >>> > > >>> > > >>> > > Stuart Murdock wrote: >>> > > >>> > >> Hi >>> > >> >>> > >> I have a 10000 by 10000 square numarray array which I have >>> obtained > >> using numarray. I need to obtain the first 10 >>> eigenvalues and >>> > >> eigenvectors of this so I dont want to have to calculate all > >>> >> eigenvectors of the matrix. Is anyone aware of any pythonic >>> packages > >> which >>> > >> can calculate, lets say, the 10 eigenvectors corresponding to >>> the top > >> 10 eigenvalues of a numarray array. >>> > >> >>> > >> There are a few functions which calculate all of the >>> eigenvectors e.g. >>> > >> >>> > >> eig >>> > >> eigenvectors >>> > >> >>> > >> but I only want to calculate the top few. >>> > >> >>> > >> Thanks >>> > >> >>> > >> Stuart >>> > >> >>> > > >>> > > >>> > >_______________________________________________ >>> > >SciPy-user mailing list >>> > >SciPy-user at scipy.net >>> > >http://www.scipy.net/mailman/listinfo/scipy-user >>> > > > > >>> > > > -- > > Stuart Murdock Ph.D, >>> > Research Fellow, >>> > Dept. of Chemistry / E-Science, >>> > University of Southampton, >>> > Highfield, Southampton, >>> > SO17 1BJ, United Kingdom >>> > > http://www.biosimgrid.org >>> > > > > _______________________________________________ >>> > 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 >> >> >> >> _______________________________________________ >> SciPy-user mailing list >> SciPy-user at scipy.net >> http://www.scipy.net/mailman/listinfo/scipy-user >> >> > > -------------- next part -------------- A non-text attachment was scrubbed... Name: pca_invshift.py Type: text/x-python Size: 1556 bytes Desc: not available URL: From oliphant at ee.byu.edu Wed Oct 6 14:05:52 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Wed, 06 Oct 2004 12:05:52 -0600 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: <4163BDFD.90703@mecha.uni-stuttgart.de> References: <4163BDFD.90703@mecha.uni-stuttgart.de> Message-ID: <41643400.9020808@ee.byu.edu> Nils Wagner wrote: > Travis, > > Unfortunately, I cannot confirm your statement. > You may need to update Numeric to Numeric 23.5 -Travis From nwagner at mecha.uni-stuttgart.de Wed Oct 6 14:54:03 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 06 Oct 2004 20:54:03 +0200 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: <41643400.9020808@ee.byu.edu> Message-ID: On Wed, 06 Oct 2004 12:05:52 -0600 Travis Oliphant wrote: >Nils Wagner wrote: > >>Travis, >> >>Unfortunately, I cannot confirm your statement. >> >You may need to update Numeric to Numeric 23.5 > >-Travis > I am already using 23.5 >>> Numeric.__version__ '23.5' >>> from scipy.xplt import * Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 303, in __getattr__ module = self._ppimport_importer() File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 262, in _ppimport_importer raise PPImportError,\ scipy_base.ppimport.PPImportError: Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 273, in _ppimport_importer module = __import__(name,None,None,['*']) File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", line 12, in ? from Mplot import * File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line 1015, in ? import colorbar File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", line 9, in ? from slice3 import * File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1581, in ? _poly_permutations4 = _construct3 (0) File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, in _construct3 mask = find_mask (below, _node_edges3 [itype]) TypeError: Array can not be safely cast to required type Can someone reproduce this error ? Nils >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user From nwagner at mecha.uni-stuttgart.de Wed Oct 6 15:48:48 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 06 Oct 2004 21:48:48 +0200 Subject: [SciPy-user] from scipy.xplt import * Message-ID: Hi Pearu, hi Travis, Sorry for the trouble with my problem. Finally I have used python setup.py install --force for installing scipy. It seems that --force solved my problems with Numeric 23.3. However with Numeric 23.5 from scipy.xplt import * still fails What is going on there ? Nils From pearu at scipy.org Wed Oct 6 16:14:01 2004 From: pearu at scipy.org (Pearu Peterson) Date: Wed, 6 Oct 2004 15:14:01 -0500 (CDT) Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: References: Message-ID: On Wed, 6 Oct 2004, Nils Wagner wrote: >>>> from scipy.xplt import * > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 303, > in __getattr__ > module = self._ppimport_importer() > File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 262, > in _ppimport_importer > raise PPImportError,\ > scipy_base.ppimport.PPImportError: Traceback (most recent call last): > File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 273, > in _ppimport_importer > module = __import__(name,None,None,['*']) > File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", line 12, in > ? > from Mplot import * > File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line 1015, in > ? > import colorbar > File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", line 9, in > ? > from slice3 import * > File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1581, in > ? > _poly_permutations4 = _construct3 (0) > File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, in > _construct3 > mask = find_mask (below, _node_edges3 [itype]) > TypeError: Array can not be safely cast to required type > > Can someone reproduce this error ? Not me. Could you try debugging this error out yourself? E.g. find out what are the actual types of find_mask arguments, etc. Try the following code: mask = find_mask (below, _node_edges3 [itype].astype('i')) Also, check that Numeric is installed properly. Best way to do that is to remove Numeric from your system and re-install it. Make sure that you also remove Numeric header files from the system. Note that when building scipy with one Numeric version and then switching to another Numeric version, then you must also rebuild scipy. Pearu From oliphant at ee.byu.edu Wed Oct 6 17:03:39 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Wed, 06 Oct 2004 15:03:39 -0600 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: References: Message-ID: <41645DAB.5010007@ee.byu.edu> Pearu Peterson wrote: > > > On Wed, 6 Oct 2004, Nils Wagner wrote: > >>>>> from scipy.xplt import * >>>> >> Traceback (most recent call last): >> File "", line 1, in ? >> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line >> 303, in __getattr__ >> module = self._ppimport_importer() >> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line >> 262, in _ppimport_importer >> raise PPImportError,\ >> scipy_base.ppimport.PPImportError: Traceback (most recent call last): >> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line >> 273, in _ppimport_importer >> module = __import__(name,None,None,['*']) >> File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", line >> 12, in ? >> from Mplot import * >> File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line >> 1015, in ? >> import colorbar >> File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", line >> 9, in ? >> from slice3 import * >> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line >> 1581, in ? >> _poly_permutations4 = _construct3 (0) >> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line >> 1575, in _construct3 >> mask = find_mask (below, _node_edges3 [itype]) >> TypeError: Array can not be safely cast to required type >> >> Can someone reproduce this error ? > > This is the error I was getting before I changed the appropriate functions in arrayfns in Numeric from expecting 'i' type arrays to 'l' type arrays. I suspect you are using an old binary somehow... -Travis From nwagner at mecha.uni-stuttgart.de Thu Oct 7 03:12:10 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 07 Oct 2004 09:12:10 +0200 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: <41645DAB.5010007@ee.byu.edu> References: <41645DAB.5010007@ee.byu.edu> Message-ID: <4164EC4A.8040307@mecha.uni-stuttgart.de> Travis Oliphant wrote: > Pearu Peterson wrote: > >> >> >> On Wed, 6 Oct 2004, Nils Wagner wrote: >> >>>>>> from scipy.xplt import * >>>>> >>>>> >>> Traceback (most recent call last): >>> File "", line 1, in ? >>> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", >>> line 303, in __getattr__ >>> module = self._ppimport_importer() >>> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", >>> line 262, in _ppimport_importer >>> raise PPImportError,\ >>> scipy_base.ppimport.PPImportError: Traceback (most recent call last): >>> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", >>> line 273, in _ppimport_importer >>> module = __import__(name,None,None,['*']) >>> File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", >>> line 12, in ? >>> from Mplot import * >>> File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line >>> 1015, in ? >>> import colorbar >>> File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", >>> line 9, in ? >>> from slice3 import * >>> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line >>> 1581, in ? >>> _poly_permutations4 = _construct3 (0) >>> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line >>> 1575, in _construct3 >>> mask = find_mask (below, _node_edges3 [itype]) >>> TypeError: Array can not be safely cast to required type >>> >>> Can someone reproduce this error ? >> >> >> > This is the error I was getting before I changed the appropriate > functions in arrayfns in Numeric from expecting 'i' type arrays to 'l' > type arrays. > > I suspect you are using an old binary somehow... > > -Travis > I have removed the build directories in scipy and Numeric. Also I have removed Numeric in /usr/lib/python/site-packages Again from scipy.xplt import * failed. I am at a loss for words .... Nils > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From pearu at scipy.org Thu Oct 7 03:47:10 2004 From: pearu at scipy.org (Pearu Peterson) Date: Thu, 7 Oct 2004 02:47:10 -0500 (CDT) Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: <4164EC4A.8040307@mecha.uni-stuttgart.de> References: <4164EC4A.8040307@mecha.uni-stuttgart.de> Message-ID: On Thu, 7 Oct 2004, Nils Wagner wrote: >> I suspect you are using an old binary somehow... >> >> -Travis >> > I have removed the build directories in scipy and Numeric. > Also I have removed Numeric in /usr/lib/python/site-packages > > Again > > from scipy.xplt import * > > failed. I am at a loss for words .... Did you remove also /usr/include/python2.3/Numeric/ before Numeric re-install? Pearu From nwagner at mecha.uni-stuttgart.de Thu Oct 7 03:32:59 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 07 Oct 2004 09:32:59 +0200 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: References: <4164EC4A.8040307@mecha.uni-stuttgart.de> Message-ID: <4164F12B.2000608@mecha.uni-stuttgart.de> Pearu Peterson wrote: > > > On Thu, 7 Oct 2004, Nils Wagner wrote: > >>> I suspect you are using an old binary somehow... >>> >>> -Travis >>> >> I have removed the build directories in scipy and Numeric. >> Also I have removed Numeric in /usr/lib/python/site-packages >> >> Again >> >> from scipy.xplt import * >> >> failed. I am at a loss for words .... > > > Did you remove also > > /usr/include/python2.3/Numeric/ > > before Numeric re-install? No. BTW, is it possible to include something like an automized "make clean" in scipy ? Nils > > Pearu > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From pearu at scipy.org Thu Oct 7 03:59:10 2004 From: pearu at scipy.org (Pearu Peterson) Date: Thu, 7 Oct 2004 02:59:10 -0500 (CDT) Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: <4164F12B.2000608@mecha.uni-stuttgart.de> References: <4164F12B.2000608@mecha.uni-stuttgart.de> Message-ID: On Thu, 7 Oct 2004, Nils Wagner wrote: >> Did you remove also >> >> /usr/include/python2.3/Numeric/ >> >> before Numeric re-install? > > > No. That's probably the most important step when upgrading Numeric as distutils does not install new header files when old ones are in the way. > BTW, is it possible to include something like an automized > "make clean" in scipy ? Well, distutils provides one. Try python setup.py clean -a See also python setup.py clean --help This doesn't remove installed scipy from the system, of course. Pearu From nwagner at mecha.uni-stuttgart.de Thu Oct 7 03:50:08 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 07 Oct 2004 09:50:08 +0200 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: References: <4164F12B.2000608@mecha.uni-stuttgart.de> Message-ID: <4164F530.3090705@mecha.uni-stuttgart.de> Pearu Peterson wrote: > > > On Thu, 7 Oct 2004, Nils Wagner wrote: > >>> Did you remove also >>> >>> /usr/include/python2.3/Numeric/ >>> >>> before Numeric re-install? >> >> >> >> No. > > > That's probably the most important step when upgrading Numeric as > distutils does not install new header files when old ones are in the way. > Now I have removed /usr/include/python2.3/Numeric the build directories in scipy and Numeric but again >>> from scipy.xplt import * Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 303, in __getattr__ module = self._ppimport_importer() File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 262, in _ppimport_importer raise PPImportError,\ scipy_base.ppimport.PPImportError: Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 273, in _ppimport_importer module = __import__(name,None,None,['*']) File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", line 12, in ? from Mplot import * File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line 1015, in ? import colorbar File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", line 9, in ? from slice3 import * File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1581, in ? _poly_permutations4 = _construct3 (0) File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, in _construct3 mask = find_mask (below, _node_edges3 [itype]) TypeError: Array can not be safely cast to required type How about f2py ? Is this package involved in this failure ? Nils >> BTW, is it possible to include something like an automized >> "make clean" in scipy ? > > > Well, distutils provides one. Try > > python setup.py clean -a > > See also > > python setup.py clean --help > > This doesn't remove installed scipy from the system, of course. > > Pearu > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From pearu at scipy.org Thu Oct 7 04:22:45 2004 From: pearu at scipy.org (Pearu Peterson) Date: Thu, 7 Oct 2004 03:22:45 -0500 (CDT) Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: <4164F530.3090705@mecha.uni-stuttgart.de> References: <4164F12B.2000608@mecha.uni-stuttgart.de> <4164F530.3090705@mecha.uni-stuttgart.de> Message-ID: On Thu, 7 Oct 2004, Nils Wagner wrote: >> That's probably the most important step when upgrading Numeric as distutils >> does not install new header files when old ones are in the way. >> > Now I have removed > /usr/include/python2.3/Numeric > > the build directories in scipy and Numeric Silly question but did you re-installed Numeric and scipy also? > but again > >>>> from scipy.xplt import * .. > mask = find_mask (below, _node_edges3 [itype]) > TypeError: Array can not be safely cast to required type May be it's time to you debug slice3.py file yourself.. > How about f2py ? Is this package involved in this failure ? No, I don't think so. Pearu From nwagner at mecha.uni-stuttgart.de Thu Oct 7 04:03:14 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 07 Oct 2004 10:03:14 +0200 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: References: <4164F12B.2000608@mecha.uni-stuttgart.de> <4164F530.3090705@mecha.uni-stuttgart.de> Message-ID: <4164F842.4040904@mecha.uni-stuttgart.de> Pearu Peterson wrote: > > > On Thu, 7 Oct 2004, Nils Wagner wrote: > >>> That's probably the most important step when upgrading Numeric as >>> distutils does not install new header files when old ones are in the >>> way. >>> >> Now I have removed >> /usr/include/python2.3/Numeric >> >> the build directories in scipy and Numeric > > > Silly question but did you re-installed Numeric and scipy also? > Yes. >> but again >> >>>>> from scipy.xplt import * >>>> > .. > >> mask = find_mask (below, _node_edges3 [itype]) >> TypeError: Array can not be safely cast to required type > > > May be it's time to you debug slice3.py file yourself.. > >> How about f2py ? Is this package involved in this failure ? > > > No, I don't think so. > > Pearu > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From rkern at ucsd.edu Thu Oct 7 03:41:52 2004 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 07 Oct 2004 00:41:52 -0700 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: <4164EC4A.8040307@mecha.uni-stuttgart.de> References: <41645DAB.5010007@ee.byu.edu> <4164EC4A.8040307@mecha.uni-stuttgart.de> Message-ID: <4164F340.80304@ucsd.edu> Nils Wagner wrote: > Travis Oliphant wrote: > >> Pearu Peterson wrote: >> >>> >>> >>> On Wed, 6 Oct 2004, Nils Wagner wrote: >>> >>>>>>> from scipy.xplt import * >>>>>> >>>>>> >>>>>> >>>> Traceback (most recent call last): >>>> File "", line 1, in ? >>>> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", >>>> line 303, in __getattr__ >>>> module = self._ppimport_importer() >>>> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", >>>> line 262, in _ppimport_importer >>>> raise PPImportError,\ >>>> scipy_base.ppimport.PPImportError: Traceback (most recent call last): >>>> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", >>>> line 273, in _ppimport_importer >>>> module = __import__(name,None,None,['*']) >>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", >>>> line 12, in ? >>>> from Mplot import * >>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line >>>> 1015, in ? >>>> import colorbar >>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", >>>> line 9, in ? >>>> from slice3 import * >>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line >>>> 1581, in ? >>>> _poly_permutations4 = _construct3 (0) >>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line >>>> 1575, in _construct3 >>>> mask = find_mask (below, _node_edges3 [itype]) >>>> TypeError: Array can not be safely cast to required type >>>> >>>> Can someone reproduce this error ? >>> >>> >>> >>> >> This is the error I was getting before I changed the appropriate >> functions in arrayfns in Numeric from expecting 'i' type arrays to 'l' >> type arrays. >> >> I suspect you are using an old binary somehow... >> >> -Travis >> > I have removed the build directories in scipy and Numeric. > Also I have removed Numeric in /usr/lib/python/site-packages > > Again > > from scipy.xplt import * > > failed. I am at a loss for words .... I'm getting the same error on the Mac. Natch. The change in arrayfns.find_mask that you note ('i' to 'l', or PyArray_INT to PyArray_LONG in enum terms) does not appear in the copy of Numeric-23.5 that I downloaded from Sourceforge. Specifically, lines 1118-9 GET_ARR (fsa, fso, PyArray_INT, 2) ; GET_ARR (node_edgesa, node_edgeso, PyArray_INT, 2) ; Travis' change didn't make it into the Numeric-23.5 package. Nils, try checking out a copy of Numeric from CVS. Or just change those two lines to say PyArray_LONG instead of PyArray_INT. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From nwagner at mecha.uni-stuttgart.de Thu Oct 7 05:11:49 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 07 Oct 2004 11:11:49 +0200 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: <4164F340.80304@ucsd.edu> References: <41645DAB.5010007@ee.byu.edu> <4164EC4A.8040307@mecha.uni-stuttgart.de> <4164F340.80304@ucsd.edu> Message-ID: <41650855.10001@mecha.uni-stuttgart.de> Robert Kern wrote: > Nils Wagner wrote: > >> Travis Oliphant wrote: >> >>> Pearu Peterson wrote: >>> >>>> >>>> >>>> On Wed, 6 Oct 2004, Nils Wagner wrote: >>>> >>>>>>>> from scipy.xplt import * >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>> Traceback (most recent call last): >>>>> File "", line 1, in ? >>>>> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", >>>>> line 303, in __getattr__ >>>>> module = self._ppimport_importer() >>>>> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", >>>>> line 262, in _ppimport_importer >>>>> raise PPImportError,\ >>>>> scipy_base.ppimport.PPImportError: Traceback (most recent call last): >>>>> File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", >>>>> line 273, in _ppimport_importer >>>>> module = __import__(name,None,None,['*']) >>>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", >>>>> line 12, in ? >>>>> from Mplot import * >>>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line >>>>> 1015, in ? >>>>> import colorbar >>>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", >>>>> line 9, in ? >>>>> from slice3 import * >>>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", >>>>> line 1581, in ? >>>>> _poly_permutations4 = _construct3 (0) >>>>> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", >>>>> line 1575, in _construct3 >>>>> mask = find_mask (below, _node_edges3 [itype]) >>>>> TypeError: Array can not be safely cast to required type >>>>> >>>>> Can someone reproduce this error ? >>>> >>>> >>>> >>>> >>>> >>> This is the error I was getting before I changed the appropriate >>> functions in arrayfns in Numeric from expecting 'i' type arrays to >>> 'l' type arrays. >>> >>> I suspect you are using an old binary somehow... >>> >>> -Travis >>> >> I have removed the build directories in scipy and Numeric. >> Also I have removed Numeric in /usr/lib/python/site-packages >> >> Again >> >> from scipy.xplt import * >> >> failed. I am at a loss for words .... > > > I'm getting the same error on the Mac. Natch. > > The change in arrayfns.find_mask that you note ('i' to 'l', or > PyArray_INT to PyArray_LONG in enum terms) does not appear in the copy > of Numeric-23.5 that I downloaded from Sourceforge. > > Specifically, lines 1118-9 > > GET_ARR (fsa, fso, PyArray_INT, 2) ; > GET_ARR (node_edgesa, node_edgeso, PyArray_INT, 2) ; > > Travis' change didn't make it into the Numeric-23.5 package. > > Nils, try checking out a copy of Numeric from CVS. Or just change > those two lines to say PyArray_LONG instead of PyArray_INT. > Robert, Thank you very much for your all-dominant hint ! Now, it works fine. However, I didn't mention that I have used the tarball. Obviously, Pearu and all the others are using cvs.... If I use cvs version of Numerical how do I install it ? When is python setup.py build really necessary ? Nils From rkern at ucsd.edu Thu Oct 7 05:28:33 2004 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 07 Oct 2004 02:28:33 -0700 Subject: [SciPy-user] from scipy.cplt import * In-Reply-To: <41650855.10001@mecha.uni-stuttgart.de> References: <41645DAB.5010007@ee.byu.edu> <4164EC4A.8040307@mecha.uni-stuttgart.de> <4164F340.80304@ucsd.edu> <41650855.10001@mecha.uni-stuttgart.de> Message-ID: <41650C41.4060400@ucsd.edu> Nils Wagner wrote: > If I use cvs version of Numerical how do I install it ? Same as any source distribution. > When is python setup.py build really necessary ? When you decide to update the sources. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From nwagner at mecha.uni-stuttgart.de Thu Oct 7 07:28:03 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 07 Oct 2004 13:28:03 +0200 Subject: [SciPy-user] Sparse format support in io.loadmat Message-ID: <41652843.8040208@mecha.uni-stuttgart.de> Hi all, AFAIK there is no support for reading sparse matrices via io.loadmat. Traceback (most recent call last): File "io.py", line 2, in ? print io.loadmat('test.mat', appendmat=0) File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 744, in loadmat raise ValueError, "Cannot handle sparse matrices, yet." ValueError: Cannot handle sparse matrices, yet. Since io has many new features e.g. Matrix Market (and hopefully NASTRAN's op4 in the near future) it would be nice to have support for sparse matrices in io.loadmat. Any comments ? Nils From nwagner at mecha.uni-stuttgart.de Thu Oct 7 08:06:01 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 07 Oct 2004 14:06:01 +0200 Subject: [SciPy-user] Sparse format support in io.loadmat In-Reply-To: <41652843.8040208@mecha.uni-stuttgart.de> References: <41652843.8040208@mecha.uni-stuttgart.de> Message-ID: <41653129.4080503@mecha.uni-stuttgart.de> Nils Wagner wrote: > Hi all, > > AFAIK there is no support for reading sparse matrices via > io.loadmat. > > Traceback (most recent call last): > File "io.py", line 2, in ? > print io.loadmat('test.mat', appendmat=0) > File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 744, in > loadmat > raise ValueError, "Cannot handle sparse matrices, yet." > ValueError: Cannot handle sparse matrices, yet. > > Since io has many new features e.g. Matrix Market > (and hopefully NASTRAN's op4 in the near future) it would be nice to have > support for sparse matrices in io.loadmat. > > Any comments ? > > Nils > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user Just now, I tried to read a matlab version 5 sparse matrix. Traceback (most recent call last): File "io.py", line 3, in ? d1= io.loadmat('test.mat', appendmat=0) File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 692, in loadmat thisdict = _loadv5(fid,basename) File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 631, in _loadv5 el, varname = _get_element(fid) File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 619, in _get_element el, name = _parse_mimatrix(fid,numbytes) File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 568, in _parse_mimatrix spmat = scipy.sparse.spmatrix(dims[1],dims[0],typecode=res.typecode()) TypeError: __init__() got an unexpected keyword argument 'typecode Nils From nwagner at mecha.uni-stuttgart.de Thu Oct 7 08:20:44 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 07 Oct 2004 14:20:44 +0200 Subject: [SciPy-user] Sparse format support in io.loadmat In-Reply-To: <41653129.4080503@mecha.uni-stuttgart.de> References: <41652843.8040208@mecha.uni-stuttgart.de> <41653129.4080503@mecha.uni-stuttgart.de> Message-ID: <4165349C.7000705@mecha.uni-stuttgart.de> Nils Wagner wrote: > Nils Wagner wrote: > >> Hi all, >> >> AFAIK there is no support for reading sparse matrices via >> io.loadmat. >> >> Traceback (most recent call last): >> File "io.py", line 2, in ? >> print io.loadmat('test.mat', appendmat=0) >> File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 744, >> in loadmat >> raise ValueError, "Cannot handle sparse matrices, yet." >> ValueError: Cannot handle sparse matrices, yet. >> >> Since io has many new features e.g. Matrix Market >> (and hopefully NASTRAN's op4 in the near future) it would be nice to >> have >> support for sparse matrices in io.loadmat. >> >> Any comments ? >> >> Nils >> >> _______________________________________________ >> SciPy-user mailing list >> SciPy-user at scipy.net >> http://www.scipy.net/mailman/listinfo/scipy-user > > > Just now, I tried to read a matlab version 5 sparse matrix. > > Traceback (most recent call last): > File "io.py", line 3, in ? > d1= io.loadmat('test.mat', appendmat=0) File > "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 692, in loadmat > thisdict = _loadv5(fid,basename) > File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 631, in > _loadv5 > el, varname = _get_element(fid) > File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 619, in > _get_element > el, name = _parse_mimatrix(fid,numbytes) > File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 568, in > _parse_mimatrix > spmat = scipy.sparse.spmatrix(dims[1],dims[0],typecode=res.typecode()) > TypeError: __init__() got an unexpected keyword argument 'typecode > > Nils The same holds for dense matrices in v5 format... > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From oliphant at ee.byu.edu Thu Oct 7 11:31:46 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 07 Oct 2004 09:31:46 -0600 Subject: [SciPy-user] Re: Numeric 23.6 ? In-Reply-To: <41650FB3.7070502@mecha.uni-stuttgart.de> References: <41650FB3.7070502@mecha.uni-stuttgart.de> Message-ID: <41656162.7030005@ee.byu.edu> Nils Wagner wrote: > Travis, > > please can you provide a new release including the latest bugfixes ? > > Thanks in advance. > > Nils > Just go and get a new Numeric-23.5 --- I must have messed up which tarball got put on Sourceforge. -Travis From qlli at ctb.pku.edu.cn Mon Oct 4 12:02:00 2004 From: qlli at ctb.pku.edu.cn (Qingliang Li) Date: Tue, 05 Oct 2004 00:02:00 +0800 Subject: [SciPy-user] Has anyone use the GA module in SciPy? Message-ID: <1096905720.24737.16.camel@localhost> Hi everyone, I am beginner using scipy. I have tryed several ways to install scipy in my computer(Fedora core1). But every times when run the example.py file ($python example.py) of GA module(in the /path/to/python_x.x/site-packages/scipy/ga/). It raises the following errors. What is the wrong with the GA module, or it is because I did not install the scipy in a correct way? Another question: I want to use the Genetic Algorithm in scipy, but it seems that there is not a instruction about the usage. Can someone help me? Any help will be appreciated. ^_^ Error goes like this when I run the file of example.py: Warning: The key "migrants" in not a valid setting. The valid settings are ['pop_size', 'p_replace', 'p_cross', 'p_mutate', 'p_deviation', 'gens', 'rand_seed', 'rand_alg', 'dbase', 'update_rate'] Warning: The key "num_pops" in not a valid setting. The valid settings are ['pop_size', 'p_replace', 'p_cross', 'p_mutate', 'p_deviation', 'gens', 'rand_seed', 'rand_alg', 'dbase', 'update_rate'] initializing... seed = 10161042 beigninning genome generation finished generation: 0.24 evals: 250 evaluation time: 0.03 gen: 0 max: 1.761510717868805 dev: 0.59021618153112299 eval time: 0.37 Traceback (most recent call last) ....... -- Qingliang Li Center for Theoretical Biology, Peking University, Beijing, P.R.China, 100871 Email: qlli at ctb.pku.edu.cn Tel: +86-010-6275-9669 From nwagner at mecha.uni-stuttgart.de Fri Oct 8 07:36:37 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 08 Oct 2004 13:36:37 +0200 Subject: [SciPy-user] question marks in xplt.eps generated files Message-ID: <41667BC5.3050607@mecha.uni-stuttgart.de> Hi all, I found some mysterious question marks in xplt.eps generated files. (see attachment) Nils -------------- next part -------------- A non-text attachment was scrubbed... Name: test.eps.gz Type: application/x-gzip Size: 9353 bytes Desc: not available URL: From krivilli at unberwoot.net Sun Oct 10 16:01:33 2004 From: krivilli at unberwoot.net (krivilli at unberwoot.net) Date: Sun, 10 Oct 2004 15:01:33 -0500 (CDT) Subject: [SciPy-user] Unexpected behavior (bug?): scipy x Numeric.argmin Message-ID: <2934.200.162.216.175.1097438493.squirrel@200.162.216.175> HI, -I got myself confused by a strange (for me at least) 'problem' since I don?t know much about Numpy and how, sometimes, some operations that seems to be the same, aren?t (like matrix[i,j] instead of matrix[i][j]). -So let me show what my problem is: #################### import Numeric def MakeLC(matrix,vz): tmp=matrix>=vz # boolean matrix tmp=Numeric.argmin(tmp,0) print tmp if __name__=="__main__": Matrix = [ Numeric.zeros(20), Numeric.array([-0.0123,-0.0156,-0.0199,-0.0254,-0.0267,-0.0285,-0.313,-0.376,-0.0475,-0.0534,-0.0578,-0.0634,-0.0679,-0.0735,-0.0879,-0.0981,-0.112,-0.115,-0.116,-0.118]), Numeric.array([0.0023, 0.0056,0.0099,0.0054,0.0067,0.0085,0.013,0.076,0.0075,0.0034,0.0078,0.0034,0.0079,0.0035,0.0079,0.0081,0.012,0.015,0.016,0.018]), Numeric.array([0.0103,0.0106,0.0109,0.0204,0.0207,0.0205,0.303,0.306,0.0405,0.0504,0.0508,0.0604,0.0609,0.0705,0.0809,0.0901,0.102,0.105,0.106,0.108]), Numeric.array([0.1120,0.1006,0.1009,0.1004,0.1007,0.1200,0.100,0.206,0.2405,0.2504,0.2508,0.2604,0.2609,0.2705,0.2809,0.3081,0.302,0.335,0.306,0.318]), Numeric.array([0.0983,0.0876,0.0854,0.0834,0.0813,0.0798,0.776,0.071,0.0678,0.0630,0.0634,0.0610,0.0588,0.0564,0.0580,0.0522,0.050,0.048,0.040,0.036])] Matrix = Numeric.array(Matrix) LC=MakeLC(Matrix,-0.0564) #################### -Output for this is: [0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1] -But when I have "import scipy" on the head of file like in: #################### import scipy import Numeric . . . (rest is identical) -The output is now: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] -The same occurs even if I don?t use 'import Numeric' and use 'scipy.argmin', 'scipy.zeros' and 'scipy.array' instead. -The 'problem' seems to go away when we replace in Numeric.py, the following line (line:295, Numpy version 23.5) 295c295 < a = -array(a, copy=0) --- > a = -1*array(a, copy=0) -Any hint is welcome! regards, -- roberto janny (krivilli) From rkern at ucsd.edu Sun Oct 10 16:19:00 2004 From: rkern at ucsd.edu (Robert Kern) Date: Sun, 10 Oct 2004 13:19:00 -0700 Subject: [SciPy-user] Unexpected behavior (bug?): scipy x Numeric.argmin In-Reply-To: <2934.200.162.216.175.1097438493.squirrel@200.162.216.175> References: <2934.200.162.216.175.1097438493.squirrel@200.162.216.175> Message-ID: <41699934.407@ucsd.edu> krivilli at unberwoot.net wrote: > HI, > > -I got myself confused by a strange (for me at least) 'problem' since I > don?t know much about Numpy and how, sometimes, some operations that > seems to be the same, aren?t (like matrix[i,j] instead of matrix[i][j]). > > -So let me show what my problem is: > > > #################### > import Numeric > > > def MakeLC(matrix,vz): > tmp=matrix>=vz # boolean matrix > tmp=Numeric.argmin(tmp,0) > > print tmp > > > if __name__=="__main__": > > Matrix = [ > Numeric.zeros(20), > Numeric.array([-0.0123,-0.0156,-0.0199,-0.0254,-0.0267,-0.0285,-0.313,-0.376,-0.0475,-0.0534,-0.0578,-0.0634,-0.0679,-0.0735,-0.0879,-0.0981,-0.112,-0.115,-0.116,-0.118]), > Numeric.array([0.0023, > 0.0056,0.0099,0.0054,0.0067,0.0085,0.013,0.076,0.0075,0.0034,0.0078,0.0034,0.0079,0.0035,0.0079,0.0081,0.012,0.015,0.016,0.018]), > Numeric.array([0.0103,0.0106,0.0109,0.0204,0.0207,0.0205,0.303,0.306,0.0405,0.0504,0.0508,0.0604,0.0609,0.0705,0.0809,0.0901,0.102,0.105,0.106,0.108]), > Numeric.array([0.1120,0.1006,0.1009,0.1004,0.1007,0.1200,0.100,0.206,0.2405,0.2504,0.2508,0.2604,0.2609,0.2705,0.2809,0.3081,0.302,0.335,0.306,0.318]), > Numeric.array([0.0983,0.0876,0.0854,0.0834,0.0813,0.0798,0.776,0.071,0.0678,0.0630,0.0634,0.0610,0.0588,0.0564,0.0580,0.0522,0.050,0.048,0.040,0.036])] > Matrix = Numeric.array(Matrix) > > LC=MakeLC(Matrix,-0.0564) > > #################### > > > -Output for this is: > > [0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1] > > > -But when I have "import scipy" on the head of file like in: > > > #################### > import scipy > import Numeric > > . > . > . > (rest is identical) > > > > > -The output is now: > > [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] > > > -The same occurs even if I don?t use 'import Numeric' and use > 'scipy.argmin', 'scipy.zeros' and 'scipy.array' instead. > > -The 'problem' seems to go away when we replace in Numeric.py, the > following line (line:295, Numpy version 23.5) > > > 295c295 > < a = -array(a, copy=0) > --- > >> a = -1*array(a, copy=0) SciPy alters the comparison functions to return UInt8 arrays. In [1]: tmp = array([0,0,1,1], UInt8) In [2]: tmp Out[2]: NumPy array, format: long [0 0 1 1] In [3]: -tmp Out[3]: NumPy array, format: long [ 0 0 255 255] You can work around this by casting tmp to some signed type before passing it to argmin(). However, I believe you should be using the functions logical_not(alltrue(tmp)) instead of argmin(tmp). Those functions accurately represent the semantics of the operation you want to perform. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From krivilli at unberwoot.net Mon Oct 11 21:51:58 2004 From: krivilli at unberwoot.net (krivilli at unberwoot.net) Date: Mon, 11 Oct 2004 20:51:58 -0500 (CDT) Subject: [SciPy-user] Re[2]: Unexpected behavior (bug?): scipy x Numeric.argmin In-Reply-To: <2934.200.162.216.175.1097438493.squirrel@200.162.216.175> References: <2934.200.162.216.175.1097438493.squirrel@200.162.216.175> Message-ID: <2570.200.162.216.175.1097545918.squirrel@200.162.216.175> rkern at ucsd.edu wrote: ======================= > SciPy alters the comparison functions to return UInt8 arrays. -Thank you! That's it. > In [1]: tmp = array([0,0,1,1], UInt8) > In [2]: tmp > Out[2]: NumPy array, format: long > [0 0 1 1] > In [3]: -tmp > Out[3]: NumPy array, format: long > [ 0 0 255 255] > You can work around this by casting tmp to some signed type before > passing it to argmin(). > However, I believe you should be using the functions > logical_not(alltrue(tmp)) instead of argmin(tmp). Those functions > accurately represent the semantics of the operation you want to perform. -Although this way should work out with the example I gave you, it wont work for all cases I'm dealing with, cuz i'm interested on the index of the element in the array, and not only in a boolean result. -For example: tmp <- array([[0, 0, 0, 0, 0, 1, 1, 1], [1, 1, 0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 1, 0, 1, 1], [0, 0, 0, 1, 1, 0, 0, 0]]) x <- Numeric.argmin(array(tmp,Numeric.Int),0) x -> array([0, 0, 0, 0, 0, 2, 3, 3]) y <- scipy.logical_not(scipy.alltrue(tmp)) y -> array([1, 1, 1, 1, 1, 1, 1, 1]) -In this case what im looking for is [0, 0, 0, 0, 0, 2, 3, 3], which are the indexes (lines) of the 1st minimum value on a column (represented by a '0'). -Thanks again. regards, -- roberto (krivilli) From rkern at ucsd.edu Mon Oct 11 23:24:26 2004 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 11 Oct 2004 20:24:26 -0700 Subject: [SciPy-user] Re[2]: Unexpected behavior (bug?): scipy x Numeric.argmin In-Reply-To: <2570.200.162.216.175.1097545918.squirrel@200.162.216.175> References: <2934.200.162.216.175.1097438493.squirrel@200.162.216.175> <2570.200.162.216.175.1097545918.squirrel@200.162.216.175> Message-ID: <416B4E6A.2010209@ucsd.edu> krivilli at unberwoot.net wrote: > rkern at ucsd.edu wrote: [snip] >>However, I believe you should be using the functions >>logical_not(alltrue(tmp)) instead of argmin(tmp). Those functions >>accurately represent the semantics of the operation you want to perform. > > -Although this way should work out with the example I gave you, it wont > work for all cases I'm dealing with, cuz i'm interested on the index of > the element in the array, and not only in a boolean result. Ah, yes. Of course, because it's argmin(), not minimum.reduce(). Don't mind me; I'm just a raving loon. But yes, the fact that argmin() doesn't work on unsigned arrays is a bug and needs to be fixed, in scipy if not Numeric. I'll look into it tonight. If the raving looniness doesn't strike again, I might even find a workable answer. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From L.Guasina at barilla.it Tue Oct 12 03:42:17 2004 From: L.Guasina at barilla.it (Guasina Luca) Date: Tue, 12 Oct 2004 09:42:17 +0200 Subject: [SciPy-user] Help needed: Problem in translating a file read routine from Matlab to Python-Scipy Message-ID: I am trying to translate a Matlab program to Python - Scipy. The task consist of reading a big data file from a FORTRAN code; the file is written UNFORMATTED and contain a series of arrays. Anyone can help me ? I am new user of Python and Scipy... I am working in Windows XP with IDLE 1.02 and Python 2.3.3 See the attached files: luca.zip contain 5 files: a test data file named luca.grm (202k) a MATLAB program workin OK named luca.m his output output_matlab.txt My program in Python (NOT working) named luca.py his output named output_python.txt . (D:\U\work\bin is my working directory) In the test I try to read just the first part of the file: The first lines contain a first array of size 4 = (nx,ny,nz,ndiel); nx, ny, nz, ndiel are the dimensions of arrays that follow. Then I have in the file nx float that I want to read in the array x (... And then others arrays follows ...) In the example nx=1000, ny=10, nz=5, ndiel=12 . The MATLAB program read correctly the first lines and nx=1000 data in the x array My luca.py read nx=1000 but the statement x = numpyio.fread(fid,nx,'f') only read 151 data... I don't understand why! ?! You can see that in the luca.m I need to skip 2 data for every reading, cooresponding to som FORTRAN record mark using: nu = fread(fid,2,'float32'); (Matlab) I do the same in luca.py using: nu = numpyio.fread(fid,2,'f') Any suggestion ? Thanks ! Luca -------------- next part -------------- A non-text attachment was scrubbed... Name: luca.zip Type: application/x-zip-compressed Size: 8244 bytes Desc: luca.zip URL: From manoj at bhu.ac.in Tue Oct 12 08:20:24 2004 From: manoj at bhu.ac.in (Manoj Kumar Singh) Date: Tue, 12 Oct 2004 17:20:24 +0500 Subject: [SciPy-user] upgrading to scipy 0.3.2 Message-ID: I have installed scipy 0.3 and want to upgrade to scipy 0.3.2. I used 'python setup.py install' command to install scipy 0.3 and its prerequisites. Should i use the same command 'python setup.py install' to scipy_core 0.3.2 and scipy 0.3.2 to upgrade or something else is also needed? I am working with fedora core 2 and python 2.3.4. Thanks in advance Manoj From pearu at scipy.org Tue Oct 12 09:29:04 2004 From: pearu at scipy.org (Pearu Peterson) Date: Tue, 12 Oct 2004 08:29:04 -0500 (CDT) Subject: [SciPy-user] upgrading to scipy 0.3.2 In-Reply-To: References: Message-ID: On Tue, 12 Oct 2004, Manoj Kumar Singh wrote: > I have installed scipy 0.3 and want to upgrade to scipy 0.3.2. I used > 'python setup.py install' command to install scipy 0.3 and its > prerequisites. Should i use the same command 'python setup.py install' > to scipy_core 0.3.2 and scipy 0.3.2 to upgrade or something else is also > needed? I am working with fedora core 2 and python 2.3.4. Yes, 'python setup.py install' should be sufficient provided that scipy prerequisities (f2py, Numeric, atlas or blas/lapack libraries) are installed and probably they are since you had installed scipy 0.3 already. Pearu From nwagner at mecha.uni-stuttgart.de Tue Oct 12 09:09:48 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 12 Oct 2004 15:09:48 +0200 Subject: [SciPy-user] Rank-Revealing QR factorization of dense matrices in scipy Message-ID: <416BD79C.6040002@mecha.uni-stuttgart.de> Hi all, Has someone written a function for Rank-Revealing QR factorization of dense matrices in scipy ? Is there a function to determine the numerical rank of a matrix in scipy ? Any pointer would be appreciated. Nils From rkern at ucsd.edu Tue Oct 12 09:17:13 2004 From: rkern at ucsd.edu (Robert Kern) Date: Tue, 12 Oct 2004 06:17:13 -0700 Subject: [SciPy-user] upgrading to scipy 0.3.2 In-Reply-To: References: Message-ID: <416BD959.9020009@ucsd.edu> Manoj Kumar Singh wrote: > I have installed scipy 0.3 and want to upgrade to scipy 0.3.2. I used > 'python setup.py install' command to install scipy 0.3 and its > prerequisites. Should i use the same command 'python setup.py install' > to scipy_core 0.3.2 and scipy 0.3.2 to upgrade or something else is also > needed? I am working with fedora core 2 and python 2.3.4. In addition to what Pearu wrote, I would also suggest removing the old installed package directories before installing the new ones. Or at least move them to a backup location until you test the new installation. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From rkern at ucsd.edu Tue Oct 12 09:54:09 2004 From: rkern at ucsd.edu (Robert Kern) Date: Tue, 12 Oct 2004 06:54:09 -0700 Subject: [SciPy-user] Rank-Revealing QR factorization of dense matrices in scipy In-Reply-To: <416BD79C.6040002@mecha.uni-stuttgart.de> References: <416BD79C.6040002@mecha.uni-stuttgart.de> Message-ID: <416BE201.5010907@ucsd.edu> Nils Wagner wrote: > Hi all, > > Has someone written a function for Rank-Revealing QR factorization of > dense matrices in scipy ? No. The relevant LAPACK function set is xGEQP3, I believe. Contributions are welcome. > Is there a function to determine the numerical rank of a matrix in scipy ? Tip: grep the source before asking here. Offhand, I don't see one standing alone. If your arrays aren't too large, you can use linalg.svdvals to compute the singular values. The number of values greater than the largest value times machine epsilon is a good estimate of the rank. Alternatively, the rank* of A can be computed by linalg.lstsq(A, ones(A.shape[0]))[2]. * It's documented as the "effective rank." I think we're talking about the same thing, though. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From nwagner at mecha.uni-stuttgart.de Tue Oct 12 10:31:29 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 12 Oct 2004 16:31:29 +0200 Subject: [SciPy-user] Rank-Revealing QR factorization of dense matrices in scipy In-Reply-To: <416BE201.5010907@ucsd.edu> References: <416BD79C.6040002@mecha.uni-stuttgart.de> <416BE201.5010907@ucsd.edu> Message-ID: <416BEAC1.1010806@mecha.uni-stuttgart.de> Robert Kern wrote: > Nils Wagner wrote: > >> Hi all, >> >> Has someone written a function for Rank-Revealing QR factorization of >> dense matrices in scipy ? > > > No. The relevant LAPACK function set is xGEQP3, I believe. > Contributions are welcome. > BTW, a good source is C. H. Bischof, G. Quintana-Orti Algorithm 782: Codes for Rank-Revealing QR Factorizations of Dense Matrices ACM Transactions on Mathematical software, Vol.24 No. 2 pp. 254-257 >> Is there a function to determine the numerical rank of a matrix in >> scipy ? > > > Tip: grep the source before asking here. > > Offhand, I don't see one standing alone. > > If your arrays aren't too large, you can use linalg.svdvals to compute > the singular values. The number of values greater than the largest > value times machine epsilon is a good estimate of the rank. > > Alternatively, the rank* of A can be computed by linalg.lstsq(A, > ones(A.shape[0]))[2]. > > * It's documented as the "effective rank." I think we're talking about > the same thing, though. > It would be nice to have a built-in function (e.g. rank(A)) for this purpose. Maybe linalg.orth can be used in this context. Nils From rkern at ucsd.edu Tue Oct 12 10:57:20 2004 From: rkern at ucsd.edu (Robert Kern) Date: Tue, 12 Oct 2004 07:57:20 -0700 Subject: [SciPy-user] Rank-Revealing QR factorization of dense matrices in scipy In-Reply-To: <416BEAC1.1010806@mecha.uni-stuttgart.de> References: <416BD79C.6040002@mecha.uni-stuttgart.de> <416BE201.5010907@ucsd.edu> <416BEAC1.1010806@mecha.uni-stuttgart.de> Message-ID: <416BF0D0.4040103@ucsd.edu> Nils Wagner wrote: > Robert Kern wrote: > >> Nils Wagner wrote: >> >>> Hi all, >>> >>> Has someone written a function for Rank-Revealing QR factorization of >>> dense matrices in scipy ? >> >> >> >> No. The relevant LAPACK function set is xGEQP3, I believe. >> Contributions are welcome. >> > BTW, a good source is > > C. H. Bischof, G. Quintana-Orti > Algorithm 782: Codes for Rank-Revealing QR Factorizations of Dense > Matrices > > ACM Transactions on Mathematical software, Vol.24 No. 2 pp. 254-257 The LAPACK functions are unencumbered by TOMS's non-commercial-use-only license. I'm fairly sure, though, that xGEQP3 is a version of the TOMS782 code. [snip] > It would be nice to have a built-in function (e.g. rank(A)) for this > purpose. Indeed. If you write one that's sufficiently robust, documented, and unit tested, I'll check it in. Until then, the svdvals solution should work just fine for you. > Maybe linalg.orth can be used in this context. No, that computes the full SVD, which is overkill. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From oliphant at ee.byu.edu Tue Oct 12 12:01:26 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 12 Oct 2004 10:01:26 -0600 Subject: [SciPy-user] Help needed: Problem in translating a file read routine from Matlab to Python-Scipy In-Reply-To: References: Message-ID: <416BFFD6.10908@ee.byu.edu> Guasina Luca wrote: >I am trying to translate a Matlab program to Python - Scipy. >The task consist of reading a big data file from a FORTRAN code; the >file is written UNFORMATTED and contain a series of arrays. >Anyone can help me ? I am new user of Python and Scipy... >I am working in Windows XP with IDLE 1.02 and Python 2.3.3 > > > Binary files written from FORTRAN have special support in scipy.io The expected usage is for you to open the file using fid = io.fopen() and then use fid.fort_read (to handle the Fortran record mark automatically) or fid.fread (to handle binary reading yourself). The record you are skipping past is a 4-byte integer surrounding any data written using a single fortran write statement that gives the number of bytes written. fid.fort_read will use this record to read the correct number of bytes, but it should not be necessary. The attached luca.py file works on my Linux box just fine. The output is also attached What you did is less clean and not the expected form. However it should have worked and probably would have if you would have opened the file in binary mode (this is handled automatically by io.fopen). Windows unfortunately treats text files and binary files differently so you probably need to open the file using 'rb' . But, I suggest you look at the attached luca.py file to see a more elegant way to do it and to realize that your elem data is redundant (and should be written using integers anyway). -Travis Oliphant -------------- next part -------------- A non-text attachment was scrubbed... Name: luca.zip Type: application/zip Size: 8244 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: output URL: From oliphant at ee.byu.edu Tue Oct 12 12:05:51 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 12 Oct 2004 10:05:51 -0600 Subject: [SciPy-user] Help needed: Problem in translating a file read routine from Matlab to Python-Scipy In-Reply-To: References: Message-ID: <416C00DF.9050400@ee.byu.edu> Guasina Luca wrote: >I am trying to translate a Matlab program to Python - Scipy. >The task consist of reading a big data file from a FORTRAN code; the >file is written UNFORMATTED and contain a series of arrays. >Anyone can help me ? I am new user of Python and Scipy... >I am working in Windows XP with IDLE 1.02 and Python 2.3.3 > > Here is the correct luca.py file (sorry for the wrong attachment sent previously) -Travis O. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: luca.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: output URL: From stephen.walton at csun.edu Tue Oct 12 18:07:30 2004 From: stephen.walton at csun.edu (Stephen Walton) Date: Tue, 12 Oct 2004 15:07:30 -0700 Subject: [SciPy-user] Help needed: Problem in translating a file read routine from Matlab to Python-Scipy In-Reply-To: <416BFFD6.10908@ee.byu.edu> References: <416BFFD6.10908@ee.byu.edu> Message-ID: <1097618850.29243.35.camel@freyer.sfo.csun.edu> On Tue, 2004-10-12 at 09:01, Travis Oliphant wrote: > Binary files written from FORTRAN have special support in scipy.io > > The expected usage is for you to open the file using > > fid = io.fopen() > and then use fid.fort_read (to handle the Fortran record mark > automatically) or > fid.fread (to handle binary reading yourself). I can confirm that this works on Fortran binary files produced with Absoft Fortran on Linux as well. This despite the fact that the format of such files is not actually part of the standard, and so each compiler vendor is free to invent a new one. -- Stephen Walton Dept. of Physics & Astronomy, Cal State Northridge -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From pearu at scipy.org Wed Oct 13 09:17:39 2004 From: pearu at scipy.org (Pearu Peterson) Date: Wed, 13 Oct 2004 08:17:39 -0500 (CDT) Subject: [SciPy-user] ANN: SciPy 0.3.2 Released Message-ID: Hi, Scipy 0.3.2 has been released and binaries are available from the scipy.org site: http://www.scipy.org Scipy 0.3.2 is a bug fix release of Scipy 0.3 including the following new features: - wxPython 2.5 support - reading/writing dense/sparse matrices in Matrix Market format - iterative solvers, new functions sqrtm, hessenberg - Constrained Optimization BY Linear Approximation - discrete Boltzmann, Planck, Levy distributions - Scipy tests pass now also on 64-bit systems and Mac OSX etc. The complete release notes can be found here: http://www.scipy.org/download/scipy_release_notes_0.3.2.html Best regards, Pearu BTW Scipy is: ------------- Scipy is an open source library of scientific tools for Python. Scipy supplements the popular Numeric module, gathering a variety of high level science and engineering modules together as a single package. Scipy includes modules for graphics and plotting, optimization, integration, special functions, signal and image processing, genetic algorithms, ODE solvers, and others. From libsvm at tom.com Wed Oct 13 10:45:07 2004 From: libsvm at tom.com (libsvm) Date: Wed, 13 Oct 2004 22:45:07 +0800 Subject: [SciPy-user] Has some met such a problem? In-Reply-To: <20041012162402.4B4E93EB3B@www.scipy.com> References: <20041012162402.4B4E93EB3B@www.scipy.com> Message-ID: <1097678459.24736.61.camel@localhost> Hi everyone, I try to learn the ga (genetic algorithm) module of scipy, but when I run the example file in the $scipy_root/ga/ directory, it raise the following errors. Can someone help me? Any suggestion is welcome. Best wishes, Qingliang Errors like this: Warning: The key "migrants" in not a valid setting. The valid settings are ['pop_size', 'p_replace', 'p_cross', 'p_mutate', 'p_deviation', 'gens', 'rand_seed', 'rand_alg', 'dbase', 'update_rate'] Warning: The key "num_pops" in not a valid setting. The valid settings are ['pop_size', 'p_replace', 'p_cross', 'p_mutate', 'p_deviation', 'gens', 'rand_seed', 'rand_alg', 'dbase', 'update_rate'] initializing... seed = 1808493040 beigninning genome generation finished generation: 0.23 evals: 250 evaluation time: 0.03 gen: 0 max: 1.6958428271114823 dev: 0.59946054180519071 eval time: 0.33999999999999997 Traceback (most recent call last): File "/usr/lib/python2.2/site-packages/scipy/ga/examples.py", line 64, in ? ex1() File "/usr/lib/python2.2/site-packages/scipy/ga/examples.py", line 60, in ex1 galg.evolve() File "/usr/lib/python2.2/scipy/ga/algorithm.py", line 133, in evolve self.step() File "/usr/lib/python2.2/scipy/ga/algorithm.py", line 107, in step self.stats['mutations'] = self.stats['mutations'] + self.pop[sz:].mutate() File "/usr/lib/python2.2/scipy/ga/population.py", line 185, in mutate for ind in self: mutations = mutations + ind.mutate() File "/usr/lib/python2.2/scipy/ga/genome.py", line 94, in mutate if self.mutator.evaluate(self): File "/usr/lib/python2.2/scipy/ga/genome.py", line 158, in evaluate for gene in genome: mutated = gene.mutate() or mutated File "/usr/lib/python2.2/scipy/ga/gene.py", line 104, in mutate self._value = self.mutator.evaluate(self) File "/usr/lib/python2.2/scipy/ga/gene.py", line 196, in evaluate f = rv.norm(old,w)[0] AttributeError: rv_frozen instance has no attribute '__getitem__' From aisaac at american.edu Thu Oct 14 00:43:17 2004 From: aisaac at american.edu (Alan G Isaac) Date: Thu, 14 Oct 2004 00:43:17 -0400 (Eastern Daylight Time) Subject: [SciPy-user] multiplying matrices In-Reply-To: <41520E6E.8000201@telus.net> References: <41520E6E.8000201@telus.net> Message-ID: On Wed, 22 Sep 2004, David Grant apparently wrote: > Is there any way to multiple a whole bunch of matrices > together easily? Ideally, the * operator would be for > matrix multiplication as opposed to element-by-element > multiplication. I've been doing this: > listofmatricies = [blah, blah, blah, ....] > return reduce(matrixmultiply,listofmatricies) > Seems to work, but it would nice to be able to do it in > one line as in matlab. I didn't see a reply to this? Answer 1: reduce(matrixmultiply,[blah1, blah2, blah3,...]) Well, it's one line. ;-) Answer 2: if * didn't work for you, it is because you are working with arrays, not matrices. import Matrix x=Matrix.Matrix(blah1) y=Matrix.Matrix(blah2) print x*y You'll see matrix multiplication. fwiw, Alan Isaac From fonnesbeck at gmail.com Thu Oct 14 10:08:25 2004 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Thu, 14 Oct 2004 10:08:25 -0400 Subject: [SciPy-user] multiple windows in gplt Message-ID: <723eb693041014070838a08995@mail.gmail.com> My Markov chain Monte Carlo code calls gplt.plot repeatedly to generate histograms and traces of simulated values. However, rather than re-use the sample gnuplot window, it generates a new frame for each plot it produces, often leaving my screen cluttered with hundreds of plots for more complicated models. I have tried removing the gplt.close() statement in my plotting routine, but then the single window generated does not refresh with each new plot; the initial plot remains displayed until the end of the simulation. I know that if I call plot repeatedly from an interactive python session, subsequent plots are displayed properly in the same frame. Any ideas what may be causing this? Here is a sample of my plotting method, which uses gplt.plot: def time_series(self,data,name,xlab='Time',ylab='Value',suffix='',same_axes=True): 'Internal plotting specification for handling nested arrays' 'If there is only one data array, go ahead and plot it ... ' if len(shape(data))==1 or same_axes: print 'Plotting',name plot(data) 'Plot options' grid('off') xtitle(xlab) ytitle(ylab) 'Save to file' output("%s%s.png" % (name,suffix),'png') #close() else: '... otherwise plot recursively' tdata = swapaxes(data,0,1) for i in range(len(tdata)): self.time_series(tdata[i],name+'_'+str(i),xlab,ylab,suffix) From krivilli at unberwoot.net Thu Oct 14 16:25:16 2004 From: krivilli at unberwoot.net (krivilli at unberwoot.net) Date: Thu, 14 Oct 2004 15:25:16 -0500 (CDT) Subject: [SciPy-user] multiple windows in gplt Message-ID: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> HI, -Maybe what u're looking for is gplt.hold('on') Chris Fonnesbeck wrote: > My Markov chain Monte Carlo code calls gplt.plot repeatedly to > generate histograms and traces of simulated values. However, rather > than re-use the sample gnuplot window, it generates a new frame for > each plot it produces, often leaving my screen cluttered with hundreds > of plots for more complicated models. (...) > Here is a sample of my plotting method, which uses > gplt.plot: > > def time_series(self,data,name,xlab='Time',ylab='Value',suffix='',same_axes=True): > 'Internal plotting specification for handling nested arrays' > > 'If there is only one data array, go ahead and plot it ... ' > if len(shape(data))==1 or same_axes: > > print 'Plotting',name > plot(data) > > 'Plot options' > grid('off') > xtitle(xlab) > ytitle(ylab) > > 'Save to file' > output("%s%s.png" % (name,suffix),'png') > #close() > > else: > '... otherwise plot recursively' > > tdata = swapaxes(data,0,1) > > for i in range(len(tdata)): > self.time_series(tdata[i],name+'_'+str(i),xlab,ylab,suffix) > regards, -- roberto (krivilli) From tfogal at apollo.sr.unh.edu Thu Oct 14 16:53:43 2004 From: tfogal at apollo.sr.unh.edu (tom fogal) Date: Thu, 14 Oct 2004 16:53:43 -0400 Subject: [SciPy-user] scipy_distutils documentation Message-ID: <200410142053.i9EKrhOY019431@apollo.sr.unh.edu> Hi all, we've got some fortran code wrapped via f2py that we're probably be going to be adding to and using in a multitude of projects. I'd like to make a python package out of the sources, for ease of building / upgrading / use. Thus I'm trying to figure out how scipy_distutils works so I can use that to build the package. I can't seem to find any documentation on it, on the website or otherwise. Does anybody have a guide to setting up a project to use scipy_distutils perhaps? Or maybe there is another build system I should be looking into? Thanks, -tom From pearu at scipy.org Thu Oct 14 17:41:22 2004 From: pearu at scipy.org (Pearu Peterson) Date: Thu, 14 Oct 2004 16:41:22 -0500 (CDT) Subject: [SciPy-user] scipy_distutils documentation In-Reply-To: <200410142053.i9EKrhOY019431@apollo.sr.unh.edu> References: <200410142053.i9EKrhOY019431@apollo.sr.unh.edu> Message-ID: On Thu, 14 Oct 2004, tom fogal wrote: > Hi all, we've got some fortran code wrapped via f2py that we're > probably be going to be adding to and using in a multitude of projects. > I'd like to make a python package out of the sources, for ease of > building / upgrading / use. > > Thus I'm trying to figure out how scipy_distutils works so I can use > that to build the package. I can't seem to find any documentation on > it, on the website or otherwise. Does anybody have a guide to setting > up a project to use scipy_distutils perhaps? Or maybe there is another > build system I should be looking into? There exist no document as of yet that fully describes how scipy_distutils extends Python distutils. - However, there is a section in f2py users guide that gives a basic example when dealing with Fortran sources and .pyf files: http://cens.ioc.ee/projects/f2py2e/usersguide/index.html#using-scipy-distutils - Take a look also at the document that describes how scipy_distutils is used in scipy, see section "File xxx/setup_xxx.py" in http://www.scipy.org/development/developscipy.txt - Next see examples in scipy_distutils/tests directory that demonstrate using scipy_distutils when having Fortran 77 and Fortran 90 sources, SWIG files, as well as when sources (of any type like .pyf files, fortran files, C files, etc etc) are generated during a build command. - scipy_distutils has a number of undocumented but very useful features used in the setup.py files of scipy subpackages, study these files. If you have any specific questions about using scipy_distutils, let us know. This is probably the best way to get scipy_distutils documented eventually. Pearu From matt at hotdispatch.com Thu Oct 14 18:01:12 2004 From: matt at hotdispatch.com (matt) Date: Thu, 14 Oct 2004 17:01:12 -0500 Subject: [SciPy-user] integrate.odeint question Message-ID: <901E2D48-1E2C-11D9-AB5A-003065BA9C84@hotdispatch.com> The documentation doesn't seem to give much information on how this function works. Does anyone have pointers to what numerical methods are implemented by this function and what the optional parameters mean in detail? -Matt B From fonnesbeck at gmail.com Thu Oct 14 19:51:03 2004 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Thu, 14 Oct 2004 19:51:03 -0400 Subject: [SciPy-user] multiple windows in gplt In-Reply-To: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> References: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> Message-ID: <723eb69304101416514ea95ac2@mail.gmail.com> On Thu, 14 Oct 2004 15:25:16 -0500 (CDT), krivilli at unberwoot.net wrote: > HI, > > -Maybe what u're looking for is gplt.hold('on') > Thanks Roberto, I tried that, but it simply displays the first plot of the series, while subsequent plots are not shown. I need each plot to replace the previous one in the same window. From fonnesbeck at gmail.com Thu Oct 14 20:14:55 2004 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Thu, 14 Oct 2004 20:14:55 -0400 Subject: [SciPy-user] multiple windows in gplt In-Reply-To: <723eb69304101416514ea95ac2@mail.gmail.com> References: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> <723eb69304101416514ea95ac2@mail.gmail.com> Message-ID: <723eb693041014171414af30d9@mail.gmail.com> On Thu, 14 Oct 2004 19:51:03 -0400, Chris Fonnesbeck wrote: > On Thu, 14 Oct 2004 15:25:16 -0500 (CDT), krivilli at unberwoot.net > wrote: > > HI, > > > > -Maybe what u're looking for is gplt.hold('on') > > > > Thanks Roberto, > > I tried that, but it simply displays the first plot of the series, > while subsequent plots are not shown. I need each plot to replace the > previous one in the same window. > Here's the problem: calling save() or output() following plot() renders the window subsequently unusable. No further plots are rendered thereafter. I am looking to show a plot, save it to a file, then show another plot in the same window (*not* the same set of axes -- I need a new plot, but using the same gnunplot window). It appears that is not possible. From krivilli at unberwoot.net Thu Oct 14 20:27:59 2004 From: krivilli at unberwoot.net (krivilli at unberwoot.net) Date: Thu, 14 Oct 2004 19:27:59 -0500 (CDT) Subject: [SciPy-user] multiple windows in gplt In-Reply-To: <723eb693041014171414af30d9@mail.gmail.com> References: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> <723eb69304101416514ea95ac2@mail.gmail.com> <723eb693041014171414af30d9@mail.gmail.com> Message-ID: <3539.200.162.216.175.1097800079.squirrel@200.162.216.175> HI again, > On Thu, 14 Oct 2004 19:51:03 -0400, Chris Fonnesbeck > wrote: >> On Thu, 14 Oct 2004 15:25:16 -0500 (CDT), krivilli at unberwoot.net >> wrote: >> > HI, >> > >> > -Maybe what u're looking for is gplt.hold('on') >> > >> >> Thanks Roberto, >> >> I tried that, but it simply displays the first plot of the series, >> while subsequent plots are not shown. I need each plot to replace the >> previous one in the same window. >> -I did look your code again and there is another issue. -You should also notice that u're calling gplt.plot recursively from time_series(), so it will pop-up a new window every time it's called (different scopes). -What you could do is to plot 'just once', using a matrix. For example, for a 2-D plot, say y(t) x t, u can store every new set of data in the columns of matrix 't' (abscissas) and matrix 'y' (ordinates), and then plot it ('t' and 'y' must have the same shape). -Also, if u dont want gnuplot to flood u up, u can unset the option 'persist' (doesn't work on M$ Windows). For this u'll need to take look o scipy/gplt/interface.py and scipy/gplt/pyPlot.py, cuz im not sure if u can do it through gplt. -I'm 'extending' gplt (not really, cuz it has all u need to add new options) to use the rest of gnuplot options (like 'size ratio'). I'll probably add something about the 'persist' flag. > > Here's the problem: calling save() or output() following plot() > renders the window subsequently unusable. No further plots are > rendered thereafter. > > I am looking to show a plot, save it to a file, then show another plot > in the same window (*not* the same set of axes -- I need a new plot, > but using the same gnunplot window). It appears that is not possible. > -At least, is it saving correctly? regards, -- roberto (krivilli) From krivilli at unberwoot.net Thu Oct 14 20:31:49 2004 From: krivilli at unberwoot.net (krivilli at unberwoot.net) Date: Thu, 14 Oct 2004 19:31:49 -0500 (CDT) Subject: [SciPy-user] integrate.odeint question In-Reply-To: <901E2D48-1E2C-11D9-AB5A-003065BA9C84@hotdispatch.com> References: <901E2D48-1E2C-11D9-AB5A-003065BA9C84@hotdispatch.com> Message-ID: <3564.200.162.216.175.1097800309.squirrel@200.162.216.175> HI, > The documentation doesn't seem to give much information on how this > function works. Does anyone have pointers to what numerical methods > are implemented by this function and what the optional parameters mean > in detail? > > -Matt B > -Try, >> help(integrate.odeint) -You may check the the code on python/site-packages/scipy/integrate for the specifics of the implementation. regards, -- roberto From fonnesbeck at gmail.com Thu Oct 14 20:53:33 2004 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Thu, 14 Oct 2004 20:53:33 -0400 Subject: [SciPy-user] multiple windows in gplt In-Reply-To: <3539.200.162.216.175.1097800079.squirrel@200.162.216.175> References: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> <723eb69304101416514ea95ac2@mail.gmail.com> <723eb693041014171414af30d9@mail.gmail.com> <3539.200.162.216.175.1097800079.squirrel@200.162.216.175> Message-ID: <723eb69304101417535e5b8389@mail.gmail.com> On Thu, 14 Oct 2004 19:27:59 -0500 (CDT), krivilli at unberwoot.net wrote: > -I did look your code again and there is another issue. > > -You should also notice that u're calling gplt.plot recursively from > time_series(), so it will pop-up a new window every time it's called > (different scopes). > I sometimes have matrix data that need to be plotted separately, so I dont have much choice but to recurse. > -What you could do is to plot 'just once', using a matrix. For example, > for a 2-D plot, say y(t) x t, u can store every new set of data in the > columns of matrix 't' (abscissas) and matrix 'y' (ordinates), and then > plot it ('t' and 'y' must have the same shape). > But I would still have to save them serially, wouldnt I? That is where the trouble arises, since the window gets disabled after saving. > -Also, if u dont want gnuplot to flood u up, u can unset the option > 'persist' (doesn't work on M$ Windows). For this u'll need to take look o > scipy/gplt/interface.py and scipy/gplt/pyPlot.py, cuz im not sure if u can > do it through gplt. I'm on OSX, bur many of my users are on M$. > > > > I am looking to show a plot, save it to a file, then show another plot > > in the same window (*not* the same set of axes -- I need a new plot, > > but using the same gnunplot window). It appears that is not possible. > > > > -At least, is it saving correctly? > Each plot saves fine, yes. I thought about calling save using gplt._send, but it results in zero-length files. Thanks for the help, C. From krivilli at unberwoot.net Thu Oct 14 21:40:18 2004 From: krivilli at unberwoot.net (krivilli at unberwoot.net) Date: Thu, 14 Oct 2004 20:40:18 -0500 (CDT) Subject: [SciPy-user] multiple windows in gplt In-Reply-To: <723eb69304101417535e5b8389@mail.gmail.com> References: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> <723eb69304101416514ea95ac2@mail.gmail.com> <723eb693041014171414af30d9@mail.gmail.com> <3539.200.162.216.175.1097800079.squirrel@200.162.216.175> <723eb69304101417535e5b8389@mail.gmail.com> Message-ID: <4264.200.162.216.175.1097804418.squirrel@200.162.216.175> > On Thu, 14 Oct 2004 19:27:59 -0500 (CDT), krivilli at unberwoot.net > wrote: >> -I did look your code again and there is another issue. >> >> -You should also notice that u're calling gplt.plot recursively from >> time_series(), so it will pop-up a new window every time it's called >> (different scopes). >> > > I sometimes have matrix data that need to be plotted separately, so I > dont have much choice but to recurse. > >> -What you could do is to plot 'just once', using a matrix. For example, >> for a 2-D plot, say y(t) x t, u can store every new set of data in the >> columns of matrix 't' (abscissas) and matrix 'y' (ordinates), and then >> plot it ('t' and 'y' must have the same shape). >> > > But I would still have to save them serially, wouldnt I? That is where > the trouble arises, since the window gets disabled after saving. -Yeah, but it's quite different efect when calling it (plot) from the same scope: def time_series(params,...): # Build 'y' matrix and 't' matrix . . . # now we plot it for i in iterator: plot(x[:,i],y[:,i]) output("plot%d.ps" % i,'postscript color') #u can call close(), no need though close() -This is different then use time_series() two times for two different data sets. Something like: class time_series(params,...): def __init__(): . . . def plot(data): #same code for ploting here . . . MyClass = time_series(foo,...) MyClass.plot(data1) MyClass.plot(data2) -This isn't quite the same. regards, -- roberto From Fernando.Perez at colorado.edu Fri Oct 15 02:15:44 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Fri, 15 Oct 2004 00:15:44 -0600 Subject: [SciPy-user] multiple windows in gplt In-Reply-To: <723eb69304101417535e5b8389@mail.gmail.com> References: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> <723eb69304101416514ea95ac2@mail.gmail.com> <723eb693041014171414af30d9@mail.gmail.com> <3539.200.162.216.175.1097800079.squirrel@200.162.216.175> <723eb69304101417535e5b8389@mail.gmail.com> Message-ID: <416F6B10.1020605@colorado.edu> Hi Chris, sorry if I haven't followed this thread in detail, but you might want to consider using the plain (non-scipy) gnuplot.py interface, perhaps with the additions which ipython provides to make the syntax easier to use. In that context, you simply make new gnuplot instances as: gp = Gnuplot() gp2 = Gnuplot(),= ... and you can make plots on each via: gp.plot(foo) -> plot window 1 ... gp.replot(bar) -> add a plot to window 1 gp2.plot(baz) -> plot into a new window gp2.replot(baz2) -> add something to window 2 etc. I've never really felt that Gnuplot.py + IPython.GnuplotRuntime limits any kind of plotting needs, whether for interatctive use (where you should use IPython.GnuplotInteractive) or for scripted use. Perhaps this may be of use to you. Regards, f From L.Guasina at barilla.it Fri Oct 15 03:51:54 2004 From: L.Guasina at barilla.it (Guasina Luca) Date: Fri, 15 Oct 2004 09:51:54 +0200 Subject: [SciPy-user] Help needed: Problem in translating a file readroutine from Matlab to Python-Scipy Message-ID: Thank you to Travis and Stephen for the help ! Now all work correcly. What I am trying to do now I to write my processed data in VTK format (in fact VTR - non uniform rectangular grid with various point and cell data). I am trying to use pyvtk: do you think is possible to write COMPRESSED files? Visualisation of post-processed files will pick up files in VTK format; now I am using ParaView but I am thinking to move to MayaVi, directly from Python... Luca Guasina From PrabhuRamachandran Fri Oct 15 05:58:49 2004 From: PrabhuRamachandran (Prabhu Ramachandran) Date: Fri, 15 Oct 2004 15:28:49 +0530 Subject: [SciPy-user] Help needed: Problem in translating a file readroutine from Matlab to Python-Scipy In-Reply-To: References: Message-ID: <16751.40793.423077.637874@monster.linux.in> >>>>> "GL" == Guasina Luca writes: GL> Thank you to Travis and Stephen for the help ! Now all work GL> correcly. What I am trying to do now I to write my processed GL> data in VTK format (in fact VTR - non uniform rectangular grid GL> with various point and cell data). I am trying to use pyvtk: GL> do you think is possible to write COMPRESSED files? If you mean the XML output format, I don't think pyvtk will help you. However, in the VTK sources there is a file called Utilities/vtk2xml.py that you can use to convert an old style VTK file to an XML file. If you don't have the VTK sources handy grab the file from here: http://www.ae.iitm.ac.in/~prabhu/software/code/mayavi/vtk2xml.py It supports compressing the file also, so perhaps you can generate a temporary file using pyvtk, convert it using vtk2xml and then use that file. cheers, prabhu From falted at pytables.org Fri Oct 15 06:28:36 2004 From: falted at pytables.org (Francesc Alted) Date: Fri, 15 Oct 2004 12:28:36 +0200 Subject: [SciPy-user] Problems testing SciPy 0.3.2 Message-ID: <200410151228.36231.falted@pytables.org> Hi, I've just installed the newest SciPy 0.3.2, and all tests seems to pass well, except 15 (out of 574). All of them are caused by the same reason, which ultimately is: File "/users/exp/alted/bin-i686/lib/python/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' I'm attaching the information required in the INSTALL.txt for reporting bugs. Cheers, -- Francesc Alted -------------- next part -------------- $ python -c 'from f2py2e.diagnose import run;run()' ------ os.name='posix' ------ sys.platform='linux2' ------ sys.version: 2.3.4 (#1, Jul 22 2004, 20:47:54) [GCC 3.3.2 20031022 (Red Hat Linux 3.3.2-1)] ------ sys.prefix: /usr ------ sys.path=':/users/exp/alted/bin-i686/lib/python:/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/lib/python2.3/site-packages:/usr/lib/python2.3/site-packages/Numeric' ------ Found Numeric version '23.3' in /usr/lib/python2.3/site-packages/Numeric/Numeric.pyc Found numarray version '1.1' in /usr/lib/python2.3/site-packages/numarray/__init__.pyc Found f2py2e version '2.43.239_1844' in /users/exp/alted/bin-i686/lib/python/f2py2e/f2py2e.pyc Found scipy_distutils version '0.3.2_33.550' in '/users/exp/alted/bin-i686/lib/python/scipy_distutils/__init__.pyc' ------ Importing scipy_distutils.command.build_flib ... error: No module named build_flib ------ Checking availability of supported Fortran compilers: error: local variable 'build_flib' referenced before assignment ------ Importing scipy_distutils.fcompiler ... ok ------ Checking availability of supported Fortran compilers: List of available Fortran compilers: --fcompiler=gnu GNU Fortran Compiler (3.2.3) For compiler details, run 'config_fc --verbose' setup command. ------ Importing scipy_distutils.command.cpuinfo ... error: No module named cpuinfo Importing scipy_distutils.cpuinfo ... ok ------ CPU information: getNCPUs has_mmx has_sse has_sse2 is_32bit is_Intel ------ ------ Atlas version: [alted at api linalg]$ python -c 'import atlas_version' Traceback (most recent call last): File "", line 1, in ? ImportError: ./atlas_version.so: undefined symbol: ATL_buildinfo This does not seem to work, but my ATLAS version is 3.6.0. I've also read http://math-atlas.sourceforge.net/errata.html#completelp in order to get complete LAPACK support. ------ [alted at api SciPy_complete-0.3.2]$ python scipy_core/scipy_distutils/system_info.py _pkg_config_info: NOT AVAILABLE agg2_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE atlas_blas_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) system_info.atlas_blas_info ( include_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/include:/usr/include ) ( paths: /users/exp/alted/bin-i686/lib/atlas/cblas.h,/users/exp/alted/bin-i686/lib/atlas/cblas.h ) FOUND: libraries = ['f77blas', 'cblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = c include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] atlas_blas_threads_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) system_info.atlas_blas_threads_info ( include_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/include:/usr/include ) ( paths: /users/exp/alted/bin-i686/lib/atlas/cblas.h,/users/exp/alted/bin-i686/lib/atlas/cblas.h ) FOUND: libraries = ['ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = c include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] atlas_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/liblapack.a ) system_info.atlas_info ( include_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/include:/usr/include ) ( paths: /users/exp/alted/bin-i686/lib/atlas/cblas.h,/users/exp/alted/bin-i686/lib/atlas/cblas.h ) FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = f77 include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] atlas_threads_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/liblapack.a ) system_info.atlas_threads_info ( include_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/include:/usr/include ) ( paths: /users/exp/alted/bin-i686/lib/atlas/cblas.h,/users/exp/alted/bin-i686/lib/atlas/cblas.h ) FOUND: libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = f77 include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] blas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/libblas.so ) FOUND: libraries = ['blas'] library_dirs = ['/usr/lib'] language = f77 blas_opt_info: running build_src building extension "atlas_version" sources adding 'build/src/atlas_version_0x32c8fc2f.c' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext FOUND: libraries = ['ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = c define_macros = [('ATLAS_INFO', '"\\"3.2.1_pre3.3.6\\""')] include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] blas_src_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE boost_python_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE dfftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE dfftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE djbfft_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE fftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE fftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE freetype2_info: NOT AVAILABLE gdk_2_info: FOUND: libraries = ['gdk-x11-2.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_2_INFO', '"\\"2.2.4\\""'), ('GDK_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_info: FOUND: libraries = ['gdk', 'Xi', 'Xext', 'X11', 'm', 'glib'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('GDK_INFO', '"\\"1.2.10\\""'), ('GDK_VERSION_1_2_10', None)] include_dirs = ['/usr/include/gtk-1.2', '/usr/X11R6/include', '/usr/include/glib-1.2', '/usr/lib/glib/include'] gdk_pixbuf_2_info: FOUND: libraries = ['gdk_pixbuf-2.0', 'm', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_PIXBUF_2_INFO', '"\\"2.2.4\\""'), ('GDK_PIXBUF_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_pixbuf_xlib_2_info: FOUND: libraries = ['gdk_pixbuf_xlib-2.0', 'gdk_pixbuf-2.0', 'm', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_PIXBUF_XLIB_2_INFO', '"\\"2.2.4\\""'), ('GDK_PIXBUF_XLIB_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_x11_2_info: FOUND: libraries = ['gdk-x11-2.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_X11_2_INFO', '"\\"2.2.4\\""'), ('GDK_X11_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gtkp_2_info: FOUND: libraries = ['gtk-x11-2.0', 'gdk-x11-2.0', 'atk-1.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GTKP_2_INFO', '"\\"2.2.4\\""'), ('GTK_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/atk-1.0', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gtkp_x11_2_info: FOUND: libraries = ['gtk-x11-2.0', 'gdk-x11-2.0', 'atk-1.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GTKP_X11_2_INFO', '"\\"2.2.4\\""'), ('GTK_X11_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/atk-1.0', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] lapack_atlas_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) system_info.lapack_atlas_info NOT AVAILABLE lapack_atlas_threads_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) system_info.lapack_atlas_threads_info NOT AVAILABLE lapack_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/liblapack.so ) FOUND: libraries = ['lapack'] library_dirs = ['/usr/lib'] language = f77 lapack_opt_info: /scratch1/alted/SciPy_complete-0.3.2/scipy_core/scipy_distutils/system_info.py:812: FutureWarning: hex()/oct() of negative int will return a signed string in Python 2.4 and up magic = hex(hash(`config`)) running build_src building extension "atlas_version" sources adding 'build/src/atlas_version_0xe6b7fbc8.c' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext customize GnuFCompiler customize GnuFCompiler customize GnuFCompiler using build_ext FOUND: libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = f77 define_macros = [('ATLAS_INFO', '"\\"3.2.1_pre3.3.6\\""')] include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] lapack_src_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE numarray_info: ( include_dirs = /usr/include/python2.3 ) ( paths: /usr/include/python2.3/numarray/arrayobject.h ) FOUND: define_macros = [('NUMARRAY_VERSION', '"\\"1.1\\""')] include_dirs = ['/usr/include/python2.3'] numpy_info: ( include_dirs = /usr/include/python2.3 ) ( paths: /usr/include/python2.3/Numeric/arrayobject.h ) FOUND: define_macros = [('NUMERIC_VERSION', '"\\"23.3\\""')] include_dirs = ['/usr/include/python2.3'] sfftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE sfftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE wx_info: FOUND: libraries = ['wx_gtk-2.5'] extra_link_args = ['-pthread'] library_dirs = ['/users/exp/alted/bin-i686//lib', '/usr/X11R6/lib'] define_macros = [('WX_INFO', '"\\"2.5.2\\""'), ('WX_VERSION_2_5_2', None), ('WX_RELEASE_2_5', None), ('GTK_NO_CHECK_CASTS', None), ('__WXGTK__', None), ('_FILE_OFFSET_BITS', '64'), ('_LARGE_FILES', None)] include_dirs = ['/users/exp/alted/bin-i686//lib/wx/include/gtk-2.5', '/users/exp/alted/bin-i686//include/wx-2.5'] x11_info: ( library_dirs = /usr/X11R6/lib:/usr/lib ) ( include_dirs = /usr/X11R6/include:/usr/include ) ( paths: /usr/X11R6/lib/libX11.so ) ( paths: /usr/X11R6/include/X11/X.h ) FOUND: libraries = ['X11'] library_dirs = ['/usr/X11R6/lib'] include_dirs = ['/usr/X11R6/include'] xft_info: FOUND: libraries = ['Xft', 'X11', 'freetype', 'Xrender', 'fontconfig'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('XFT_INFO', '"\\"2.1.2\\""'), ('XFT_VERSION_2_1_2', None)] include_dirs = ['/usr/X11R6/include', '/usr/include/freetype2'] [alted at api SciPy_complete-0.3.2]$ python scipy_core/scipy_distutils/command/build python: can't open file 'scipy_core/scipy_distutils/command/build' ??? Other useful information: Running RedHat Linux with Linux api.uji.es 2.4.21-20.ELsmp #1 SMP Wed Aug 18 20:46:40 EDT 2004 i686 i686 i386 GNU/Linux From pearu at scipy.org Fri Oct 15 07:44:17 2004 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 15 Oct 2004 06:44:17 -0500 (CDT) Subject: [SciPy-user] Problems testing SciPy 0.3.2 In-Reply-To: <200410151228.36231.falted@pytables.org> References: <200410151228.36231.falted@pytables.org> Message-ID: On Fri, 15 Oct 2004, Francesc Alted wrote: > I've just installed the newest SciPy 0.3.2, and all tests seems to pass > well, except 15 (out of 574). All of them are caused by the same reason, > which ultimately is: > > File "/users/exp/alted/bin-i686/lib/python/scipy/special/orthogonal.py", line 91, in get_eig_func > eig = scipy.linalg.eig > AttributeError: 'module' object has no attribute 'eig' > > I'm attaching the information required in the INSTALL.txt for reporting bugs. Thanks for the information. The reason for this problem should be looked at your note: """ [alted at api linalg]$ python -c 'import atlas_version' Traceback (most recent call last): File "", line 1, in ? ImportError: ./atlas_version.so: undefined symbol: ATL_buildinfo This does not seem to work, but my ATLAS version is 3.6.0. I've also read http://math-atlas.sourceforge.net/errata.html#completelp in order to get complete LAPACK support. """ Where your ATLAS-3.6.0 libraries are located? Did you use ATLAS environment variable to specify the location? scipy_distutils seems to find only ATLAS-3.2.1 or ATLAS-pre3.3.6 libraries in /users/exp/alted/bin-i686/lib/atlas/. The fact that using ATLAS-3.2.1_pre3.3.6 libraries fail with the "undefined symbol: ATL_buildinfo" message indicates some bug in scipy (I can reproduce it, so I'll fix it). Pearu From falted at pytables.org Fri Oct 15 08:06:36 2004 From: falted at pytables.org (Francesc Alted) Date: Fri, 15 Oct 2004 14:06:36 +0200 Subject: [SciPy-user] Problems testing SciPy 0.3.2 In-Reply-To: References: <200410151228.36231.falted@pytables.org> Message-ID: <200410151406.36553.falted@pytables.org> Hi Peauru, A Divendres 15 Octubre 2004 13:44, Pearu Peterson va escriure: > Where your ATLAS-3.6.0 libraries are located? Did you use ATLAS > environment variable to specify the location? They are at: $ ll /users/exp/alted/bin-i686/lib/atlas/ total 12460 -rw-r--r-- 1 alted exp 33895 oct 15 11:26 cblas.h -rw-r--r-- 1 alted exp 8225 oct 15 11:26 clapack.h -rw-r--r-- 1 alted exp 6569928 oct 15 11:24 libatlas.a -rw-r--r-- 1 alted exp 205476 oct 15 11:24 libcblas.a -rw-r--r-- 1 alted exp 233716 oct 15 11:24 libf77blas.a -rw-r--r-- 1 alted exp 4963424 oct 15 11:24 liblapack.a -rw-r--r-- 1 alted exp 205954 oct 15 11:24 libptcblas.a -rw-r--r-- 1 alted exp 234084 oct 15 11:24 libptf77blas.a -rw-r--r-- 1 alted exp 234972 oct 15 11:24 libtstatlas.a and yes, I've used $ATLAS $ echo $ATLAS /users/exp/alted/bin-i686/lib/atlas > scipy_distutils seems to find only ATLAS-3.2.1 or ATLAS-pre3.3.6 > libraries in /users/exp/alted/bin-i686/lib/atlas/. I don't know why this is happening. I'm sure that I've installed the 3.6.0 version (it is the latest stable, isn't it?). I did make a strip (i.e. strip out all the debugging info) on the ATLAS libraries. Would that cause some problem? Thanks, -- Francesc Alted From fonnesbeck at gmail.com Fri Oct 15 09:18:50 2004 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Fri, 15 Oct 2004 09:18:50 -0400 Subject: [SciPy-user] multiple windows in gplt In-Reply-To: <416F6B10.1020605@colorado.edu> References: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> <723eb69304101416514ea95ac2@mail.gmail.com> <723eb693041014171414af30d9@mail.gmail.com> <3539.200.162.216.175.1097800079.squirrel@200.162.216.175> <723eb69304101417535e5b8389@mail.gmail.com> <416F6B10.1020605@colorado.edu> Message-ID: <723eb6930410150618489b4196@mail.gmail.com> On Fri, 15 Oct 2004 00:15:44 -0600, Fernando Perez wrote: > Hi Chris, > > sorry if I haven't followed this thread in detail, but you might want to > consider using the plain (non-scipy) gnuplot.py interface, perhaps with the > additions which ipython provides to make the syntax easier to use. > I did play with Gnuplot.py for a bit, but I need either jpg or png output, and Gnuplot.py only offers postscript (as far as I can see, anyhow). Thanks for the idea. From fonnesbeck at gmail.com Fri Oct 15 09:22:49 2004 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Fri, 15 Oct 2004 09:22:49 -0400 Subject: [SciPy-user] multiple windows in gplt In-Reply-To: <4264.200.162.216.175.1097804418.squirrel@200.162.216.175> References: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> <723eb69304101416514ea95ac2@mail.gmail.com> <723eb693041014171414af30d9@mail.gmail.com> <3539.200.162.216.175.1097800079.squirrel@200.162.216.175> <723eb69304101417535e5b8389@mail.gmail.com> <4264.200.162.216.175.1097804418.squirrel@200.162.216.175> Message-ID: <723eb69304101506223bde78ec@mail.gmail.com> On Thu, 14 Oct 2004 20:40:18 -0500 (CDT), krivilli at unberwoot.net wrote: > -This is different then use time_series() two times for two different data > sets. Something like: > > class time_series(params,...): > def __init__(): > . > . > . > > def plot(data): > #same code for ploting here > . > . > . > > MyClass = time_series(foo,...) > > MyClass.plot(data1) > MyClass.plot(data2) > > -This isn't quite the same. Actually, I only have one instance of a "Plotter" class, that gets passed around to objects that need it to plot for them. So it is more like: class Plotter: def plot(self, data): class Thing: def plot(self, plotter): plotter.plot(self.time_series) p = Plotter() t1 = Thing() t2 = Thing() t1.plot(p) t2.plot(p) From krivilli at unberwoot.net Fri Oct 15 09:57:21 2004 From: krivilli at unberwoot.net (krivilli at unberwoot.net) Date: Fri, 15 Oct 2004 08:57:21 -0500 (CDT) Subject: [SciPy-user] multiple windows in gplt Message-ID: <20869.200.18.53.197.1097848641.squirrel@200.18.53.197> HI, Chris Fonnesbeck wrote: > On Thu, 14 Oct 2004 20:40:18 -0500 (CDT), krivilli at unberwoot.net > wrote: > >>-This is different then use time_series() two times for two different data >>sets. Something like: >> >>class time_series(params,...): >> def __init__(): >> . >> . >> . >> >> def plot(data): >> #same code for ploting here >> . >> . >> . >> >>MyClass = time_series(foo,...) >> >>MyClass.plot(data1) >>MyClass.plot(data2) >> >>-This isn't quite the same. > > > Actually, I only have one instance of a "Plotter" class, that gets > passed around to objects that need it to plot for them. So it is more -Still, would be a different scope. Hence different than the example i gave which plots everthing on time_series() (no recursive). -Using recursive code, gplt will open a pipe for gnuplot (i think it's pipelined, not sure though) each time. The way it's now, is similar to open more than one gnuplot interactive session. -Using the method replot() (mentioned by Fernando Perez) would be a way to do what u want or use the other example i gave u. > like: > > class Plotter: > > def plot(self, data): > > class Thing: > > def plot(self, plotter): > > plotter.plot(self.time_series) > > p = Plotter() > > t1 = Thing() > t2 = Thing() > > t1.plot(p) > t2.plot(p) > regards, -- roberto (krivilli) From pearu at scipy.org Fri Oct 15 10:50:09 2004 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 15 Oct 2004 09:50:09 -0500 (CDT) Subject: [SciPy-user] Problems testing SciPy 0.3.2 In-Reply-To: <200410151406.36553.falted@pytables.org> References: <200410151228.36231.falted@pytables.org> <200410151406.36553.falted@pytables.org> Message-ID: On Fri, 15 Oct 2004, Francesc Alted wrote: > A Divendres 15 Octubre 2004 13:44, Pearu Peterson va escriure: >> Where your ATLAS-3.6.0 libraries are located? Did you use ATLAS >> environment variable to specify the location? > > They are at: > > $ ll /users/exp/alted/bin-i686/lib/atlas/ > total 12460 > -rw-r--r-- 1 alted exp 33895 oct 15 11:26 cblas.h > -rw-r--r-- 1 alted exp 8225 oct 15 11:26 clapack.h > -rw-r--r-- 1 alted exp 6569928 oct 15 11:24 libatlas.a > -rw-r--r-- 1 alted exp 205476 oct 15 11:24 libcblas.a > -rw-r--r-- 1 alted exp 233716 oct 15 11:24 libf77blas.a > -rw-r--r-- 1 alted exp 4963424 oct 15 11:24 liblapack.a > -rw-r--r-- 1 alted exp 205954 oct 15 11:24 libptcblas.a > -rw-r--r-- 1 alted exp 234084 oct 15 11:24 libptf77blas.a > -rw-r--r-- 1 alted exp 234972 oct 15 11:24 libtstatlas.a > > and yes, I've used $ATLAS > > $ echo $ATLAS > /users/exp/alted/bin-i686/lib/atlas > >> scipy_distutils seems to find only ATLAS-3.2.1 or ATLAS-pre3.3.6 >> libraries in /users/exp/alted/bin-i686/lib/atlas/. > > I don't know why this is happening. I'm sure that I've installed the 3.6.0 > version (it is the latest stable, isn't it?). I did make a strip (i.e. strip > out all the debugging info) on the ATLAS libraries. Would that cause some > problem? I am not sure. Could you try the following program http://math-atlas.sourceforge.net/faq.html#probeV to test for a atlas version number and send its output to me? Pearu From oliphant at ee.byu.edu Fri Oct 15 10:49:41 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Fri, 15 Oct 2004 08:49:41 -0600 Subject: [SciPy-user] multiplying matrices In-Reply-To: References: <41520E6E.8000201@telus.net> Message-ID: <416FE385.2040005@ee.byu.edu> Alan G Isaac wrote: >On Wed, 22 Sep 2004, David Grant apparently wrote: > > >>Is there any way to multiple a whole bunch of matrices >>together easily? Ideally, the * operator would be for >>matrix multiplication as opposed to element-by-element >>multiplication. I've been doing this: >>listofmatricies = [blah, blah, blah, ....] >>return reduce(matrixmultiply,listofmatricies) >>Seems to work, but it would nice to be able to do it in >>one line as in matlab. >> >> > > > Note that scipy has the easy-to-type commands mat and bmat mat will take a string like '1,2;3,4' to build a matrix and bmat takes 2-d matrices and builds other 2-d matrices with them. Once you get matrices you can use * for matrix multiplication and use the special methods .H Hermitian transpose .T transpose .I inverse .A (return the equivalent 2-d array) (i.e. for element-by-element multiplying) -Travis . From falted at pytables.org Fri Oct 15 11:59:36 2004 From: falted at pytables.org (Francesc Alted) Date: Fri, 15 Oct 2004 17:59:36 +0200 Subject: [SciPy-user] Problems testing SciPy 0.3.2 In-Reply-To: References: <200410151228.36231.falted@pytables.org> <200410151406.36553.falted@pytables.org> Message-ID: <200410151759.36684.falted@pytables.org> A Divendres 15 Octubre 2004 16:50, Pearu Peterson va escriure: > > I don't know why this is happening. I'm sure that I've installed the 3.6.0 > > version (it is the latest stable, isn't it?). I did make a strip (i.e. strip > > out all the debugging info) on the ATLAS libraries. Would that cause some > > problem? > > I am not sure. I can confirm that *this* was the problem on getting the correct ATLAS version. > Could you try the following program > > http://math-atlas.sourceforge.net/faq.html#probeV Without stripping libraries: $ gcc xprint_buildinfo.c -o xprint_buildinfo -L $ATLAS -latlas [alted at api alted]$ ./xprint_buildinfo ATLAS version 3.6.0 built by alted on vie oct 15 17:02:42 CEST 2004: UNAME : Linux api.uji.es 2.4.21-20.ELsmp #1 SMP Wed Aug 18 20:46:40 EDT 2004 i686 i686 i386 GNU/Linux INSTFLG : MMDEF : /scratch1/alted/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/gemm ARCHDEF : /scratch1/alted/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/misc F2CDEFS : -DAdd__ -DStringSunStyle CACHEEDGE: 1048576 F77 : /usr/bin/g77, version GNU Fortran (GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-42)) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) F77FLAGS : -fomit-frame-pointer -O CC : /usr/bin/gcc, version gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) CC FLAGS : -fomit-frame-pointer -O3 -funroll-all-loops MCC : /usr/bin/gcc, version gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) MCCFLAGS : -fomit-frame-pointer -O Stripping the libraries: $ strip ATLAS/lib/Linux_P4SSE2_2/*.a $ gcc xprint_buildinfo.c -o xprint_buildinfo -L ATLAS/lib/Linux_P4SSE2_2 -latlas /tmp/ccyNzrVf.o(.text+0x11): In function `main': : undefined reference to `ATL_buildinfo' collect2: ld returned 1 exit status So, I removed scipy from python repository, deleted scipy source dir, unpacked it again, recompiled it *against* the new, corrected ATLAS libs, and... the same problem remains. However, now the number of tests are 600 instead of 574 with the stripped libs. The number of failed tests are 15 as before. I'm attaching the complete output of $ python scipy_core/scipy_distutils/system_info.py command. One of the error looks like: ====================================================================== ERROR: check_sh_legendre (scipy.special.basic.test_basic.test_sh_legendre) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/special/tests/test_basic.py", line 1806, in check_sh_legendre Ps1 = sh_legendre(1) File "/users/exp/alted/bin-i686//lib/python/scipy/special/orthogonal.py", line 593, in sh_legendre x,w,mu0 = ps_roots(n,mu=1) File "/users/exp/alted/bin-i686//lib/python/scipy/special/orthogonal.py", line 584, in ps_roots return js_roots(n,1.0,1.0,mu=mu) File "/users/exp/alted/bin-i686//lib/python/scipy/special/orthogonal.py", line 205, in js_roots val = gen_roots_and_weights(n,an_Js,sbn_Js,mu0) File "/users/exp/alted/bin-i686//lib/python/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/users/exp/alted/bin-i686//lib/python/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' Cheers, -- Francesc Alted From falted at pytables.org Fri Oct 15 12:02:15 2004 From: falted at pytables.org (Francesc Alted) Date: Fri, 15 Oct 2004 18:02:15 +0200 Subject: [SciPy-user] Problems testing SciPy 0.3.2 In-Reply-To: References: <200410151228.36231.falted@pytables.org> <200410151406.36553.falted@pytables.org> Message-ID: <200410151802.15453.falted@pytables.org> Ooops! my finger went too fast pressing to send button. Here it is the output for "python scipy_core/scipy_distutils/system_info.py" on my system. -- Francesc Alted --------------------------------------------------------------------- $ python scipy_core/scipy_distutils/system_info.py _pkg_config_info: NOT AVAILABLE agg2_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE atlas_blas_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) system_info.atlas_blas_info ( include_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/include:/usr/include ) ( paths: /users/exp/alted/bin-i686/lib/atlas/cblas.h,/users/exp/alted/bin-i686/lib/atlas/cblas.h ) FOUND: libraries = ['f77blas', 'cblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = c include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] atlas_blas_threads_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) system_info.atlas_blas_threads_info ( include_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/include:/usr/include ) ( paths: /users/exp/alted/bin-i686/lib/atlas/cblas.h,/users/exp/alted/bin-i686/lib/atlas/cblas.h ) FOUND: libraries = ['ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = c include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] atlas_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/liblapack.a ) system_info.atlas_info ( include_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/include:/usr/include ) ( paths: /users/exp/alted/bin-i686/lib/atlas/cblas.h,/users/exp/alted/bin-i686/lib/atlas/cblas.h ) FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = f77 include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] atlas_threads_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/liblapack.a ) system_info.atlas_threads_info ( include_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/include:/usr/include ) ( paths: /users/exp/alted/bin-i686/lib/atlas/cblas.h,/users/exp/alted/bin-i686/lib/atlas/cblas.h ) FOUND: libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = f77 include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] blas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/libblas.so ) FOUND: libraries = ['blas'] library_dirs = ['/usr/lib'] language = f77 blas_opt_info: running build_src building extension "atlas_version" sources adding 'build/src/atlas_version_0x32c8fc2f.c' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext building 'atlas_version' extension compiling C sources gcc options: '-pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC' compile options: '-I/users/exp/alted/bin-i686/lib/atlas -I/usr/include/python2.3 -c' gcc: build/src/atlas_version_0x32c8fc2f.c gcc -pthread -shared build/temp.linux-i686-2.3/build/src/atlas_version_0x32c8fc2f.o -L/users/exp/alted/bin-i686/lib/atlas -latlas -o build/temp.linux-i686-2.3/atlas_version.so FOUND: libraries = ['ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = c define_macros = [('ATLAS_INFO', '"\\"3.6.0\\""')] include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] blas_src_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE boost_python_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE dfftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE dfftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE djbfft_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE fftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE fftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE freetype2_info: NOT AVAILABLE gdk_2_info: FOUND: libraries = ['gdk-x11-2.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_2_INFO', '"\\"2.2.4\\""'), ('GDK_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_info: FOUND: libraries = ['gdk', 'Xi', 'Xext', 'X11', 'm', 'glib'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('GDK_INFO', '"\\"1.2.10\\""'), ('GDK_VERSION_1_2_10', None)] include_dirs = ['/usr/include/gtk-1.2', '/usr/X11R6/include', '/usr/include/glib-1.2', '/usr/lib/glib/include'] gdk_pixbuf_2_info: FOUND: libraries = ['gdk_pixbuf-2.0', 'm', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_PIXBUF_2_INFO', '"\\"2.2.4\\""'), ('GDK_PIXBUF_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_pixbuf_xlib_2_info: FOUND: libraries = ['gdk_pixbuf_xlib-2.0', 'gdk_pixbuf-2.0', 'm', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_PIXBUF_XLIB_2_INFO', '"\\"2.2.4\\""'), ('GDK_PIXBUF_XLIB_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_x11_2_info: FOUND: libraries = ['gdk-x11-2.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_X11_2_INFO', '"\\"2.2.4\\""'), ('GDK_X11_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gtkp_2_info: FOUND: libraries = ['gtk-x11-2.0', 'gdk-x11-2.0', 'atk-1.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GTKP_2_INFO', '"\\"2.2.4\\""'), ('GTK_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/atk-1.0', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gtkp_x11_2_info: FOUND: libraries = ['gtk-x11-2.0', 'gdk-x11-2.0', 'atk-1.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GTKP_X11_2_INFO', '"\\"2.2.4\\""'), ('GTK_X11_VERSION_2_2_4', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/include/atk-1.0', '/usr/include/pango-1.0', '/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] lapack_atlas_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) system_info.lapack_atlas_info NOT AVAILABLE lapack_atlas_threads_info: ( library_dirs = /users/exp/alted/bin-i686/lib/atlas:/usr/local/lib:/usr/lib ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptf77blas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libptcblas.a ) ( paths: /users/exp/alted/bin-i686/lib/atlas/libatlas.a ) system_info.lapack_atlas_threads_info NOT AVAILABLE lapack_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/lib/liblapack.so ) FOUND: libraries = ['lapack'] library_dirs = ['/usr/lib'] language = f77 lapack_opt_info: /scratch1/alted/SciPy_complete-0.3.2/scipy_core/scipy_distutils/system_info.py:812: FutureWarning: hex()/oct() of negative int will return a signed string in Python 2.4 and up magic = hex(hash(`config`)) running build_src building extension "atlas_version" sources adding 'build/src/atlas_version_0xe6b7fbc8.c' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext customize GnuFCompiler customize GnuFCompiler customize GnuFCompiler using build_ext FOUND: libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] language = f77 define_macros = [('ATLAS_INFO', '"\\"3.6.0\\""')] include_dirs = ['/users/exp/alted/bin-i686/lib/atlas'] lapack_src_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE numarray_info: ( include_dirs = /usr/include/python2.3 ) ( paths: /usr/include/python2.3/numarray/arrayobject.h ) FOUND: define_macros = [('NUMARRAY_VERSION', '"\\"1.1\\""')] include_dirs = ['/usr/include/python2.3'] numpy_info: ( include_dirs = /usr/include/python2.3 ) ( paths: /usr/include/python2.3/Numeric/arrayobject.h ) FOUND: define_macros = [('NUMERIC_VERSION', '"\\"23.3\\""')] include_dirs = ['/usr/include/python2.3'] sfftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE sfftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE wx_info: FOUND: libraries = ['wx_gtk-2.5'] extra_link_args = ['-pthread'] library_dirs = ['/users/exp/alted/bin-i686//lib', '/usr/X11R6/lib'] define_macros = [('WX_INFO', '"\\"2.5.2\\""'), ('WX_VERSION_2_5_2', None), ('WX_RELEASE_2_5', None), ('GTK_NO_CHECK_CASTS', None), ('__WXGTK__', None), ('_FILE_OFFSET_BITS', '64'), ('_LARGE_FILES', None)] include_dirs = ['/users/exp/alted/bin-i686//lib/wx/include/gtk-2.5', '/users/exp/alted/bin-i686//include/wx-2.5'] x11_info: ( library_dirs = /usr/X11R6/lib:/usr/lib ) ( include_dirs = /usr/X11R6/include:/usr/include ) ( paths: /usr/X11R6/lib/libX11.so ) ( paths: /usr/X11R6/include/X11/X.h ) FOUND: libraries = ['X11'] library_dirs = ['/usr/X11R6/lib'] include_dirs = ['/usr/X11R6/include'] xft_info: FOUND: libraries = ['Xft', 'X11', 'freetype', 'Xrender', 'fontconfig'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('XFT_INFO', '"\\"2.1.2\\""'), ('XFT_VERSION_2_1_2', None)] include_dirs = ['/usr/X11R6/include', '/usr/include/freetype2'] From novak at ucolick.org Fri Oct 15 12:21:33 2004 From: novak at ucolick.org (Greg Novak) Date: Fri, 15 Oct 2004 09:21:33 -0700 Subject: [SciPy-user] Re: integrate.odeint In-Reply-To: <20041015011552.84AFB3EB51@www.scipy.com> References: <20041015011552.84AFB3EB51@www.scipy.com> Message-ID: <20041015162133.GA26073@dionysus.ucolick.org> > Subject: [SciPy-user] integrate.odeint question > The documentation doesn't seem to give much information on how this > function works. Does anyone have pointers to what numerical methods > are implemented by this function and what the optional parameters mean > in detail? Speaking of integrate.odeint, I have a feature suggestion. Supplying a Python function to compute the derivatives of the ode system is great for quick, undemanding problems, but the Python function call overhead seems to completely, utterly kill performance for demanding applications. What I'd like to see is a function exactly like odeint (maybe called c_odeint), except instead of a Python function you give it a string with C code that defines a function that computes the derivatives. C_odeint will compile the function with Weave and then you can do the whole integration in C. This is much faster, in my experience. I have code to do this. I don't know if everyone will like the way I've set it up (it's basically the first thing I've written that involves Python), but I'm happy to send it along. Anyone who's interested in this, please let me know. Greg From pearu at scipy.org Fri Oct 15 13:40:12 2004 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 15 Oct 2004 12:40:12 -0500 (CDT) Subject: [SciPy-user] Problems testing SciPy 0.3.2 In-Reply-To: <200410151759.36684.falted@pytables.org> References: <200410151228.36231.falted@pytables.org> <200410151406.36553.falted@pytables.org> <200410151759.36684.falted@pytables.org> Message-ID: On Fri, 15 Oct 2004, Francesc Alted wrote: > So, I removed scipy from python repository, deleted scipy source dir, > unpacked it again, recompiled it *against* the new, corrected ATLAS libs, > and... the same problem remains. However, now the number of tests are 600 > instead of 574 with the stripped libs. The number of failed tests are 15 as > before. Could you try building scipy against the following ATLAS library: http://www.scipy.org/download/atlasbinaries/linux/atlas3.6.0_Linux_P4SSE2.tgz (it contains complete lapack, so just unpack the .tgz file and point ATLAS environment variable to the lib directory)? Also, do the following commands work? cd Lib/lapack python setup_atlas_version.py build_ext --inplace python -c 'import atlas_version' Pearu From narnett at mccmedia.com Fri Oct 15 13:47:42 2004 From: narnett at mccmedia.com (Nick Arnett) Date: Fri, 15 Oct 2004 10:47:42 -0700 Subject: [SciPy-user] lingalg.svd performance? Message-ID: <41700D3E.2090703@mccmedia.com> What sort of performance should I expect using lingalg.svd on matrixes on the order of 500 x 15000? I'm using a 2 Ghz P4 system with 2 GB of memory and these are taking hours to complete. I previously was using an external SVD utility that was taking a couple of minutes, and I'm going to have to switch back to it unless there's some way to get Scipy to do this a lot faster. I'm using the pre-built binaries, with ATLAS and F2PY installed. I'm not eager to build my own, but if that is likely to speed things up a lot, I'll give it a shot. Any help will be gratefully appreciated. Nick From narnett at mccmedia.com Fri Oct 15 13:50:05 2004 From: narnett at mccmedia.com (Nick Arnett) Date: Fri, 15 Oct 2004 10:50:05 -0700 Subject: [SciPy-user] lingalg.svd performance? In-Reply-To: <41700D3E.2090703@mccmedia.com> References: <41700D3E.2090703@mccmedia.com> Message-ID: <41700DCD.4020604@mccmedia.com> Nick Arnett wrote: > What sort of performance should I expect using lingalg.svd on matrixes > on the order of 500 x 15000? ... I probably should have mentioned that this is on a Windows 2000 system. I've been trying to get it to also run on a 4-processor Sparc box, but can't manage to compile Numeric on Solaris. Nick From novak at ucolick.org Fri Oct 15 15:04:05 2004 From: novak at ucolick.org (Greg Novak) Date: Fri, 15 Oct 2004 12:04:05 -0700 Subject: [SciPy-user] [novak@ucolick.org: Re: integrate.odeint] Message-ID: <20041015190405.GE26073@dionysus.ucolick.org> I have an extremely unfocused question. I've written a bit of code that uses scipy to compute Lyapunov exponents for a particular dynamical system. The only subtlety (mentioned in a recent e-mail) is that I don't use integrate.odeint() but rather my own home-brew routine that functions like odeint, but instead of taking a python function it takes a string with C code that it compiles (along with an ode integrator from Numerical Recipes) with Weave so that the whole integration happens in C rather than calling back and forth between C/Fortran and Python. Here's the problem: while running last night, this program managed to fill 2 GB of memory and crash. There's no way that 2 GB of memory was required at any given time, so it must be leaking. This is my first real effort in Python, so facing this problem I feel a bit like a babe in the forest. Python has garbage collection and therefore memory leaks must be buried in the "inner workings" of the langauge. Therefore, I'm soliciting advice from the wise men and women of the scipy/python community: what's your strategy for tracking down bugs like this? What sorts of bugs are typical? If I were using the C/Python API directly, I would conclude that I'd messed up reference counts. But the reference counting increment/decrement macros don't appear when you use Weave. So, that's it. Any advice is welcome. Greg From ed at lamedomain.net Fri Oct 15 15:22:06 2004 From: ed at lamedomain.net (Ed Rahn) Date: Fri, 15 Oct 2004 14:22:06 -0500 Subject: [SciPy-user] [novak@ucolick.org: Re: integrate.odeint] In-Reply-To: <20041015190405.GE26073@dionysus.ucolick.org> References: <20041015190405.GE26073@dionysus.ucolick.org> Message-ID: <20041015142206.1f7a5d21@DurbanPoison.lamedomain.net> Hi Greg, Are you taking care of freeing memory in the C code? Python knows nothing about the memory being allocated in it, it's garbage collection and would not be applicable here. regards, Ed On Fri, 15 Oct 2004 12:04:05 -0700 Greg Novak wrote: > I have an extremely unfocused question. > > I've written a bit of code that uses scipy to compute Lyapunov > exponents for a particular dynamical system. The only subtlety > (mentioned in a recent e-mail) is that I don't use integrate.odeint() > but rather my own home-brew routine that functions like odeint, but > instead of taking a python function it takes a string with C code that > it compiles (along with an ode integrator from Numerical Recipes) with > Weave so that the whole integration happens in C rather than calling > back and forth between C/Fortran and Python. > > Here's the problem: while running last night, this program managed to > fill 2 GB of memory and crash. There's no way that 2 GB of memory was > required at any given time, so it must be leaking. > > This is my first real effort in Python, so facing this problem I feel > a bit like a babe in the forest. Python has garbage collection and > therefore memory leaks must be buried in the "inner workings" of the > langauge. > > Therefore, I'm soliciting advice from the wise men and women of the > scipy/python community: what's your strategy for tracking down bugs > like this? What sorts of bugs are typical? If I were using the > C/Python API directly, I would conclude that I'd messed up reference > counts. But the reference counting increment/decrement macros don't > appear when you use Weave. > > So, that's it. Any advice is welcome. > > Greg > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From oliphant at ee.byu.edu Fri Oct 15 16:08:42 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Fri, 15 Oct 2004 14:08:42 -0600 Subject: [SciPy-user] Re: integrate.odeint In-Reply-To: <20041015162133.GA26073@dionysus.ucolick.org> References: <20041015011552.84AFB3EB51@www.scipy.com> <20041015162133.GA26073@dionysus.ucolick.org> Message-ID: <41702E4A.5030203@ee.byu.edu> Greg Novak wrote: >>Subject: [SciPy-user] integrate.odeint question >>The documentation doesn't seem to give much information on how this >>function works. Does anyone have pointers to what numerical methods >>are implemented by this function and what the optional parameters mean >>in detail? >> >> > >Speaking of integrate.odeint, I have a feature suggestion. Supplying >a Python function to compute the derivatives of the ode system is >great for quick, undemanding problems, but the Python function call >overhead seems to completely, utterly kill performance for demanding >applications. > >What I'd like to see is a function exactly like odeint (maybe called >c_odeint), except instead of a Python function you give it a string >with C code that defines a function that computes the derivatives. >C_odeint will compile the function with Weave and then you can do the >whole integration in C. This is much faster, in my experience. > >I have code to do this. I don't know if everyone will like the way >I've set it up (it's basically the first thing I've written that >involves Python), but I'm happy to send it along. Anyone who's >interested in this, please let me know. > > We have been interested in something like this for a while. I would like to see the user be able to write c and/or fortran code to compute the function to be integrated. Yes, the Python function call overhead is signficant. -Travis From rkern at ucsd.edu Fri Oct 15 16:07:31 2004 From: rkern at ucsd.edu (Robert Kern) Date: Fri, 15 Oct 2004 13:07:31 -0700 Subject: [SciPy-user] [novak@ucolick.org: Re: integrate.odeint] In-Reply-To: <20041015190405.GE26073@dionysus.ucolick.org> References: <20041015190405.GE26073@dionysus.ucolick.org> Message-ID: <41702E03.7060103@ucsd.edu> Greg Novak wrote: > Therefore, I'm soliciting advice from the wise men and women of the > scipy/python community: what's your strategy for tracking down bugs > like this? What sorts of bugs are typical? If I were using the > C/Python API directly, I would conclude that I'd messed up reference > counts. But the reference counting increment/decrement macros don't > appear when you use Weave. If you post some of your code (to a website if it's large), we can provide you more focused advice. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From Fernando.Perez at colorado.edu Fri Oct 15 17:36:26 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Fri, 15 Oct 2004 15:36:26 -0600 Subject: [SciPy-user] multiple windows in gplt In-Reply-To: <723eb6930410150618489b4196@mail.gmail.com> References: <19651.200.18.53.197.1097785516.squirrel@200.18.53.197> <723eb69304101416514ea95ac2@mail.gmail.com> <723eb693041014171414af30d9@mail.gmail.com> <3539.200.162.216.175.1097800079.squirrel@200.162.216.175> <723eb69304101417535e5b8389@mail.gmail.com> <416F6B10.1020605@colorado.edu> <723eb6930410150618489b4196@mail.gmail.com> Message-ID: <417042DA.5080402@colorado.edu> Chris Fonnesbeck schrieb: > On Fri, 15 Oct 2004 00:15:44 -0600, Fernando Perez > wrote: > >>Hi Chris, >> >>sorry if I haven't followed this thread in detail, but you might want to >>consider using the plain (non-scipy) gnuplot.py interface, perhaps with the >>additions which ipython provides to make the syntax easier to use. >> > > > I did play with Gnuplot.py for a bit, but I need either jpg or png > output, and Gnuplot.py only offers postscript (as far as I can see, > anyhow). > > Thanks for the idea. It's true that the current code only supports EPS, since that's what I imagine M. Haggerty needed (I never went beyond that since I only use EPS myself). But I just had a look at the code, and it would be very easy to add an option for png/jpg generation. I'll be out of town for a few weeks, so I can't offer to do it myself right now, but I guess I could try to work on it when I get back. Or you could add it yourself, the place to look (if using ipython) is in IPython/Gnuplot2.py, you'd want to extend the existing hardcopy() function to process png/jpeg in addition to PostScript. This may sound like more work than you want to do, but at least I know it addresses easily the multiple-window problem. The other option might be to switch to matplotlib, which maintains the matlab-like syntax but offers a raft of new improvements. Best, f From novak at ucolick.org Fri Oct 15 20:49:11 2004 From: novak at ucolick.org (Greg Novak) Date: Fri, 15 Oct 2004 17:49:11 -0700 Subject: [SciPy-user] Re: SciPy-user Digest, Vol 14, Issue 15 In-Reply-To: <20041015215851.5B7C93EB5C@www.scipy.com> References: <20041015215851.5B7C93EB5C@www.scipy.com> Message-ID: <20041016004911.GE4291@dionysus.ucolick.org> > From: Travis Oliphant > Subject: Re: [SciPy-user] Re: integrate.odeint > > We have been interested in something like this for a while. I would > like to see the user be able to write c and/or fortran code to compute > the function to be integrated. I've collected the code that I wrote for this along with a brief explanation and put it here, in case anyone's interested. http://www.ucolick.org/~novak/integrate.tgz Greg From pearu at scipy.org Sat Oct 16 02:02:37 2004 From: pearu at scipy.org (Pearu Peterson) Date: Sat, 16 Oct 2004 01:02:37 -0500 (CDT) Subject: [SciPy-user] lingalg.svd performance? In-Reply-To: <41700D3E.2090703@mccmedia.com> References: <41700D3E.2090703@mccmedia.com> Message-ID: On Fri, 15 Oct 2004, Nick Arnett wrote: > What sort of performance should I expect using lingalg.svd on matrixes > on the order of 500 x 15000? I'm using a 2 Ghz P4 system with 2 GB of > memory and these are taking hours to complete. I previously was using > an external SVD utility that was taking a couple of minutes, and I'm > going to have to switch back to it unless there's some way to get Scipy > to do this a lot faster. I'm using the pre-built binaries, with ATLAS > and F2PY installed. I'm not eager to build my own, but if that is > likely to speed things up a lot, I'll give it a shot. On a system with AMD Athlon(tm) 64 Processor 3000+ and 2GB memory: - calculating full svd of a 500x15000 matrix takes 5m55s consuming about 1.8g memory - calculating only singular values takes 22s consuming about 0.2g memory Note that the above results do not contain time spent for swaping when memory is low. E.g. on a 1GB system calculating full svd would take forever.. HTH, Pearu Python 2.3.3 (#1, Aug 28 2004, 06:56:51) [GCC 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from scipy import * >>> from scipy_test.testing import jiffies >>> t=jiffies();s=linalg.svd(rand(500,15000),compute_uv=0); print (jiffies()-t)/100,'sec' 22 sec >>> t=jiffies();u,s,vh=linalg.svd(rand(500,15000),compute_uv=1); print (jiffies()-t)/100,'sec' 345 sec >>> import scipy.linalg.atlas_version ATLAS version 3.7.8 built by pearu on Thu Sep 30 23:29:06 EEST 2004: UNAME : Linux opt 2.6.3-gentoo-r2 #1 SMP Sat Aug 28 12:40:32 EEST 2004 x86_64 AMD Opteron(tm) Processor 244 AuthenticAMD GNU/Linux INSTFLG : MMDEF : /usr/local/src/ATLAS-3.7.8/CONFIG/ARCHS/HAMMER64SSE2/gcc/gemm ARCHDEF : /usr/local/src/ATLAS-3.7.8/CONFIG/ARCHS/HAMMER64SSE2/gcc/misc F2CDEFS : -DAdd_ -DStringSunStyle CACHEEDGE: 917504 F77 : /usr/x86_64-pc-linux-gnu/gcc-bin/3.3/g77, version GNU Fortran (GCC) 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6) F77FLAGS : -fomit-frame-pointer -O -m64 -fno-second-underscore -fPIC CC : /usr/bin/gcc, version gcc (GCC) 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6) CC FLAGS : -fomit-frame-pointer -O -mfpmath=387 -m64 -fPIC MCC : /usr/bin/gcc, version gcc (GCC) 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6) MCCFLAGS : -fomit-frame-pointer -O -mfpmath=387 -m64 -fPIC From falted at pytables.org Sat Oct 16 05:31:14 2004 From: falted at pytables.org (Francesc Alted) Date: Sat, 16 Oct 2004 11:31:14 +0200 Subject: [SciPy-user] Problems testing SciPy 0.3.2 In-Reply-To: References: <200410151228.36231.falted@pytables.org> <200410151759.36684.falted@pytables.org> Message-ID: <200410161131.14635.falted@pytables.org> A Divendres 15 Octubre 2004 19:40, Pearu Peterson va escriure: > Could you try building scipy against the following ATLAS library: > > http://www.scipy.org/download/atlasbinaries/linux/atlas3.6.0_Linux_P4SSE2.tgz > > (it contains complete lapack, so just unpack the .tgz file and point > ATLAS environment variable to the lib directory)? > Yes, that works much better. Only 2 errors now: ====================================================================== ERROR: check_random (scipy.linalg.basic.test_basic.test_det) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_basic.py", line 282, in check_random Numeric_det = LinearAlgebra.determinant AttributeError: 'module' object has no attribute 'determinant' ====================================================================== ERROR: check_random_complex (scipy.linalg.basic.test_basic.test_det) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_basic.py", line 292, in check_random_complex Numeric_det = LinearAlgebra.determinant AttributeError: 'module' object has no attribute 'determinant' ---------------------------------------------------------------------- Ran 695 tests in 1.552s FAILED (errors=2) ----------- Curiously enough, if I change the directory to scipy/Lib/linalg, start the python interpreter and run the tests there, everything goes well: ---------------------------------------------------------------------- Ran 600 tests in 1.333s OK ----------- You can note, however, that only 600 tests were executed there. So, it seems that my ATLAS libraries were bad. Uh, I don't know what I was doing wrong, but apparently I repeteated the error twice. That's strange because your instructions in INSTALL.txt were clear enough :-/ Perhaps something wrong with my software versions? gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-42) LAPACK, Version 3.0 (update) Date: May 31, 2000 ATLAS 3.6.0 > Also, do the following commands work? > > cd Lib/lapack > python setup_atlas_version.py build_ext --inplace > python -c 'import atlas_version' Here you are: [alted at api linalg]$ python -c 'import atlas_version' ATLAS version 3.6.0 built by pearu on Sat Apr 10 13:28:37 CDT 2004: UNAME : Linux xp 2.4.25-1-686 #1 Tue Feb 24 10:55:59 EST 2004 i686 GNU/Linux INSTFLG : MMDEF : /home/pearu/src/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/gemm ARCHDEF : /home/pearu/src/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/misc F2CDEFS : -DAdd_ -DStringSunStyle CACHEEDGE: 1048576 F77 : /usr/bin/g77, version GNU Fortran (GCC) 3.3.3 (Debian 20040401) F77FLAGS : -fomit-frame-pointer -O -fno-second-underscore CC : /usr/bin/gcc, version gcc (GCC) 3.3.3 (Debian 20040401) CC FLAGS : -fomit-frame-pointer -O3 -funroll-all-loops MCC : /usr/bin/gcc, version gcc (GCC) 3.3.3 (Debian 20040401) MCCFLAGS : -fomit-frame-pointer -O Now, with my own generated ATLAS libs: [alted at api linalg]$ python -c 'import atlas_version' ATLAS version 3.6.0 built by alted on vie oct 15 17:02:42 CEST 2004: UNAME : Linux api.uji.es 2.4.21-20.ELsmp #1 SMP Wed Aug 18 20:46:40 EDT 2004 i686 i686 i386 GNU/Linux INSTFLG : MMDEF : /scratch1/alted/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/gemm ARCHDEF : /scratch1/alted/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/misc F2CDEFS : -DAdd__ -DStringSunStyle CACHEEDGE: 1048576 F77 : /usr/bin/g77, version GNU Fortran (GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-42)) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) F77FLAGS : -fomit-frame-pointer -O CC : /usr/bin/gcc, version gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) CC FLAGS : -fomit-frame-pointer -O3 -funroll-all-loops MCC : /usr/bin/gcc, version gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) MCCFLAGS : -fomit-frame-pointer -O At first sigth, I can see a difference: the "-fno-second-underscore" flag that you put when compiling, while I didn't put this. Can this account for the problems? Thanks for your help! -- Francesc Alted From pearu at scipy.org Sat Oct 16 06:39:21 2004 From: pearu at scipy.org (Pearu Peterson) Date: Sat, 16 Oct 2004 05:39:21 -0500 (CDT) Subject: [SciPy-user] Problems testing SciPy 0.3.2 In-Reply-To: <200410161131.14635.falted@pytables.org> References: <200410151228.36231.falted@pytables.org> <200410151759.36684.falted@pytables.org> <200410161131.14635.falted@pytables.org> Message-ID: On Sat, 16 Oct 2004, Francesc Alted wrote: > Yes, that works much better. Only 2 errors now: > > ====================================================================== > ERROR: check_random (scipy.linalg.basic.test_basic.test_det) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_basic.py", line 282, in check_random > Numeric_det = LinearAlgebra.determinant > AttributeError: 'module' object has no attribute 'determinant' Hmm, don't know why determinant is not defined in your version of LinearAlgebra. > ---------------------------------------------------------------------- > Ran 695 tests in 1.552s > > FAILED (errors=2) > > ----------- > > Curiously enough, if I change the directory to scipy/Lib/linalg, start the > python interpreter and run the tests there, everything goes well: > > ---------------------------------------------------------------------- > Ran 600 tests in 1.333s > > OK > > ----------- > > You can note, however, that only 600 tests were executed there. It could be because python is picking up modules in the current directory that import unexisting extension modules. Actually, scipy has currently about 970 level=0 tests. Look at the beginning of scipy.test() output to see if there are any error messages present. > So, it seems that my ATLAS libraries were bad. Uh, I don't know what I was > doing wrong, but apparently I repeteated the error twice. That's strange > because your instructions in INSTALL.txt were clear enough :-/ Perhaps > something wrong with my software versions? > > gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-42) > LAPACK, Version 3.0 (update) Date: May 31, 2000 > ATLAS 3.6.0 > >> Also, do the following commands work? >> >> cd Lib/lapack >> python setup_atlas_version.py build_ext --inplace >> python -c 'import atlas_version' > > Here you are: > > [alted at api linalg]$ python -c 'import atlas_version' > ATLAS version 3.6.0 built by pearu on Sat Apr 10 13:28:37 CDT 2004: > UNAME : Linux xp 2.4.25-1-686 #1 Tue Feb 24 10:55:59 EST 2004 i686 GNU/Linux > INSTFLG : > MMDEF : /home/pearu/src/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/gemm > ARCHDEF : /home/pearu/src/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/misc > F2CDEFS : -DAdd_ -DStringSunStyle > CACHEEDGE: 1048576 > F77 : /usr/bin/g77, version GNU Fortran (GCC) 3.3.3 (Debian 20040401) > F77FLAGS : -fomit-frame-pointer -O -fno-second-underscore > CC : /usr/bin/gcc, version gcc (GCC) 3.3.3 (Debian 20040401) > CC FLAGS : -fomit-frame-pointer -O3 -funroll-all-loops > MCC : /usr/bin/gcc, version gcc (GCC) 3.3.3 (Debian 20040401) > MCCFLAGS : -fomit-frame-pointer -O > > Now, with my own generated ATLAS libs: > > [alted at api linalg]$ python -c 'import atlas_version' > ATLAS version 3.6.0 built by alted on vie oct 15 17:02:42 CEST 2004: > UNAME : Linux api.uji.es 2.4.21-20.ELsmp #1 SMP Wed Aug 18 20:46:40 EDT 2004 i686 i686 i386 GNU/Linux > INSTFLG : > MMDEF : /scratch1/alted/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/gemm > ARCHDEF : /scratch1/alted/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/misc > F2CDEFS : -DAdd__ -DStringSunStyle > CACHEEDGE: 1048576 > F77 : /usr/bin/g77, version GNU Fortran (GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-42)) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) > F77FLAGS : -fomit-frame-pointer -O > CC : /usr/bin/gcc, version gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) > CC FLAGS : -fomit-frame-pointer -O3 -funroll-all-loops > MCC : /usr/bin/gcc, version gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) > MCCFLAGS : -fomit-frame-pointer -O > > At first sigth, I can see a difference: the "-fno-second-underscore" flag > that you put when compiling, while I didn't put this. Can this account for > the problems? I would not expect that not using '-fno-second-underscore' would cause problems as blas/lapack libraries do not contain symbols having underscores in their names and so the libraries should be identical (unless I missed something). But you could try building atlas with '-fno-second-underscore' (and check that F2CDEFS contains then -DAdd_, not -DAdd__). If the resulting atlas library will be still bad then I'd suspect a compiler bug. Pearu From aisaac at american.edu Sat Oct 16 12:15:52 2004 From: aisaac at american.edu (Alan G Isaac) Date: Sat, 16 Oct 2004 12:15:52 -0400 (Eastern Daylight Time) Subject: [SciPy-user] multiplying matrices In-Reply-To: <416FE385.2040005@ee.byu.edu> References: <41520E6E.8000201@telus.net> <416FE385.2040005@ee.byu.edu> Message-ID: On Fri, 15 Oct 2004, Travis Oliphant apparently wrote: > bmat takes 2-d matrices and builds other 2-d matrices with them. Cool. But bmat is missing from the tutorial, I believe. Thanks, Alan Isaac From andrewl at acay.com.au Sun Oct 17 10:11:26 2004 From: andrewl at acay.com.au (andrewl at acay.com.au) Date: Mon, 18 Oct 2004 00:11:26 +1000 Subject: [SciPy-user] Help please: Test failure: AttributeError: 'module' object has no attribute 'eig' * 15 Message-ID: <200410180011.26446.andrewl@acay.com.au> I cannot install SciPy without getting a number (15) of errors that all resolve to: File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' I can see no import errors. I have installed lapack, blas and atlas from source. The size of the lapack library is ~22M. I have imported the atlas optimised objects into the lapack.a. I have removed all other lapack shared libraries from my system. I have tried 'python setup.py clean' prior to every re-install. Can anyone suggest a way to resolve this? Outputs of the diagnostic runsare attached. (1-5, 6, 7 (part, there is no scipy_core/scipy_distutils/command/build_flib.py in the build)) Output of test (scipy.test(level=1)) follows. Regards, Andrew Lees. ...................................................................................................................Warning: 1000000 bytes requested, 20 bytes read. ......................../usr/lib/python2.3/site-packages/scipy/interpolate/fitpack2.py:412: UserWarning: The coefficients of the spline returned have been computed as the minimal norm least-squares solution of a (numerically) rank deficient system (deficiency=7). If deficiency is large, the results may be inaccurate. Deficiency may strongly depend on the value of eps. warnings.warn(message) ....................................................................................................E........................................................................................................................................................................................EEEE.................................E......EE....................E..........................EEE...........................EEE................................................................................................................................................................................................. ====================================================================== ERROR: check_assoc_laguerre (scipy.special.basic.test_basic.test_assoc_laguerre) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 532, in check_assoc_laguerre a1 = genlaguerre(11,1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 267, in genlaguerre x,w,mu0 = la_roots(n1,alpha,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 251, in la_roots val = gen_roots_and_weights(n,an_La,sbn_La,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_chebyc (scipy.special.basic.test_basic.test_chebyc) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 675, in check_chebyc C0 = chebyc(0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 470, in chebyc x,w,mu0 = c_roots(n1,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 457, in c_roots [x,w,mu0] = j_roots(n,-0.5,-0.5,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 155, in j_roots val = gen_roots_and_weights(n,an_J,sbn_J,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_chebys (scipy.special.basic.test_basic.test_chebys) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 692, in check_chebys S0 = chebys(0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 501, in chebys x,w,mu0 = s_roots(n1,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 488, in s_roots [x,w,mu0] = j_roots(n,0.5,0.5,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 155, in j_roots val = gen_roots_and_weights(n,an_J,sbn_J,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_chebyt (scipy.special.basic.test_basic.test_chebyt) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 709, in check_chebyt T1 = chebyt(1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 419, in chebyt x,w,mu = t_roots(n1,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 405, in t_roots val = gen_roots_and_weights(n,an_J,sbn_J,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_chebyu (scipy.special.basic.test_basic.test_chebyu) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 725, in check_chebyu U1 = chebyu(1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 442, in chebyu base = jacobi(n,0.5,0.5,monic=monic) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 169, in jacobi x,w,mu = j_roots(n,alpha,beta,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 155, in j_roots val = gen_roots_and_weights(n,an_J,sbn_J,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_gegenbauer (scipy.special.basic.test_basic.test_gegenbauer) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1089, in check_gegenbauer Ca1 = gegenbauer(1,a) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 383, in gegenbauer base = jacobi(n,alpha-0.5,alpha-0.5,monic=monic) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 169, in jacobi x,w,mu = j_roots(n,alpha,beta,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 155, in j_roots val = gen_roots_and_weights(n,an_J,sbn_J,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_hermite (scipy.special.basic.test_basic.test_hermite) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1044, in check_hermite H0 = hermite(0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 325, in hermite x,w,mu0 = h_roots(n1,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 312, in h_roots val = gen_roots_and_weights(n,an_H,sbn_H,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_hermitenorm (scipy.special.basic.test_basic.test_hermite) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1060, in check_hermitenorm H0 = hermitenorm(0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 358, in hermitenorm x,w,mu0 = he_roots(n1,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 345, in he_roots val = gen_roots_and_weights(n,an_He,sbn_He,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_jacobi (scipy.special.basic.test_basic.test_jacobi) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1263, in check_jacobi P1 = jacobi(1,a,b) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 169, in jacobi x,w,mu = j_roots(n,alpha,beta,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 155, in j_roots val = gen_roots_and_weights(n,an_J,sbn_J,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_genlaguerre (scipy.special.basic.test_basic.test_laguerre) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1567, in check_genlaguerre lag0 = genlaguerre(0,k) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 267, in genlaguerre x,w,mu0 = la_roots(n1,alpha,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 251, in la_roots val = gen_roots_and_weights(n,an_La,sbn_La,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_laguerre (scipy.special.basic.test_basic.test_laguerre) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1552, in check_laguerre lag0 = laguerre(0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 292, in laguerre x,w,mu0 = l_roots(n1,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 283, in l_roots return la_roots(n,0.0,mu=mu) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 251, in la_roots val = gen_roots_and_weights(n,an_La,sbn_La,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_legendre (scipy.special.basic.test_basic.test_legendre) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1581, in check_legendre leg0 = legendre(0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 569, in legendre x,w,mu0 = p_roots(n1,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 560, in p_roots return j_roots(n,0.0,0.0,mu=mu) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 155, in j_roots val = gen_roots_and_weights(n,an_J,sbn_J,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_sh_chebyu (scipy.special.basic.test_basic.test_sh_chebyu) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1855, in check_sh_chebyu Us1 = sh_chebyu(1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 547, in sh_chebyu base = sh_jacobi(n,2.0,1.5,monic=monic) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 228, in sh_jacobi x,w,mu0 = js_roots(n1,p,q,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 205, in js_roots val = gen_roots_and_weights(n,an_Js,sbn_Js,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_sh_jacobi (scipy.special.basic.test_basic.test_sh_jacobi) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1883, in check_sh_jacobi G1 = sh_jacobi(1,p,q) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 228, in sh_jacobi x,w,mu0 = js_roots(n1,p,q,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 205, in js_roots val = gen_roots_and_weights(n,an_Js,sbn_Js,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ====================================================================== ERROR: check_sh_legendre (scipy.special.basic.test_basic.test_sh_legendre) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1806, in check_sh_legendre Ps1 = sh_legendre(1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 593, in sh_legendre x,w,mu0 = ps_roots(n,mu=1) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 584, in ps_roots return js_roots(n,1.0,1.0,mu=mu) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 205, in js_roots val = gen_roots_and_weights(n,an_Js,sbn_Js,mu0) File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 121, in gen_roots_and_weights eig = get_eig_func() File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, in get_eig_func eig = scipy.linalg.eig AttributeError: 'module' object has no attribute 'eig' ---------------------------------------------------------------------- Ran 743 tests in 1.381s FAILED (errors=15) >>> -------------- next part -------------- ------ os.name='posix' ------ sys.platform='linux2' ------ sys.version: 2.3.4 (#2, Aug 19 2004, 15:49:40) [GCC 3.4.1 (Mandrakelinux (Alpha 3.4.1-3mdk)] ------ 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/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' ------ Failed to import numarray: No module named numarray Found Numeric version '23.1' in /usr/lib/python2.3/site-packages/Numeric/Numeric.pyc Found f2py2e version '2.39.235_1693' in /usr/lib/python2.3/site-packages/f2py2e/f2py2e.pyc Found scipy_distutils version '0.3.2_27.455' in '/usr/lib/python2.3/site-packages/scipy_distutils/__init__.pyc' ------ Importing scipy_distutils.command.build_flib ... error: No module named build_flib ------ Checking availability of supported Fortran compilers: error: local variable 'build_flib' referenced before assignment ------ Importing scipy_distutils.fcompiler ... ok ------ Checking availability of supported Fortran compilers: customize CompaqFCompiler customize AbsoftFCompiler Could not locate executable ifort Could not locate executable ifc Could not locate executable efort Could not locate executable efc Could not locate executable ifort customize IntelFCompiler customize GnuFCompiler customize SunFCompiler customize VastFCompiler customize IbmFCompiler customize LaheyFCompiler customize IntelVisualFCompiler customize IntelItaniumFCompiler customize PGroupFCompiler customize CompaqVisualFCompiler customize MipsFCompiler customize HPUXFCompiler customize IntelItaniumVisualFCompiler customize NAGFCompiler List of available Fortran compilers: --fcompiler=gnu GNU Fortran Compiler (3.4.1) List of unavailable Fortran compilers: --fcompiler=absoft Absoft Corp Fortran Compiler --fcompiler=compaq Compaq Fortran Compiler --fcompiler=compaqv DIGITAL|Compaq Visual 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=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 scipy_distutils.command.cpuinfo ... error: No module named cpuinfo Importing scipy_distutils.cpuinfo ... ok ------ CPU information: getNCPUs has_mmx has_sse has_sse2 is_32bit is_Intel is_Pentium is_i686 is_singleCPU ------ -------------- next part -------------- ATLAS version 3.6.0 built by root on Sat Oct 16 21:46:04 EST 2004: UNAME : Linux tornado3.diamond.local 2.6.8.1-10mdkcustom #2 Sun Sep 26 21:48:43 EST 2004 i686 Intel(R) Pentium(R) M processor 1500MHz unknown GNU/Linux INSTFLG : MMDEF : /home/andrewl/Src/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/gemm ARCHDEF : /home/andrewl/Src/ATLAS/CONFIG/ARCHS/P4SSE2/gcc/misc F2CDEFS : -DAdd__ -DStringSunStyle CACHEEDGE: 1048576 F77 : /usr/bin/g77, version GNU Fortran (GCC) 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk) F77FLAGS : -fomit-frame-pointer -O CC : /usr/bin/gcc, version gcc (GCC) 3.3.4 (Mandrakelinux 10.1 3.3.4-1mdk) CC FLAGS : -fomit-frame-pointer -O3 -funroll-all-loops MCC : /usr/bin/gcc, version gcc (GCC) 3.3.4 (Mandrakelinux 10.1 3.3.4-1mdk) MCCFLAGS : -fomit-frame-pointer -O -------------- next part -------------- _pkg_config_info: NOT AVAILABLE agg2_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE atlas_blas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/local/lib/libf77blas.a ) ( paths: /usr/local/lib/libcblas.a ) ( paths: /usr/local/lib/libatlas.a ) system_info.atlas_blas_info ( include_dirs = /usr/local/include:/usr/include ) ( paths: /usr/local/include/cblas.h ) FOUND: libraries = ['f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/local/lib'] language = c include_dirs = ['/usr/local/include'] atlas_blas_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/local/lib/libatlas.a ) system_info.atlas_blas_threads_info NOT AVAILABLE atlas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/local/lib/libf77blas.a ) ( paths: /usr/local/lib/libcblas.a ) ( paths: /usr/local/lib/libatlas.a ) ( paths: /usr/local/lib/liblapack.a ) system_info.atlas_info ( include_dirs = /usr/local/include:/usr/include ) ( paths: /usr/local/include/cblas.h ) FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/local/lib'] language = f77 include_dirs = ['/usr/local/include'] atlas_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/local/lib/libatlas.a ) system_info.atlas_threads_info NOT AVAILABLE blas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/local/lib/libblas.a ) FOUND: libraries = ['blas'] library_dirs = ['/usr/local/lib'] language = f77 blas_opt_info: running build_src building extension "atlas_version" sources adding 'build/src/atlas_version_0xd77ad58c.c' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext FOUND: libraries = ['f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/local/lib'] language = c define_macros = [('ATLAS_INFO', '"\\"3.6.0\\""')] include_dirs = ['/usr/local/include'] blas_src_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE boost_python_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE dfftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE dfftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE djbfft_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) NOT AVAILABLE fftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) ( paths: /usr/lib/librfftw.so ) ( paths: /usr/lib/libfftw.so ) ( paths: /usr/include/fftw.h,/usr/include/rfftw.h ) FOUND: libraries = ['rfftw', 'fftw'] library_dirs = ['/usr/lib'] define_macros = [('SCIPY_FFTW_H', None)] include_dirs = ['/usr/include'] fftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) ( paths: /usr/lib/librfftw_threads.so ) ( paths: /usr/lib/libfftw_threads.so ) ( paths: /usr/include/fftw_threads.h,/usr/include/rfftw_threads.h ) FOUND: libraries = ['rfftw_threads', 'fftw_threads'] library_dirs = ['/usr/lib'] define_macros = [('SCIPY_FFTW_THREADS_H', None)] include_dirs = ['/usr/include'] freetype2_info: FOUND: libraries = ['freetype', 'z'] define_macros = [('FREETYPE2_INFO', '"\\"9.7.3\\""'), ('FREETYPE2_VERSION_9_7_3', None)] include_dirs = ['/usr/include/freetype2'] gdk_2_info: FOUND: libraries = ['gdk-x11-2.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_2_INFO', '"\\"2.4.9\\""'), ('GDK_VERSION_2_4_9', None), ('XTHREADS', None), ('_REENTRANT', None), ('XUSE_MTSAFE_API', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/X11R6/include', '/usr/include/pango-1.0', '/usr/include/freetype2', '/usr/include/freetype2/freetype2', '/usr/include/freetype2/freetype2/config', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_info: FOUND: libraries = ['gdk', 'Xi', 'Xext', 'X11', 'm', 'glib'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('GDK_INFO', '"\\"1.2.10\\""'), ('GDK_VERSION_1_2_10', None)] include_dirs = ['/usr/include/gtk-1.2', '/usr/X11R6/include', '/usr/include/glib-1.2', '/usr/lib/glib/include'] gdk_pixbuf_2_info: FOUND: libraries = ['gdk_pixbuf-2.0', 'm', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_PIXBUF_2_INFO', '"\\"2.4.9\\""'), ('GDK_PIXBUF_VERSION_2_4_9', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_pixbuf_xlib_2_info: FOUND: libraries = ['gdk_pixbuf_xlib-2.0', 'gdk_pixbuf-2.0', 'm', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_PIXBUF_XLIB_2_INFO', '"\\"2.4.9\\""'), ('GDK_PIXBUF_XLIB_VERSION_2_4_9', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gdk_x11_2_info: FOUND: libraries = ['gdk-x11-2.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GDK_X11_2_INFO', '"\\"2.4.9\\""'), ('GDK_X11_VERSION_2_4_9', None), ('XTHREADS', None), ('_REENTRANT', None), ('XUSE_MTSAFE_API', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/X11R6/include', '/usr/include/pango-1.0', '/usr/include/freetype2', '/usr/include/freetype2/freetype2', '/usr/include/freetype2/freetype2/config', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gtkp_2_info: FOUND: libraries = ['gtk-x11-2.0', 'gdk-x11-2.0', 'atk-1.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GTKP_2_INFO', '"\\"2.4.9\\""'), ('GTK_VERSION_2_4_9', None), ('XTHREADS', None), ('_REENTRANT', None), ('XUSE_MTSAFE_API', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/X11R6/include', '/usr/include/atk-1.0', '/usr/include/pango-1.0', '/usr/include/freetype2', '/usr/include/freetype2/freetype2', '/usr/include/freetype2/freetype2/config', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] gtkp_x11_2_info: FOUND: libraries = ['gtk-x11-2.0', 'gdk-x11-2.0', 'atk-1.0', 'gdk_pixbuf-2.0', 'm', 'pangoxft-1.0', 'pangox-1.0', 'pango-1.0', 'gobject-2.0', 'gmodule-2.0', 'dl', 'glib-2.0'] extra_link_args = ['-Wl,--export-dynamic'] define_macros = [('GTKP_X11_2_INFO', '"\\"2.4.9\\""'), ('GTK_X11_VERSION_2_4_9', None), ('XTHREADS', None), ('_REENTRANT', None), ('XUSE_MTSAFE_API', None)] include_dirs = ['/usr/include/gtk-2.0', '/usr/lib/gtk-2.0/include', '/usr/X11R6/include', '/usr/include/atk-1.0', '/usr/include/pango-1.0', '/usr/include/freetype2', '/usr/include/freetype2/freetype2', '/usr/include/freetype2/freetype2/config', '/usr/include/glib-2.0', '/usr/lib/glib-2.0/include'] lapack_atlas_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/local/lib/libf77blas.a ) ( paths: /usr/local/lib/libcblas.a ) ( paths: /usr/local/lib/libatlas.a ) system_info.lapack_atlas_info NOT AVAILABLE lapack_atlas_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/local/lib/libatlas.a ) system_info.lapack_atlas_threads_info NOT AVAILABLE lapack_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( paths: /usr/local/lib/liblapack.a ) FOUND: libraries = ['lapack'] library_dirs = ['/usr/local/lib'] language = f77 lapack_opt_info: running build_src building extension "atlas_version" sources adding 'build/src/atlas_version_0x3987e8cd.c' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext customize GnuFCompiler customize GnuFCompiler customize GnuFCompiler using build_ext FOUND: libraries = ['lapack', 'f77blas', 'cblas', 'atlas'] library_dirs = ['/usr/local/lib'] language = f77 define_macros = [('ATLAS_INFO', '"\\"3.6.0\\""')] include_dirs = ['/usr/local/include'] lapack_src_info: ( src_dirs = .:/usr/local/src ) NOT AVAILABLE numarray_info: NOT AVAILABLE numpy_info: ( include_dirs = /usr/include/python2.3 ) ( paths: /usr/include/python2.3/Numeric/arrayobject.h ) FOUND: define_macros = [('NUMERIC_VERSION', '"\\"23.1\\""')] include_dirs = ['/usr/include/python2.3'] sfftw_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) ( paths: /usr/lib/libsrfftw.so ) ( paths: /usr/lib/libsfftw.so ) ( paths: /usr/include/sfftw.h,/usr/include/srfftw.h ) FOUND: libraries = ['srfftw', 'sfftw'] library_dirs = ['/usr/lib'] define_macros = [('SCIPY_SFFTW_H', None)] include_dirs = ['/usr/include'] sfftw_threads_info: ( library_dirs = /usr/local/lib:/usr/lib ) ( include_dirs = /usr/local/include:/usr/include ) ( paths: /usr/lib/libsrfftw_threads.so ) ( paths: /usr/lib/libsfftw_threads.so ) ( paths: /usr/include/sfftw_threads.h,/usr/include/srfftw_threads.h ) FOUND: libraries = ['srfftw_threads', 'sfftw_threads'] library_dirs = ['/usr/lib'] define_macros = [('SCIPY_SFFTW_THREADS_H', None)] include_dirs = ['/usr/include'] wx_info: FOUND: libraries = ['wx_gtk2-2.4'] extra_link_args = ['-pthread'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('WX_INFO', '"\\"2.4.2\\""'), ('WX_VERSION_2_4_2', None), ('WX_RELEASE_2_4', None), ('GTK_NO_CHECK_CASTS', None), ('__WXGTK__', None), ('_FILE_OFFSET_BITS', '64'), ('_LARGE_FILES', None)] include_dirs = ['/usr/lib/wx/include/gtk2-2.4'] x11_info: ( library_dirs = /usr/X11R6/lib:/usr/X11/lib:/usr/lib ) ( include_dirs = /usr/X11R6/include:/usr/X11/include:/usr/include ) ( paths: /usr/X11R6/lib/libX11.so ) ( paths: /usr/X11R6/include/X11/X.h ) FOUND: libraries = ['X11'] library_dirs = ['/usr/X11R6/lib'] include_dirs = ['/usr/X11R6/include'] xft_info: FOUND: libraries = ['Xft', 'X11', 'freetype', 'Xrender', 'fontconfig'] library_dirs = ['/usr/X11R6/lib'] define_macros = [('XFT_INFO', '"\\"2.1.2.2\\""'), ('XFT_VERSION_2_1_2_2', None)] include_dirs = ['/usr/X11R6/include', '/usr/include/freetype2', '/usr/include/freetype2/freetype2', '/usr/include/freetype2/freetype2/config'] From rkern at ucsd.edu Sun Oct 17 11:26:01 2004 From: rkern at ucsd.edu (Robert Kern) Date: Sun, 17 Oct 2004 08:26:01 -0700 Subject: [SciPy-user] C/Fortran callbacks [was "integrate.odeint"] In-Reply-To: <41702E4A.5030203@ee.byu.edu> References: <20041015011552.84AFB3EB51@www.scipy.com> <20041015162133.GA26073@dionysus.ucolick.org> <41702E4A.5030203@ee.byu.edu> Message-ID: <41728F09.2060005@ucsd.edu> Travis Oliphant wrote: > We have been interested in something like this for a while. I would > like to see the user be able to write c and/or fortran code to compute > the function to be integrated. How about this for a sketch: C or Fortran function bodies can be defined as a Python string a la weave. C: We use the weave framework to make an extension module with the function body embedded into a properly defined function. Fortran: The Fortran code will be put into a separate Fortran file as a subroutine. A C extension module is written out which will reference the subroutine. The extension module will create a CObject which contains a direct function pointer to the function. f2py could be modified (I hope) to accept one of these CObjects as an valid input for a callback. An additional nicety would be for f2py to (either optionally or additionally) provide these CObjects for any subroutine wrapped by f2py. That way, one could write a single Fortran file (with helpful "cf2py" comments) with all of one's callbacks instead of semi-inline weave code*. In fact, if this modification is made to f2py, then both the C and Fortran can use it as the back end for generating the extension module which holds the user-defined callback. Pearu, do you have any feelings about the feasibility of this sketch? * Not to disparage weave, but I've found that although I'm too young to have been "raised" in a Fortran culture, f2py makes writing new FORTRAN (77 even!) code my preferred method for making fast, array-oriented computational routines. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From pearu at scipy.org Sun Oct 17 13:21:31 2004 From: pearu at scipy.org (Pearu Peterson) Date: Sun, 17 Oct 2004 12:21:31 -0500 (CDT) Subject: [SciPy-user] Help please: Test failure: AttributeError: 'module' object has no attribute 'eig' * 15 In-Reply-To: <200410180011.26446.andrewl@acay.com.au> References: <200410180011.26446.andrewl@acay.com.au> Message-ID: On Mon, 18 Oct 2004 andrewl at acay.com.au wrote: > I cannot install SciPy without getting a number (15) of errors that all > resolve to: > > File "/usr/lib/python2.3/site-packages/scipy/special/orthogonal.py", line 91, > in get_eig_func > eig = scipy.linalg.eig > AttributeError: 'module' object has no attribute 'eig' > > I can see no import errors. I have installed lapack, blas and atlas from > source. The size of the lapack library is ~22M. I have imported the atlas > optimised objects into the lapack.a. I have removed all other lapack shared > libraries from my system. I have tried 'python setup.py clean' prior to > every re-install. Note that 'python setup.py clean' may not be enough, sometimes even 'python setup.py clean --all'. 'rm -rf build' is the most robust way to clean up old build. > Can anyone suggest a way to resolve this? When you import scipy, is scipy.linalg.eig defined? > Outputs of the diagnostic runsare attached. (1-5, 6, 7 (part, there is no > scipy_core/scipy_distutils/command/build_flib.py in the build)) > > Output of test (scipy.test(level=1)) follows. This output does not contain stderr messages. Could you send these too? Pearu From pearu at scipy.org Sun Oct 17 18:12:06 2004 From: pearu at scipy.org (Pearu Peterson) Date: Sun, 17 Oct 2004 17:12:06 -0500 (CDT) Subject: [SciPy-user] C/Fortran callbacks [was "integrate.odeint"] In-Reply-To: <41728F09.2060005@ucsd.edu> References: <20041015011552.84AFB3EB51@www.scipy.com> <20041015162133.GA26073@dionysus.ucolick.org> <41702E4A.5030203@ee.byu.edu> <41728F09.2060005@ucsd.edu> Message-ID: On Sun, 17 Oct 2004, Robert Kern wrote: > Travis Oliphant wrote: > >> We have been interested in something like this for a while. I would like >> to see the user be able to write c and/or fortran code to compute the >> function to be integrated. > > How about this for a sketch: > > C or Fortran function bodies can be defined as a Python string a la weave. > > C: We use the weave framework to make an extension module with the function > body embedded into a properly defined function. > > Fortran: The Fortran code will be put into a separate Fortran file as a > subroutine. A C extension module is written out which will reference the > subroutine. > > The extension module will create a CObject which contains a direct function > pointer to the function. > > f2py could be modified (I hope) to accept one of these CObjects as an valid > input for a callback. > > An additional nicety would be for f2py to (either optionally or additionally) > provide these CObjects for any subroutine wrapped by f2py. That way, one > could write a single Fortran file (with helpful "cf2py" comments) with all of > one's callbacks instead of semi-inline weave code*. In fact, if this > modification is made to f2py, then both the C and Fortran can use it as the > back end for generating the extension module which holds the user-defined > callback. > > Pearu, do you have any feelings about the feasibility of this sketch? Check out the latest f2py from CVS: Now every fortran object that represents some C or Fortran function, has attribute `_cpointer` that is of PyCObject type. F2py generated wrappers accept PyCObject arguments as call-back arguments and assume that such PyCObject arguments contain pointers to C or Fortran functions. Note that f2py cannot check if PyCObject arguments are valid in any way to be passed on as an call-back argument. So, if the signatures of the given and expected callback arguments are slightly different, it will most probably cause a Python crash. See an example at the end of this message. This is a very new feature in f2py and so needs more testing before using in production codes. Let me know if you experience any trouble or success with this feature. Regards, Pearu Example -------- !File cb.f subroutine foo(bar) external bar integer x !f2py intent(out) x call bar(x) print*,"x=",x end subroutine cb(x) integer x !f2py intent(out) x x = 156 end !eof $ f2py -m m cb.f -c In [1]: from m import foo,cb In [2]: foo(lambda:2) x= 2 In [3]: cb() Out[3]: 156 In [4]: foo(cb) x= 156 In [5]: cb._cpointer Out[5]: In [6]: foo(cb._cpointer) x= 156 From aisaac at american.edu Mon Oct 18 02:34:30 2004 From: aisaac at american.edu (Alan G Isaac) Date: Mon, 18 Oct 2004 02:34:30 -0400 (Eastern Daylight Time) Subject: [SciPy-user] determinant Message-ID: It is nice (and sensible) to be able to find the inverse of matrix A as A.I Shouldn't we also be able to find the determinant as A.d or A.det? Additionally, think about SciPy's plans of moving to numarray in the future: why has numarray avoided any interesting implementation of the Matrix class? Are we supposed to be looking elsewhere? Thanks, Alan Isaac From nwagner at mecha.uni-stuttgart.de Mon Oct 18 11:02:11 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon, 18 Oct 2004 17:02:11 +0200 Subject: [SciPy-user] io.mmread Message-ID: <4173DAF3.6070104@mecha.uni-stuttgart.de> Hi all, I am going to read matrices given in MatrixMarket format >>> io.mmread('bfw62a.mtx') <62x62 sparse matrix of type 'd' with 450 stored elements (space for 450) in COOrdinate format> >>> print io.mmread('bfw62a.mtx') gives the entries, but how can I assign this matrix to an array to compute the eigenvalues of this matrix ? Nils From pearu at scipy.org Mon Oct 18 11:31:30 2004 From: pearu at scipy.org (Pearu Peterson) Date: Mon, 18 Oct 2004 10:31:30 -0500 (CDT) Subject: [SciPy-user] io.mmread In-Reply-To: <4173DAF3.6070104@mecha.uni-stuttgart.de> References: <4173DAF3.6070104@mecha.uni-stuttgart.de> Message-ID: On Mon, 18 Oct 2004, Nils Wagner wrote: > Hi all, > > I am going to read matrices given in MatrixMarket format > >>>> io.mmread('bfw62a.mtx') > <62x62 sparse matrix of type 'd' with 450 stored elements (space for 450) in > COOrdinate format> > >>>> print io.mmread('bfw62a.mtx') > > gives the entries, but how can I assign this matrix to an array to > compute the eigenvalues of this matrix ? >>> m=io.mmread('bfw62a') >>> a=m.todense() >>> linalg.eigvals(a) Pearu From nwagner at mecha.uni-stuttgart.de Tue Oct 19 07:36:15 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 19 Oct 2004 13:36:15 +0200 Subject: [SciPy-user] Sparse matrices support and io.loadmat Message-ID: <4174FC2F.5040909@mecha.uni-stuttgart.de> Hi all, Sparse matrices stored with Matlab's save command (option -v4) are not supported by io.loadmat . >>> io.loadmat('speyev4.mat') Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 744, in loadmat raise ValueError, "Cannot handle sparse matrices, yet." ValueError: Cannot handle sparse matrices, yet. Sparse matrices which are saved without the option -v4 in MATLAB cannot be loaded in scipy. >>> io.loadmat('speyev5.mat') Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 692, in loadmat thisdict = _loadv5(fid,basename) File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 631, in _loadv5 el, varname = _get_element(fid) File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 619, in _get_element el, name = _parse_mimatrix(fid,numbytes) File "/usr/lib/python2.3/site-packages/scipy/io/mio.py", line 568, in _parse_mimatrix spmat = scipy.sparse.spmatrix(dims[1],dims[0],typecode=res.typecode()) TypeError: __init__() got an unexpected keyword argument 'typecode' Nils -------------- next part -------------- A non-text attachment was scrubbed... Name: speyev4.mat Type: application/octet-stream Size: 166 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: speyev5.mat Type: application/octet-stream Size: 288 bytes Desc: not available URL: From jh at oobleck.astro.cornell.edu Tue Oct 19 11:10:43 2004 From: jh at oobleck.astro.cornell.edu (Joe Harrington) Date: Tue, 19 Oct 2004 11:10:43 -0400 Subject: [SciPy-user] Accessible SciPy (ASP) project Message-ID: <200410191510.i9JFAh1W013787@oobleck.astro.cornell.edu> [Note: This is cross-posted from scipy-dev. This project will have its discussions on scipy-dev, so if you are interested in participating or giving feedback, please do so there, and not on scipy-user. We will not be posting more here, other than major announcements. --jh--] Accessible SciPy Request for Comments #1 Joseph Harrington Perry Greenfield At SciPy '04 we had an animated Birds-of-a-Feather session about making SciPy more accessible to the general scientific user. The session and the many conversations that followed cleared up a lot of issues and myths about SciPy. Among a core group of about a dozen participants, a consensus began to emerge about what needs to be done. The purpose of this document is to lay out our understanding of that consensus for your comment (whether or not you have been involved up to now), to announce our intention to make this vision a reality, and to solicit everyone's participation and support. Many hands make light work, and many brains, properly channeled, make great work. We thus introduce the Accessible SciPy (ASP) project. Please take a moment to look at the BoF presentation, minutes, and summary at http://www.scipy.org/wikis/scipy04/ConferenceSchedule. With those documents as background, we lay out the problem, our dream, and a path to get there. THE PROBLEM Python is wonderful for doing scientific computation. Those who try it are thrilled by the freedom from arbitrary limitations, legacy syntaxes, and license managers. Some of the applications and demos are stunning. At the same time, the experience of a new user who comes to SciPy "cold" is awful. There is little in the way of instructions for installing it and running it, even to the "Hello, world!" stage, and much of that information is outdated. There is a lengthy description of the build process, which most users could never follow even if they wanted to. It is not even clear what components are in SciPy, what else is needed, and what the add-ons do. It is to the millions of such potential users (which includes every high-school science student in the world) that the current effort is directed. We need to say at this point that we are not picking on Enthought. In fact, what's on their servers works a great deal better than they advertise. One of us was able to do a "yum install SciPy" on a laptop at the conference. But, the word "yum" appears nowhere on the web site, nor does the URL for the repository. We need to take the resources being made available by Enthought and create from them the user experience SciPy needs to thrive. WHAT'S EXPECTED BY NEW USERS New users who are not "bit-heads" expect a first-time experience that goes something like this: 1. They hear about SciPy and are somehow induced to find the site and visit. 2. They see a brief front page that says what SciPy is, lists some features, and points to a page with more info. There is a reasonable number of relevant links, all clearly laid out on a page that is not too busy. Words on the front page invite them to download and try the software. 3. They click "download", and go to a friendly page that offers a binary install package for the current version of the software for their machine (and others, but they don't care about that). It also offers instructions for installing the package on their platform. For platforms like Red Hat and Debian Linux, the instructions say what lines to add to yum.conf or its Debian equivalent, though the option to download the binary package directly also exists. The instructions end with: how to configure (if necessary, hopefully not), how to test the install, where to go for help if the install failed, a pointer to a "Getting Started With SciPy" document. They follow the instructions and it installs fine. 4. They read the "Getting Started" document, which is about 20 pages and contains: a. A brief (1/2 page) description of SciPy's key characteristics from a new user's point of view b. A get-your-feet-wet tutorial, for example: make a sine wave and a parabola, add them, and plot, read some ASCII data and plot it, do a Fourier transform of the data and plot it, read an image and display it, make a second image, add it to the first, and display it, and extract an image section, manipulate it, and display it. c. The basic (non-programming) Python syntax, including array creation, access, and manipulation. d. The key elements of Python's interaction with the operating system (e.g., the most important environment variables, how to tell it where routines are stored, etc.). e. A statement on the current state of the software, that there is flux in graphics and the underlying array package, but that the functionality we teach in the docs will not (likely) go away. f. Sources of further information and support, both in the downloaded package and on the web. 5. Encouraged by the smoothness of the experience so far, the user dives right into some topical docs (for astronomy, biology, etc.), buys a book on Python (or even SciPy), subscribes to scipy-user and a topical list, downloads add-ons, and becomes productive almost immediately. OUR SOLUTION TO THE CONUNDRUM OF OPEN DEVELOPMENT SciPy both suffers and benefits from being Open Source Software. On the one hand, many developers work on it and it is quite powerful. On the other, there is no central organization, so packages can conflict, there is duplicated work, there are holes, etc. ASP proposes to provide the organization that is lacking. Through a community-driven process, we will solicit help in resolving the issues and in implementing the solutions. We will guide new users toward what the community feels are the best packages for each basic task, so that new users experience a unified software package with clear documentation. At the same time, we will continue to provide the broadest array of application software possible, and will index all the available packages and functionality so people can make informed choices if they decide the defaults are not what they need. Mainly, we will guide users through selective documentation. For example, once we select a more capable graphics package that supports all platforms, the general user documentation will teach that package rather than xplt or gplt. The latter would continue to exist, would receive whatever support their developers and fans chose to give them, and would be listed along with all the other graphics options. They would merely not be emphasized in the tutorial documentation. Thus, nobody will lose functionality or choice. It is possible that, in the future, another package may supplant one that the documentation promotes. In that case, after due deliberation, we may decide to rewrite the documents to reflect that change. Of course, such a change would be undertaken only in compelling circumstances. WHAT'S NEEDED TO GET THERE At the BoF, we identified three key areas that needed to be worked on in order to realize the experience above: packaging, the web site, and documentation. We also identified two situations, graphics and the numeric/Numarray split, that will confuse (and therefore discourage) new users until they are resolved. We will address these first, as they frame the packaging issues. SOFTWARE ISSUES On the graphics front, there are two included packages, gplt and xplt. One works best on Unix, the other on Windows. Neither is much to write home about, and all this is acknowledged. Considerable effort has gone into Chaco, but the package has not matured as fast as some had hoped, and it is still not ready (according to most). A new player, matplotlib, is gaining popularity. With the exception of contour plots, which are being actively worked on, it seems to implement the 2D plotting capability of Matlab, with both a similar user interface to Matlab and a more capable Python-like class library. It is interactive (you can click on a screen plot and adjust it in real time). It works on all platforms. The BoF consensus was to base the new documentation on matplotlib and to de-emphasize gplt and xplt by not mentioning them in the docs at all. They would remain in SciPy indefinitely. Supporters of Chaco may advocate for the selection of that package instead. Whether the community goes for this idea will depend in large part on the state of Chaco (including package documentation and maintainability by people other than the original authors) when this decision is made. On the numeric/Numarray front, it is a problem for some that Numarray performance is worse for small arrays than that of the older numeric. Other issues exist as well. Perry Greenfield is working on getting the two packages to co-exist such that which one to use can become a run-time choice of the user, and so that package maintainers can independently choose to use either one. It is hoped that ultimately Numarray will be superior to numeric in all respects, so that numeric can be deprecated and then later removed. Thus, the BoF consensus was to document the use of Numarray for interactive work. For now, Numarray and matplotlib would not be in the SciPy core. Numarray will enter the core when the coexistence issues are resolved and the developers accept it. matplotlib may enter the core when its release schedule slows down, but at this point matplotlib releases much more frequently than SciPy and there are substantial improvements with each release. If matplotlib were in the core, users would be stuck with an incomplete and beta package until the next release of SciPy, which could be many months away. PACKAGING New users generally will not build software from source code anymore. The packaging goal is thus to produce binary packages for Linux under both RPM and the Debian Package Manager, and for Mac, Windows, and Sun using their native package managers. Support for each of these (and for other platforms) depends on interested users participating and contributing good packages on a timely basis. We appreciate any help the software developers can provide in producing the packages, but we expect that most of the packaging work will be done by volunteers who specialize in this task. The BoF consensus was to distribute SciPy, Numarray, and matplotlib as separate binary packages, possibly tied together by a meta-package that contained only dependencies (for YUM and APT users). In addition, the conference was sufficiently impressed with the interactive experience offered by IPython that it would be included until it entered the SciPy core. That move was discussed positively at the conference. Optimized matrix routines may be included, or may be available as an option, depending on our ability both to produce them in a timely fashion and to provide a simple new-user experience. DOCUMENTATION Documentation is undoubtedly the area where the largest number of work hours remain to be done. It needs rewriting, or writing for the first time, at all levels visible to users. Because of this and the beta nature of some of the packages, it makes sense to focus on shorter documents that address specific tasks, rather than something like a paper book (though that might make sense two to three years from now). It is important for docs to be well-written: clear, concise, grammatical, current, complete, correct, and visible. Thus, it makes sense to coordinate this effort closely between the writers, relevant developers, and those planning the overall effort. The approach of writing shorter docs will enable participation by a larger group of writers, thus (we hope) completing the first draft of each document sooner. It will also make updates and rewrites easier. Of course, it will be important to provide good cross-references to other documents and the web site, and to keep these up to date. Needed documentss: What is SciPy? (listing of features and included packages) Installing and Testing SciPy on Red Hat Linux Debian Gnu-Linux MAC Windows Sun Getting Started with SciPy SciPy for IDL Users, with cheat sheet SciPy for Matlab Users, with cheat sheet SciPy User's Guide SciPy Reference Manual SciPy for Astronomy, Biology, Chemistry, etc. It was noted at the BoF that Enthought has substantial documentation in its Windows package in .chm format, and that there is now an X reader for these files. Those documents will be broken out for non-Windows users and may form the bases for one or more of the documents above, assuming cooperation from Enthought on permissions and copyrights. Translations are always a good idea, but can only be obtained in a community project through the work of competent volunteers. The quality of our documentation will be vastly improved by user testing and comment, and by the participation of more than one person in the creation of each document. However, content determines form, so we should not be shy about making first drafts available, provided that we continue to work on them. We will need to agree on a set of standards for writing documents. Certainly all docs should be available in PDF and HTML, and the source should be modifiable by anyone on any platform. The Windows .chm format may also be a viable target if good tools exist to do it under Linux and Mac as well as Windows. The source form must be viable in the long term and must not leave us in a bind if the text-processing software ceases to be supported. Structured Text and LaTeX have been suggested. MSWord and other proprietary forms are out. The major need for formulae in scientific documentation may push us to LaTeX, perhaps with a standardized format, but this is open for discussion. WEB SITE Probably the easiest step is improving the web site. Enthought has provided a Plone-based site, which means that updates by many contributors will be easy and many features are already there. Much of the content needs updating, and many new areas are needed. For example: - The site says that unit tests are the main need from the community. Our needs are broader, as evidenced by the BoF conclusions. - The documentation above needs to be placed on the site as it becomes available. - Pages and mailing lists are needed for topical discussions, each managed by a field representative. - The YUM archive and other download sites need to be linked to the main pages. - The utilitarian, Plone-out-of-the-box appearance should be replaced by one with more legible buttons and some lightweight graphics that make the page attractive. - A page with demos and screen shots should be added. - Pages that present and possibly rate add-on packages are needed. - Pages of user recipes and web links are needed. - A page of demos would be nice. - Throughout, it needs to be clear who is responsible for each page and how to reach that person. - Overall, the site needs to be reorganized to give new users the experience outlined above, without making it much less useful for experienced users to navigate. Essentially, scipy.org needs to become a one-stop-shopping web portal for scientific computing in Python. By providing current, complete, and accessible information in an attractive format, the web site will show potential users that this software is serious business, that it will not be difficult to learn, and that it is actively maintained by a large user community. PRIORITIES The three areas for improvement can proceed in parallel. Since packaging issues affect the documentation, those should be resolved as soon as possible. For packaging, we need to: 1. determine whether the idea of replacing xplt and gplt with matplotlib in the docs is acceptable to the community, 2. determine whether IPython should go into the core, 3. determine whether the "coexistence" approach for resolving the numeric/Numarray split is a good idea. Then, we need to roll and field-test the binary packages. The latter effort will require volunteers, so if you want your package or platform to be supported, please sign up. For documentation, we need to agree on a common source format, an open copyright, and some stylistic guidelines. Documents are needed in roughly the order listed above, though if someone is very inspired to start on a later one, he or she should proceed. Suggestions for additional documents are welcome, as are volunteers to write them. Goals for the web site are less clear than for packaging and documentation. Some mailing list brainstorming on content and format issues would be a good idea, starting with those above. Then, we need to identify page maintainers and get them access. Several individuals stepped forward at the BoF, and a web human interface designer has volunteered to help. Again, more volunteers are needed. TOPICAL SOFTWARE As a parallel effort, there is now critical mass in several disciplines for the creation of topic-specific software. For example, in astronomy, most data come in Flexible Image Transport System (FITS) format, and there is a package written by Paul Barrett that reads and writes FITS files in Python. We wish to encourage these contributions, to provide guidance for a seamless integration with the main packages, and to help new users find these resources. We can start by hosting topical mailing lists at scipy.org and by providing a variety of web resources, including package or topic home pages, lists of packages by topic, and lists of links to packages hosted elsewhere. ADVOCACY Once the basics are in place, we can start advocating SciPy to the broader scientific community. With luck and a little effort, this should expand the group of contributors so that the remaining work can be done more quickly. Suggestions from the BoF included a conference kit so that someone can set up a booth that advocates SciPy simply by printing some posters and handouts and setting up a computer. Others included lunchtime talks in departments, killer demos, comparison web pages, and the best advocacy of all, being a good example to peers. The BoF identified the need for a user survey. Individuals can best judge when and to whom they advocate SciPy. However, it would make sense to coordinate any major presentations with the SciPy community, to ensure good synchronization with new releases, web site work, etc. CONCLUSION SciPy is a community project, and the community should coordinate and review what goes into SciPy. In that vein, this document is a genuine request for your comments, and we will hope to maintain this format in the future so that all voices can be heard. If you are willing to work on any part of this effort, please make your intentions known by adding your name and email (spam-obscured, if you like) to the ASP Wiki at http://www.scipy.org/wikis/accessible_scipy/. Since this is a community project, please be prepared to accept edits, corrections, and updates from the community, and to ask for help or to hand off your work to someone else when you are no longer able or willing to maintain it at the level or rate that is needed. The vision above is a large one. However, none of the steps is particularly large. Many projects can proceed in parallel and we gain from the completion of each task. Discussion will continue, for now, on the scipy-dev at scipy.org mailing list, with major announcements copied to scipy-user. If this topic comes to dominate the list, it may be split off into its own list, but for now we want to keep all those working on SciPy apprised of our efforts. We invite you to join us in making SciPy the environment of choice for technical computation, starting with your comments on the plan outlined above. --jh-- From andrewl at acay.com.au Tue Oct 19 13:46:01 2004 From: andrewl at acay.com.au (andrewl at acay.com.au) Date: Wed, 20 Oct 2004 03:46:01 +1000 Subject: (Fixed) [SciPy-user] Help please: Test failure: AttributeError: 'module' object has no attribute 'eig' * 15 In-Reply-To: References: <200410180011.26446.andrewl@acay.com.au> Message-ID: <200410200346.02103.andrewl@acay.com.au> Pearu, Thank you for your assistance. The more complete clean did the trick (python setup.py clean --all; rm -rf build). I was sure there must be some usuitable configuration file lying around, but wasn't sure what I could safely do to remove them. I wonder if something similar to your good advice might be put into the installation instructions to assist others? Along the lines of: "Should you need to rebuild (to resolve library problems, or add a new library), it is safest to use ....." Regards, Andrew Lees From novak at ucolick.org Tue Oct 19 21:23:49 2004 From: novak at ucolick.org (Greg Novak) Date: Tue, 19 Oct 2004 18:23:49 -0700 Subject: [SciPy-user] Weave Memory Leak? Message-ID: <20041020012349.GA30093@dionysus.ucolick.org> A few days ago I wrote the list about a memory leak in code involving Weave. Now I'm ready to run it up the flagpole. I've put the code here: http://www.ucolick.org/~novak/memory-leak.tgz The problem is in the integrate() python function. If I replace it with code that doesn't use Weave (just returns reasonable fake data), there's no memory problem. If anyone is kind enough to look at the code, note how the call to odeint() within integrate() is commented out. So all I do is allocate some space w/ malloc through dmatrix(), fill it with fake data, allocate a new Numeric array, copy the fake data into it, deallocate the space allocated w/ malloc, and then set return_val to the Numeric array. There's no way to return from the function without calling dmatrix_free(). I thought at first that the reference count to the aforementioned Numeric array was incremented one too many times, but if I call Py_DECREF() on it, I get a core dump, presumably b/c the array is de-allocated. That's all. Thanks a bunch for any assistance. Greg From eric at enthought.com Wed Oct 20 01:36:17 2004 From: eric at enthought.com (eric jones) Date: Wed, 20 Oct 2004 00:36:17 -0500 Subject: [SciPy-user] Weave Memory Leak? In-Reply-To: <20041020012349.GA30093@dionysus.ucolick.org> References: <20041020012349.GA30093@dionysus.ucolick.org> Message-ID: <4175F951.4090802@enthought.com> Hey Greg, It is a ref count issue. If you change your code at the end of your function [ly.py:299 or so] from: return_val = (PyObject *) ret_array; to: return_val = (PyObject *) ret_array; Py_XDECREF((PyObject*)ret_array); you'll be set. The problem is that PyArray_FromDims creates a PyObject* with refcount 1 and then assigning this to the py::object return_val also increments the refcount by 1 because it now refers to the same object. return_val now has a refcount of 2. Before returning, you need to release "your" reference to ret_array by calling the Py_XDECREF(). This will set the refcount back to 1 which is the desired value before returning. Refcounts are tricky and sometimes hard to get right. Weave tries hard but doesn't get rid of reference management issues in all possible cases. I guess the best rule here is that assigning a PyObject* to return_val always increases its refcount. If you also hold a refcount you must release it. When assigning non-python objects (int, float, etc.) the correct type of python object is created on the fly and therefore has a single reference count. One other approach is to never create raw PyObject* objects within the function. This way you don't have to mess with ref counts at all. If a weave function returns an output array that has a known size, I'll typically create it in python and then pass it in as one of the weave arguments. It isn't quite as elegant as creating it internally, but then noone is going to look at the following and complain about the elegance of an extra calling argument. :-) rval = weave.inline(thecode, ['yi', 'ts', 'params', 'hinit', 'hmin', 'hmax', 'tol', 'verbose'], support_code=eqns['code'], sources=['nr-integrate.cpp', 'nrutil.cpp'], include_dirs=[os.getcwd()], headers=['"nrutil.h"', '"nr-integrate.h"'], force=recompile) In your case, you can pre-allocate ret_array and then pass it into the function. Someday, it'd also be nice to include a py::array object in weave that handles the refcounting during assignment transparently (but not today...). hope that helps, eric Greg Novak wrote: >A few days ago I wrote the list about a memory leak in code involving >Weave. Now I'm ready to run it up the flagpole. > >I've put the code here: >http://www.ucolick.org/~novak/memory-leak.tgz > >The problem is in the integrate() python function. If I replace it >with code that doesn't use Weave (just returns reasonable fake data), >there's no memory problem. > >If anyone is kind enough to look at the code, note how the call to >odeint() within integrate() is commented out. So all I do is allocate >some space w/ malloc through dmatrix(), fill it with fake data, >allocate a new Numeric array, copy the fake data into it, deallocate >the space allocated w/ malloc, and then set return_val to the Numeric >array. There's no way to return from the function without calling >dmatrix_free(). > >I thought at first that the reference count to the aforementioned >Numeric array was incremented one too many times, but if I call >Py_DECREF() on it, I get a core dump, presumably b/c the array is >de-allocated. > >That's all. Thanks a bunch for any assistance. > >Greg > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > From prabhu_r at users.sf.net Wed Oct 20 03:39:01 2004 From: prabhu_r at users.sf.net (Prabhu Ramachandran) Date: Wed, 20 Oct 2004 13:09:01 +0530 Subject: [SciPy-user] Weave Memory Leak? In-Reply-To: <20041020012349.GA30093@dionysus.ucolick.org> References: <20041020012349.GA30093@dionysus.ucolick.org> Message-ID: <16758.5653.576450.760986@monster.linux.in> >>>>> "GN" == Greg Novak writes: GN> A few days ago I wrote the list about a memory leak in code GN> involving Weave. Now I'm ready to run it up the flagpole. GN> I've put the code here: GN> http://www.ucolick.org/~novak/memory-leak.tgz GN> The problem is in the integrate() python function. If I GN> replace it with code that doesn't use Weave (just returns GN> reasonable fake data), there's no memory problem. I have no clue if this will help but I took a *very* quick look and noticed that you allocate using dvector in test_derivs but don't call free_dvector before you return. You call test_derivs from eval_derivs and integrate. Try this version of test_derivs instead: def test_derivs(eqns, yi, params, recompile): """Make sure that the derivs function can be evaluated""" code = r""" double *dys = dvector(1, Nyi[0]); int res = derivs(0, yi-1, dys, params-1); free_dvector(dys, 1, Nyi[0]); if (res) return_val = 1; else return_val = 0; """ return weave.inline(code, ['yi', 'params'], support_code=eqns['code'], sources=['nrutil.cpp'], include_dirs=[os.getcwd()], headers=['"nrutil.h"'], force=recompile) I haven't tested but my guess is that this is a top candidate for a slow but sure memory leak. Could that be it? HTH. cheers, prabhu From nwagner at mecha.uni-stuttgart.de Wed Oct 20 05:27:43 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 20 Oct 2004 11:27:43 +0200 Subject: [SciPy-user] Sparse linear equation solver Message-ID: <41762F8F.4030606@mecha.uni-stuttgart.de> Hi all, How do I solve large sparse systems of equations in scipy. Assume that the coefficient matrix is given in MatrixMarket format. Which package is currently used in scipy (Super-LU, UMFPACK) ? How do I multiply a sparse matrix with a vector ? Can I use complex matrices ? How do I generate a bordered matrix in sparse format e.g. [A , x; x^H , 0] A small example would be appreciated. Nils From nwagner at mecha.uni-stuttgart.de Wed Oct 20 05:34:27 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 20 Oct 2004 11:34:27 +0200 Subject: [SciPy-user] Limits of eig(A,B) Message-ID: <41763123.6000002@mecha.uni-stuttgart.de> Hi all, What is the largest size of A respectively B in linalg.eig(A,B) with respect to CPU time and memory requirements ? Does it make sense to solve a generalized eigenvalue problem of order n=70000 with linalg.eig ? Is there any rule of thumb ? Nils From arnd.baecker at web.de Wed Oct 20 06:22:46 2004 From: arnd.baecker at web.de (Arnd Baecker) Date: Wed, 20 Oct 2004 12:22:46 +0200 (CEST) Subject: [SciPy-user] scipy debian packages Message-ID: Hi, I just installed the debs from http://deb-scipy.alioth.debian.org/apt/ (from 18 Oct, giving scipy 3.2). In [1]: import scipy In [2]: scipy.__version__ Out[2]: '0.3.2' and get In [3]: from scipy.xplt import * --------------------------------------------------------------------------- PPImportError Traceback (most recent call last) (full traceback below...) Somehow I thought from the archive that this was fixed, (http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2004-October/003385.html) but maybe this is a new/different incarnation? ((I also checked that this also happens with the "normal" python. I am using debian testing.)) Is this also found, e.g., on other systems (windows, fedora, ...)? Arnd Full traceback: In [3]: from scipy.xplt import * --------------------------------------------------------------------------- PPImportError Traceback (most recent call last) /home/abaecker/ /usr/lib/python2.3/site-packages/scipy_base/ppimport.py in __getattr__(self, name) 301 module = self.__dict__['_ppimport_module'] 302 except KeyError: --> 303 module = self._ppimport_importer() 304 return getattr(module, name) 305 /usr/lib/python2.3/site-packages/scipy_base/ppimport.py in _ppimport_importer(self) 260 exc_info = self.__dict__.get('_ppimport_exc_info') 261 if exc_info is not None: --> 262 raise PPImportError,\ 263 ''.join(traceback.format_exception(*exc_info)) 264 else: PPImportError: Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy_base/ppimport.py", line 273, in _ppimport_importer module = __import__(name,None,None,['*']) File "/usr/lib/python2.3/site-packages/scipy/xplt/__init__.py", line 12, in ? from Mplot import * File "/usr/lib/python2.3/site-packages/scipy/xplt/Mplot.py", line 1015, in ? import colorbar File "/usr/lib/python2.3/site-packages/scipy/xplt/colorbar.py", line 9, in ? from slice3 import * File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1581, in ? _poly_permutations4 = _construct3 (0) File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, in _construct3 mask = find_mask (below, _node_edges3 [itype]) TypeError: Array can not be safely cast to required type From rkern at ucsd.edu Wed Oct 20 06:01:49 2004 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 20 Oct 2004 03:01:49 -0700 Subject: [SciPy-user] scipy debian packages In-Reply-To: References: Message-ID: <4176378D.2050706@ucsd.edu> Arnd Baecker wrote: > File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, > in _construct3 > mask = find_mask (below, _node_edges3 [itype]) > TypeError: Array can not be safely cast to required type This is a problem with Numeric. Bug the maintainer of python-numeric to update from the latest 23.5 tarball. The fix somehow didn't make it into the first release of the 23.5 tarball but should be in the copy there now. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From arnd.baecker at web.de Wed Oct 20 07:23:58 2004 From: arnd.baecker at web.de (Arnd Baecker) Date: Wed, 20 Oct 2004 13:23:58 +0200 (CEST) Subject: [SciPy-user] scipy debian packages In-Reply-To: <4176378D.2050706@ucsd.edu> References: <4176378D.2050706@ucsd.edu> Message-ID: On Wed, 20 Oct 2004, Robert Kern wrote: > Arnd Baecker wrote: > > > File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, > > in _construct3 > > mask = find_mask (below, _node_edges3 [itype]) > > TypeError: Array can not be safely cast to required type > > This is a problem with Numeric. Bug the maintainer of python-numeric to > update from the latest 23.5 tarball. The fix somehow didn't make it into > the first release of the 23.5 tarball but should be in the copy there now. Many thanks! Do you have a simple example demonstrating the problem in pure Numeric code? (this would make it simpler to illustrate/test the problem without referring to scipy and thus more convincing, IMHO). Until that happens: is there a file which I could hand-edit in my installation (of course this would only work if it is on the .py level) to remove the problem for the moment? Best, Arnd From rkern at ucsd.edu Wed Oct 20 07:29:06 2004 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 20 Oct 2004 04:29:06 -0700 Subject: [SciPy-user] scipy debian packages In-Reply-To: References: <4176378D.2050706@ucsd.edu> Message-ID: <41764C02.5090905@ucsd.edu> Arnd Baecker wrote: > On Wed, 20 Oct 2004, Robert Kern wrote: > > >>Arnd Baecker wrote: >> >> >>> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, >>>in _construct3 >>> mask = find_mask (below, _node_edges3 [itype]) >>>TypeError: Array can not be safely cast to required type >> >>This is a problem with Numeric. Bug the maintainer of python-numeric to >>update from the latest 23.5 tarball. The fix somehow didn't make it into >>the first release of the 23.5 tarball but should be in the copy there now. > > > Many thanks! Do you have a simple example demonstrating the problem > in pure Numeric code? > (this would make it simpler to illustrate/test the problem without > referring to scipy and thus more convincing, IMHO). It's an issue with the function arrayfns.find_mask(x, y) when x.typecode() == UInt8 and y.typecode() == Int. With the function not having any docstrings, I can't construct an example right now. > Until that happens: is there a file which I could hand-edit > in my installation (of course this would only work if it is on the .py > level) to remove the problem for the moment? This is untested, but it should work: just before the error I isolated above, put the line below = below.astype(_node_edges3[itype].typecode()) -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From arnd.baecker at web.de Thu Oct 21 03:46:08 2004 From: arnd.baecker at web.de (Arnd Baecker) Date: Thu, 21 Oct 2004 09:46:08 +0200 (CEST) Subject: [SciPy-user] scipy debian packages In-Reply-To: <41764C02.5090905@ucsd.edu> References: <41764C02.5090905@ucsd.edu> Message-ID: Hi, I looked a bit further into this by installing a fresh python, Numeric 23.5 (tar.gz from sourceforge) and scipy. On Wed, 20 Oct 2004, Robert Kern wrote: > Arnd Baecker wrote: > > On Wed, 20 Oct 2004, Robert Kern wrote: > > > > > >>Arnd Baecker wrote: > >> > >> > >>> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, > >>>in _construct3 > >>> mask = find_mask (below, _node_edges3 [itype]) > >>>TypeError: Array can not be safely cast to required type > >> > >>This is a problem with Numeric. Bug the maintainer of python-numeric to > >>update from the latest 23.5 tarball. The fix somehow didn't make it into > >>the first release of the 23.5 tarball but should be in the copy there now. > > > > > > Many thanks! Do you have a simple example demonstrating the problem > > in pure Numeric code? > > (this would make it simpler to illustrate/test the problem without > > referring to scipy and thus more convincing, IMHO). > > It's an issue with the function arrayfns.find_mask(x, y) when > x.typecode() == UInt8 and y.typecode() == Int. With the function not > having any docstrings, I can't construct an example right now. I cannot confirm this: From the failing example in slice3.py I cooked up this example here import Numeric print Numeric.__version__ import arrayfns x=Numeric.array([[0, 0, 0, 1], [1, 1, 1, 0]]) y=Numeric.array([[0, 1], [0, 1], [1, 0], [1, 0]]) print x.typecode() print y.typecode() arrayfns.find_mask(x, y) Using the Numeric version from debian testing gives Python 2.3.4 (#2, Sep 24 2004, 08:39:09) [...] In [1]: import Numeric In [2]: print Numeric.__version__ 23.5 In [3]: import arrayfns In [4]: x=Numeric.array([[0, 0, 0, 1], [1, 1, 1, 0]]) In [5]: y=Numeric.array([[0, 1], [0, 1], [1, 0], [1, 0]]) In [6]: print x.typecode() l In [7]: print y.typecode() l In [8]: arrayfns.find_mask(x, y) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) TypeError: Array can not be safely cast to required type In [9]: arrayfns.find_mask(x.astype("b"), y.astype("b")) Out[9]: array([1, 0, 1, 0],'i') Using the freshly compiled one gives Python 2.3.3 (#1, Oct 20 2004, 19:22:14) [...] In [1]: import Numeric In [2]: print Numeric.__version__ 23.5 In [3]: import arrayfns In [4]: x=Numeric.array([[0, 0, 0, 1], [1, 1, 1, 0]]) In [5]: y=Numeric.array([[0, 1], [0, 1], [1, 0], [1, 0]]) In [6]: print x.typecode() l In [7]: print y.typecode() l In [8]: arrayfns.find_mask(x, y) Out[8]: array([1, 0, 1, 0]) In [9]: arrayfns.find_mask(x.astype("b"), y.astype("b")) Out[9]: array([1, 0, 1, 0]) ((I just realize that it is different python versions (2.3.3 vs. 2.3.4), but I hope this does not matter here)) > > Until that happens: is there a file which I could hand-edit > > in my installation (of course this would only work if it is on the .py > > level) to remove the problem for the moment? > > This is untested, but it should work: just before the error I isolated > above, put the line > > below = below.astype(_node_edges3[itype].typecode()) So from the above it seems that in 23.5 (the one I get with debian) only the astype("b") works. Therefore a quick fix (which works for me) is: mask = find_mask (below.astype("b"), _node_edges3 [itype].astype("b")) I think that this should be enough of an example to ask the debian maintainer of python-numeric for an update. ((Somehow I am wondering, for how long the first release of the 23.5 tarball was there ... very unfortunate ...)) Unless there are any further comments, I will mail the maintainer tomorrow. Best, Arnd From falted at pytables.org Thu Oct 21 04:58:54 2004 From: falted at pytables.org (Francesc Alted) Date: Thu, 21 Oct 2004 10:58:54 +0200 Subject: [SciPy-user] Problems testing SciPy 0.3.2 In-Reply-To: References: <200410151228.36231.falted@pytables.org> <200410161131.14635.falted@pytables.org> Message-ID: <200410211058.54225.falted@pytables.org> Hi again Pearu A Dissabte 16 Octubre 2004 12:39, Pearu Peterson va escriure: > Actually, scipy has currently about 970 level=0 tests. Look at the > beginning of scipy.test() output to see if there are any error messages > present. I got back to try to compile scipy once more. Now, I'm using your ATLAS libraries. I'm having the same problem, and I cannot see important errors (besides missing test files warnings) at the beginning of scipy.test() output. One curious thing is that, when I run the tests the first time, I'm getting: >>> import scipy >>> scipy.test(level=1) Ran 695 tests in 1.534s FAILED (errors=2) And, if I run the tests a second time, I get: >>> import scipy >>> scipy.test(level=1) Ran 823 tests in 1.555s FAILED (errors=42) I don't know why. I'm (hopefully) attaching the outputs of respective first and second test runs. Cheers, -- Francesc Alted -------------- next part -------------- [alted at api SciPy_complete-0.3.2]$ python Python 2.3.4 (#1, Jul 22 2004, 20:47:54) [GCC 3.3.2 20031022 (Red Hat Linux 3.3.2-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import scipy >>> scipy.test(level=1) !! No test file 'test_Mplot.py' found for !! No test file 'test_lena.py' found for !! No test file 'test_build_py.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_ltisys.py' found for !! No test file 'test_info_integrate.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_vq.py' found for !! No test file 'test___init__.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy/linalg/matfuncs.py:12: ImportError: cannot import name Matrix (in ?) !! No test file 'test_ccompiler.py' found for !! No test file 'test_info_interpolate.py' found for !! No test file 'test_gist.py' found for !! No test file 'test___cvs_version__.py' found for !! No test file 'test_info_cow.py' found for !! No test file 'test_gistC.py' found for !! No test file 'test_spam.py' found for !! No test file 'test_quadpack.py' found for !! No test file 'test_info_gplt.py' found for !! No test file 'test_tree.py' found for Found 92 tests for scipy.stats.stats Found 36 tests for scipy.linalg.decomp !! No test file 'test_display_test.py' found for !! No test file 'test_config_compiler.py' found for !! No test file 'test_quadrature.py' found for !! No test file 'test___init__.py' found for Found 20 tests for scipy.fftpack.pseudo_diffs !! No test file 'test_optimize.py' found for !! No test file 'test__dsuperlu.py' found for !! No test file 'test_scipy_test_version.py' found for !! No test file 'test_plwf.py' found for !! No test file 'test_build_clib.py' found for !! No test file 'test_specfun.py' found for !! No test file 'test__compiled_base.py' found for !! No test file 'test_common_routines.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_shapetest.py' found for !! No test file 'test_sparsetools.py' found for !! No test file 'test__fftpack.py' found for Found 5 tests for scipy.interpolate.fitpack !! No test file 'test_calc_lwork.py' found for !! No test file 'test___cvs_version__.py' found for !! No test file 'test__ssuperlu.py' found for !! No test file 'test_info_io.py' found for !! No test file 'test___init__.py' found for !! No test file 'test___cvs_version__.py' found for !! No test file 'test__flinalg.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_linesearch.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_convolve.py' found for !! No test file 'test___init__.py' found for Found 4 tests for scipy.linalg.lapack !! No test file 'test_ga_list.py' found for !! No test file 'test_special_version.py' found for Found 19 tests for scipy.fftpack.basic !! No test file 'test_fitpack2.py' found for !! No test file 'test_gene.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_info_plt.py' found for !! No test file 'test_numpyio.py' found for !! No test file 'test_extension.py' found for !! No test file 'test_scipy_base_version.py' found for !! No test file 'test_algorithm.py' found for !! No test file 'test_info_xplt.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_cblas.py' found for !! No test file 'test_pyPlot.py' found for !! No test file 'test_info_cluster.py' found for !! No test file 'test_mio.py' found for !! No test file 'test_install_data.py' found for !! No test file 'test___init__.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_selection.py' found for !! No test file 'test_fftpack_version.py' found for !! No test file 'test_movie.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_scaling.py' found for !! No test file 'test_bdist_rpm.py' found for Found 41 tests for scipy.linalg.basic !! No test file 'test_odepack.py' found for !! No test file 'test_exec_command.py' found for !! No test file 'test_interpolate.py' found for !! No test file 'test_language.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_linalg_version.py' found for !! No test file 'test_interface.py' found for !! No test file 'test___init__.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_minpack2.py' found for !! No test file 'test_machar.py' found for !! No test file 'test_log.py' found for !! No test file 'test_info_scipy_base.py' found for Found 342 tests for scipy.special.basic !! No test file 'test_unixccompiler.py' found for !! No test file 'test_clapack.py' found for !! No test file 'test_interface.py' found for !! No test file 'test_scimath.py' found for !! No test file 'test_new_plot.py' found for !! No test file 'test_futil.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_matfuncs.py:25: ImportError: cannot import name signm (in ?) !! No test file 'test___init__.py' found for !! No test file 'test___init__.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_scipy_distutils_version.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_info_signal.py' found for !! No test file 'test_sync_cluster.py' found for !! No test file 'test__quadpack.py' found for !! No test file 'test_bsplines.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_yorick.py' found for !! No test file 'test_testing.py' found for !! No test file 'test_scipy_version.py' found for !! No test file 'test_info_fftpack.py' found for !! No test file 'test_info_linalg.py' found for !! No test file 'test_build_src.py' found for !! No test file 'test__odepack.py' found for !! No test file 'test_flapack.py' found for !! No test file 'test_pexec.py' found for !! No test file 'test_population.py' found for !! No test file 'test_cephes.py' found for !! No test file 'test_helpmod.py' found for !! No test file 'test_sigtools.py' found for !! No test file 'test__support.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_filter_design.py' found for Found 10 tests for scipy.stats.morestats !! No test file 'test_ga_util.py' found for !! No test file 'test_genome.py' found for !! No test file 'test_waveforms.py' found for Found 26 tests for scipy.sparse.Sparse !! No test file 'test_install.py' found for !! No test file 'test_common_routines.py' found for !! No test file 'test_dist.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_pl3d.py' found for !! No test file 'test_info_special.py' found for !! No test file 'test_flinalg.py' found for Found 14 tests for scipy.linalg.blas !! No test file 'test_from_template.py' found for !! No test file 'test_rv.py' found for !! No test file 'test_tree_opt.py' found for !! No test file 'test_spline.py' found for !! No test file 'test___init__.py' found for Found 2 tests for scipy.xxx.foo !! No test file 'test_pilutil.py' found for !! No test file 'test__fitpack.py' found for !! No test file 'test__zsuperlu.py' found for !! No test file 'test__csuperlu.py' found for !! No test file 'test_orthogonal.py' found for !! No test file 'test_dfitpack.py' found for !! No test file 'test_core.py' found for !! No test file 'test__superlu.py' found for !! No test file 'test___init__.py' found for Found 70 tests for scipy.stats.distributions !! No test file 'test_rand.py' found for !! No test file 'test_info_stats.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_sdist.py' found for !! No test file 'test_info_sparse.py' found for !! No test file 'test_statlib.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_plot_utility.py' found for !! No test file 'test_info_xxx.py' found for Found 4 tests for scipy.fftpack.helper !! No test file 'test_info_optimize.py' found for !! No test file 'test_build.py' found for !! No test file 'test_line_endings.py' found for !! No test file 'test_install_headers.py' found for !! No test file 'test_polynomial.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_ppimport.py' found for !! No test file 'test_misc_util.py' found for !! No test file 'test_cow.py' found for !! No test file 'test_build_ext.py' found for Found 0 tests for __main__ ..................................................................................................................................................../users/exp/alted/bin-i686/lib/python/scipy/interpolate/fitpack2.py:412: UserWarning: The coefficients of the spline returned have been computed as the minimal norm least-squares solution of a (numerically) rank deficient system (deficiency=7). If deficiency is large, the results may be inaccurate. Deficiency may strongly depend on the value of eps. warnings.warn(message) ............................EE..........................................................................................................................................................................................................................................................................Gegenbauer, a = 1.5039678737 .......................................................................................shifted jacobi p,q = 2.36650614052 2.72481193129 ..............................Ties preclude use of exact statistic. ..Ties preclude use of exact statistic. ..........................................................Testing alpha .Testing anglit .Testing arcsine ..Testing beta .Testing betaprime ..Testing bradford .Testing burr .Testing cauchy .Testing chi .Testing chi2 .Testing dgamma ..Testing dweibull .Testing erlang .Testing expon .Testing exponpow .Testing exponweib .Testing f .Testing fatiguelife .Testing fisk .Testing foldcauchy .Testing foldnorm .Testing frechet_l .Testing frechet_r .Testing gamma .Testing genextreme .Testing gengamma .Testing genhalflogistic .Testing genlogistic .Testing genpareto ..Testing gilbrat .Testing gompertz .Testing gumbel_l .Testing gumbel_r .Testing halfcauchy .Testing halflogistic .Testing halfnorm ..Testing hypsecant .Testing laplace .Testing loggamma .Testing logistic .Testing lognorm ..Testing lomax .Testing maxwell .Testing nakagami ..Testing ncf .Testing nct .Testing ncx2 .Testing norm .Testing pareto ..Testing powerlaw ....Testing rayleigh .Testing reciprocal .Testing t .Testing triang .Testing tukeylambda .Testing uniform .Testing weibull_max .Testing weibull_min ...... ====================================================================== ERROR: check_random (scipy.linalg.basic.test_basic.test_det) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_basic.py", line 282, in check_random Numeric_det = LinearAlgebra.determinant AttributeError: 'module' object has no attribute 'determinant' ====================================================================== ERROR: check_random_complex (scipy.linalg.basic.test_basic.test_det) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_basic.py", line 292, in check_random_complex Numeric_det = LinearAlgebra.determinant AttributeError: 'module' object has no attribute 'determinant' ---------------------------------------------------------------------- Ran 695 tests in 1.534s FAILED (errors=2) -------------- next part -------------- >>> scipy.test(level=1) !! No test file 'test_Mplot.py' found for !! No test file 'test_lena.py' found for !! No test file 'test_build_py.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_ltisys.py' found for !! No test file 'test_info_integrate.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_vq.py' found for !! No test file 'test___init__.py' found for Found 128 tests for scipy.linalg.fblas !! No test file 'test_ccompiler.py' found for !! No test file 'test_info_interpolate.py' found for !! No test file 'test_gist.py' found for !! No test file 'test___cvs_version__.py' found for !! No test file 'test_info_cow.py' found for !! No test file 'test_gistC.py' found for !! No test file 'test_spam.py' found for !! No test file 'test_quadpack.py' found for !! No test file 'test_info_gplt.py' found for !! No test file 'test_tree.py' found for Found 92 tests for scipy.stats.stats Found 36 tests for scipy.linalg.decomp !! No test file 'test_display_test.py' found for !! No test file 'test_config_compiler.py' found for !! No test file 'test_quadrature.py' found for !! No test file 'test___init__.py' found for Found 20 tests for scipy.fftpack.pseudo_diffs !! No test file 'test_optimize.py' found for !! No test file 'test__dsuperlu.py' found for !! No test file 'test_scipy_test_version.py' found for !! No test file 'test_plwf.py' found for !! No test file 'test_build_clib.py' found for !! No test file 'test_specfun.py' found for !! No test file 'test__compiled_base.py' found for !! No test file 'test_common_routines.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_shapetest.py' found for !! No test file 'test_sparsetools.py' found for !! No test file 'test__fftpack.py' found for Found 5 tests for scipy.interpolate.fitpack !! No test file 'test_calc_lwork.py' found for !! No test file 'test___cvs_version__.py' found for !! No test file 'test__ssuperlu.py' found for !! No test file 'test_info_io.py' found for !! No test file 'test___init__.py' found for !! No test file 'test___cvs_version__.py' found for !! No test file 'test__flinalg.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_linesearch.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_convolve.py' found for !! No test file 'test___init__.py' found for Found 4 tests for scipy.linalg.lapack !! No test file 'test_ga_list.py' found for !! No test file 'test_special_version.py' found for Found 19 tests for scipy.fftpack.basic !! No test file 'test_fitpack2.py' found for !! No test file 'test_gene.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_info_plt.py' found for !! No test file 'test_numpyio.py' found for !! No test file 'test_extension.py' found for !! No test file 'test_scipy_base_version.py' found for !! No test file 'test_algorithm.py' found for !! No test file 'test_info_xplt.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_cblas.py' found for !! No test file 'test_pyPlot.py' found for !! No test file 'test_info_cluster.py' found for !! No test file 'test_mio.py' found for !! No test file 'test_install_data.py' found for !! No test file 'test___init__.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_selection.py' found for !! No test file 'test_fftpack_version.py' found for !! No test file 'test_movie.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_scaling.py' found for !! No test file 'test_bdist_rpm.py' found for Found 41 tests for scipy.linalg.basic !! No test file 'test_odepack.py' found for !! No test file 'test_exec_command.py' found for !! No test file 'test_interpolate.py' found for !! No test file 'test_language.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_linalg_version.py' found for !! No test file 'test_interface.py' found for !! No test file 'test___init__.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_minpack2.py' found for !! No test file 'test_machar.py' found for !! No test file 'test_log.py' found for !! No test file 'test_info_scipy_base.py' found for Found 342 tests for scipy.special.basic !! No test file 'test_unixccompiler.py' found for !! No test file 'test_clapack.py' found for !! No test file 'test_interface.py' found for !! No test file 'test_scimath.py' found for !! No test file 'test_new_plot.py' found for !! No test file 'test_futil.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_matfuncs.py:25: ImportError: cannot import name signm (in ?) !! No test file 'test___init__.py' found for !! No test file 'test___init__.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_scipy_distutils_version.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_info_signal.py' found for !! No test file 'test_sync_cluster.py' found for !! No test file 'test__quadpack.py' found for !! No test file 'test_bsplines.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_yorick.py' found for !! No test file 'test_testing.py' found for !! No test file 'test_scipy_version.py' found for !! No test file 'test_info_fftpack.py' found for !! No test file 'test_info_linalg.py' found for !! No test file 'test_build_src.py' found for !! No test file 'test__odepack.py' found for !! No test file 'test_flapack.py' found for !! No test file 'test_pexec.py' found for !! No test file 'test_population.py' found for !! No test file 'test_cephes.py' found for !! No test file 'test_helpmod.py' found for !! No test file 'test_sigtools.py' found for !! No test file 'test__support.py' found for !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! FAILURE importing tests for /users/exp/alted/bin-i686//lib/python/scipy_base/ppimport.py:68: AttributeError: 'module' object has no attribute 'Matrix' (in ppimport_attr) !! No test file 'test_filter_design.py' found for Found 10 tests for scipy.stats.morestats !! No test file 'test_ga_util.py' found for !! No test file 'test_genome.py' found for !! No test file 'test_waveforms.py' found for Found 26 tests for scipy.sparse.Sparse !! No test file 'test_install.py' found for !! No test file 'test_common_routines.py' found for !! No test file 'test_dist.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_pl3d.py' found for !! No test file 'test_info_special.py' found for !! No test file 'test_flinalg.py' found for Found 14 tests for scipy.linalg.blas !! No test file 'test_from_template.py' found for !! No test file 'test_rv.py' found for !! No test file 'test_tree_opt.py' found for !! No test file 'test_spline.py' found for !! No test file 'test___init__.py' found for Found 2 tests for scipy.xxx.foo !! No test file 'test_pilutil.py' found for !! No test file 'test__fitpack.py' found for !! No test file 'test__zsuperlu.py' found for !! No test file 'test__csuperlu.py' found for !! No test file 'test_orthogonal.py' found for !! No test file 'test_dfitpack.py' found for !! No test file 'test_core.py' found for !! No test file 'test__superlu.py' found for !! No test file 'test___init__.py' found for Found 70 tests for scipy.stats.distributions !! No test file 'test_rand.py' found for !! No test file 'test_info_stats.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_sdist.py' found for !! No test file 'test_info_sparse.py' found for !! No test file 'test_statlib.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_plot_utility.py' found for !! No test file 'test_info_xxx.py' found for Found 4 tests for scipy.fftpack.helper !! No test file 'test_info_optimize.py' found for !! No test file 'test_build.py' found for !! No test file 'test_line_endings.py' found for !! No test file 'test_install_headers.py' found for !! No test file 'test_polynomial.py' found for !! No test file 'test___init__.py' found for !! No test file 'test_ppimport.py' found for !! No test file 'test_misc_util.py' found for !! No test file 'test_cow.py' found for !! No test file 'test_build_ext.py' found for Found 0 tests for __main__ ...caxpy:n=4 ..caxpy:n=3 ....ccopy:n=4 ..ccopy:n=3 ..EEEEEEEEEE.cscal:n=4 ....cswap:n=4 ..cswap:n=3 .....daxpy:n=4 ..daxpy:n=3 ....dcopy:n=4 ..dcopy:n=3 ..EEEEEEEEEE.dscal:n=4 ....dswap:n=4 ..dswap:n=3 .....saxpy:n=4 ..saxpy:n=3 ....scopy:n=4 ..scopy:n=3 ..EEEEEEEEEE.sscal:n=4 ....sswap:n=4 ..sswap:n=3 .....zaxpy:n=4 ..zaxpy:n=3 ....zcopy:n=4 ..zcopy:n=3 ..EEEEEEEEEE.zscal:n=4 ....zswap:n=4 ..zswap:n=3 ..................................................................................................................................................................................EE..........................................................................................................................................................................................................................................................................Gegenbauer, a = 1.3990139434 .......................................................................................shifted jacobi p,q = 3.02930729325 3.63846816206 ..............................Ties preclude use of exact statistic. ..Ties preclude use of exact statistic. ..........................................................Testing alpha .Testing anglit .Testing arcsine ..Testing beta .Testing betaprime ..Testing bradford .Testing burr .Testing cauchy .Testing chi .Testing chi2 .Testing dgamma ..Testing dweibull .Testing erlang .Testing expon .Testing exponpow .Testing exponweib .Testing f .Testing fatiguelife .Testing fisk .Testing foldcauchy .Testing foldnorm .Testing frechet_l .Testing frechet_r .Testing gamma .Testing genextreme .Testing gengamma .Testing genhalflogistic .Testing genlogistic .Testing genpareto ..Testing gilbrat .Testing gompertz .Testing gumbel_l .Testing gumbel_r .Testing halfcauchy .Testing halflogistic .Testing halfnorm ..Testing hypsecant .Testing laplace .Testing loggamma .Testing logistic .Testing lognorm ..Testing lomax .Testing maxwell .Testing nakagami ..Testing ncf .Testing nct .Testing ncx2 .Testing norm .Testing pareto ..Testing powerlaw ....Testing rayleigh .Testing reciprocal .Testing t .Testing triang .Testing tukeylambda .Testing uniform .Testing weibull_max .Testing weibull_min ...... ====================================================================== ERROR: check_default_beta_y (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 317, in check_default_beta_y alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 312, in check_simple alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple_transpose (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 322, in check_simple_transpose alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple_transpose_conj (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 327, in check_simple_transpose_conj alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 332, in check_x_stride alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride_assert (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 343, in check_x_stride_assert alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride_transpose (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 337, in check_x_stride_transpose alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 355, in check_y_stride alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride_assert (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 368, in check_y_stride_assert alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride_transpose (scipy.linalg.fblas.test_fblas.test_cgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 361, in check_y_stride_transpose alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_default_beta_y (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 317, in check_default_beta_y alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 312, in check_simple alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple_transpose (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 322, in check_simple_transpose alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple_transpose_conj (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 327, in check_simple_transpose_conj alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 332, in check_x_stride alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride_assert (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 343, in check_x_stride_assert alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride_transpose (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 337, in check_x_stride_transpose alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 355, in check_y_stride alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride_assert (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 368, in check_y_stride_assert alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride_transpose (scipy.linalg.fblas.test_fblas.test_dgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 361, in check_y_stride_transpose alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_default_beta_y (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 317, in check_default_beta_y alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 312, in check_simple alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple_transpose (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 322, in check_simple_transpose alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple_transpose_conj (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 327, in check_simple_transpose_conj alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 332, in check_x_stride alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride_assert (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 343, in check_x_stride_assert alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride_transpose (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 337, in check_x_stride_transpose alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 355, in check_y_stride alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride_assert (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 368, in check_y_stride_assert alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride_transpose (scipy.linalg.fblas.test_fblas.test_sgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 361, in check_y_stride_transpose alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_default_beta_y (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 317, in check_default_beta_y alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 312, in check_simple alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple_transpose (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 322, in check_simple_transpose alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_simple_transpose_conj (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 327, in check_simple_transpose_conj alpha,beta,a,x,y = self.get_data() File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 332, in check_x_stride alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride_assert (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 343, in check_x_stride_assert alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_x_stride_transpose (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 337, in check_x_stride_transpose alpha,beta,a,x,y = self.get_data(x_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 355, in check_y_stride alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride_assert (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 368, in check_y_stride_assert alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_y_stride_transpose (scipy.linalg.fblas.test_fblas.test_zgemv) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 361, in check_y_stride_transpose alpha,beta,a,x,y = self.get_data(y_stride=2) File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_fblas.py", line 304, in get_data from RandomArray import normal ImportError: cannot import name normal ====================================================================== ERROR: check_random (scipy.linalg.basic.test_basic.test_det) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_basic.py", line 282, in check_random Numeric_det = LinearAlgebra.determinant AttributeError: 'module' object has no attribute 'determinant' ====================================================================== ERROR: check_random_complex (scipy.linalg.basic.test_basic.test_det) ---------------------------------------------------------------------- Traceback (most recent call last): File "/users/exp/alted/bin-i686//lib/python/scipy/linalg/tests/test_basic.py", line 292, in check_random_complex Numeric_det = LinearAlgebra.determinant AttributeError: 'module' object has no attribute 'determinant' ---------------------------------------------------------------------- Ran 823 tests in 1.555s FAILED (errors=42) From arnd.baecker at web.de Thu Oct 21 05:45:45 2004 From: arnd.baecker at web.de (Arnd Baecker) Date: Thu, 21 Oct 2004 11:45:45 +0200 (CEST) Subject: [SciPy-user] scipy debian packages In-Reply-To: References: <41764C02.5090905@ucsd.edu> Message-ID: On Thu, 21 Oct 2004, Arnd Baecker wrote: [...] > Therefore a quick fix (which works for me) is: > > mask = find_mask (below.astype("b"), _node_edges3 [itype].astype("b")) I am just wondering whether it would be good to include this fix (in slice3.py of scipy/xplt) in scipy CVS (I don't know in which version of Numeric this problem started, but maybe there are already quite a few installations and if someone then tries to install scipy on top of this Numeric he will run into the problem? (or would be a unit test in scipy for find_mask a better idea?) Best, Arnd From falted at pytables.org Thu Oct 21 07:21:50 2004 From: falted at pytables.org (Francesc Alted) Date: Thu, 21 Oct 2004 13:21:50 +0200 Subject: [SciPy-user] vectorize in scipy 0.3.2? Message-ID: <200410211321.50842.falted@pytables.org> Hi, I'm having problems with the vectorize function of scipy. Look: $ python Python 2.3.4 (#1, Jul 22 2004, 20:47:54) [GCC 3.3.2 20031022 (Red Hat Linux 3.3.2-1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from scipy import * >>> def addsubtract(a,b): ... if a > b: ... return a - b ... else: ... return a + b ... >>> vec_addsubstract = vectorize(addsubtract) >>> vec_addsubtract([0,3,6,9],[1,3,5,7]) Traceback (most recent call last): File "", line 1, in ? NameError: name 'vec_addsubtract' is not defined and I've tested it on a debian box, with debian packages (http://deb-scipy.alioth.debian.org/apt) with the same result. Some hint? Cheers, -- Francesc Alted From nwagner at mecha.uni-stuttgart.de Thu Oct 21 07:35:00 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 21 Oct 2004 13:35:00 +0200 Subject: [SciPy-user] vectorize in scipy 0.3.2? In-Reply-To: <200410211321.50842.falted@pytables.org> References: <200410211321.50842.falted@pytables.org> Message-ID: <41779EE4.7000005@mecha.uni-stuttgart.de> Francesc Alted wrote: >Hi, > >I'm having problems with the vectorize function of scipy. Look: > >$ python >Python 2.3.4 (#1, Jul 22 2004, 20:47:54) >[GCC 3.3.2 20031022 (Red Hat Linux 3.3.2-1)] on linux2 >Type "help", "copyright", "credits" or "license" for more information. > > >>>>from scipy import * >>>>def addsubtract(a,b): >>>> >>>> >... if a > b: >... return a - b >... else: >... return a + b >... > > >>>>vec_addsubstract = vectorize(addsubtract) >>>>vec_addsubtract([0,3,6,9],[1,3,5,7]) >>>> >>>> ^^^^^^^^^^^ s is missing HTH, Nils >Traceback (most recent call last): > File "", line 1, in ? >NameError: name 'vec_addsubtract' is not defined > >and I've tested it on a debian box, with debian packages >(http://deb-scipy.alioth.debian.org/apt) with the same result. > >Some hint? > >Cheers, > > > From janjan at ini.phys.ethz.ch Thu Oct 21 07:39:03 2004 From: janjan at ini.phys.ethz.ch (Jan-Jan van der Vyver) Date: Thu, 21 Oct 2004 13:39:03 +0200 Subject: [SciPy-user] scipy 0.3.2 ebuild Message-ID: <1098358743.9908.78.camel@localhost> Dear Scipy-Users, I've added an Gentoo ebuild that works for me. It gets compiled without problems. I am complete noob, I only updated the ebuild (based upon work by Travis Oliphant?? I think) to get 0.3.2. It might be helpful. I do, however, get sporadic errors, under iPython, when testing scipy. Most of the time I get : ---------------------------------------------------------------------- Ran 972 tests in 1.796s OK Sometimes : FAIL: check_cdf (scipy.stats.distributions.test_distributions.test_fatiguelife) ---------------------------------------------------------------------- Traceback (most recent call last): File "", line 10, in check_cdf AssertionError: D = 0.351919695674; pval = 0.000396083177198; alpha = 0.01 args = (1.0783474814080036,) ---------------------------------------------------------------------- Ran 972 tests in 1.776s FAILED (failures=1) Why is this? Is it critical? MfG, Jan-Jan PS. I'm using the 2.6.8 kernel with SMP and preemptive support. -------------- next part -------------- # Copyright 2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header$ inherit distutils MY_PN="SciPy_complete-${PV}" SRC_URI="http://www.scipy.org/download/scipy/src/${MY_PN}.tar.gz" DESCRIPTION="Open source scientific tools for Python" HOMEPAGE="http://www.scipy.org/" LICENSE="BSD" SLOT="0" IUSE="fftw wxwindows" # ?? swig vtk KEYWORDS="~x86" S="${WORKDIR}/${MY_PN}" # gcc must be built with USE=f77 or atlas will fail! DEPEND=">=dev-lang/python-2.3.3 >=dev-python/numeric-23.3 >=sys-devel/gcc-3 >=dev-libs/atlas-3.6.0 >=dev-python/imaging-1.1.4 >=app-sci/lapack-atlas-3.2.1 >=dev-python/f2py-2.39.235.1693 fftw? ( =dev-libs/fftw-2.1* ) wxwindows? ( >=dev-python/wxpython-2.4 )" src_install() { # base class distutils_src_install # Extra docs dodoc `ls *.txt` } pkg_postinst() { # Base class distutils_pkg_postinst # Unit testing -- good form in the Python world einfo "Testing installation ..." python -c "import scipy; scipy.test(level=1)" || die "Unit tests failed!" # A helpful message re. plotting einfo "Emerge media-gfx/gnuplot to use the 'gplt' plotting facility" [ `use wxwindows` ] || \ einfo "Set USE=wxwindows and re-emerge to use the newer 'plt' plotter" } -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: From falted at pytables.org Thu Oct 21 07:45:33 2004 From: falted at pytables.org (Francesc Alted) Date: Thu, 21 Oct 2004 13:45:33 +0200 Subject: [SciPy-user] vectorize in scipy 0.3.2? In-Reply-To: <41779EE4.7000005@mecha.uni-stuttgart.de> References: <200410211321.50842.falted@pytables.org> <41779EE4.7000005@mecha.uni-stuttgart.de> Message-ID: <200410211345.33749.falted@pytables.org> A Dijous 21 Octubre 2004 13:35, Nils Wagner va escriure: > >>>>vec_addsubstract = vectorize(addsubtract) > >>>>vec_addsubtract([0,3,6,9],[1,3,5,7]) > >>>> > >>>> > ^^^^^^^^^^^ > > s is missing Oh, my bad!. Although strictly speaking this was indirectly caused by a combination of a small glitch in Travis' SciPy tutorial (in page 5) and my laziness that made me use and abuse the cut&paste ;) Thanks! -- Francesc Alted From Gabriel.Gellner at mail.mcgill.ca Thu Oct 21 11:41:20 2004 From: Gabriel.Gellner at mail.mcgill.ca (Gabriel Gellner) Date: Thu, 21 Oct 2004 11:41:20 -0400 Subject: [SciPy-user] Event monitor for ode solver? Message-ID: <20041021154120.GA8621@station1.uoguelph.ca> Is there any mechanism in SciPy for monitoring some relationship to the variables from an call to odeint as they are found? (I'm am thinking of something like the Event mechanism in matlab) I am doing simple bifurcation analysis, harvisting the local max/min values using ODEPACK in fortran 90. But I would like to do some of this type of analysis in SciPy if possible . . . thanks, Gabriel From falted at pytables.org Thu Oct 21 12:03:24 2004 From: falted at pytables.org (Francesc Alted) Date: Thu, 21 Oct 2004 18:03:24 +0200 Subject: [SciPy-user] Derivative() usage? Message-ID: <200410211803.24608.falted@pytables.org> Hi, I'm trying to figure out how to compute the derivatives of a function with scipy, but the documentation is a bit terse for me: def derivative(func,x0,dx=1.0,n=1,args=(),order=3): """Given a function, use an N-point central differenece formula with spacing dx to compute the nth derivative at x0, where N is the value of order and must be odd. Warning: Decreasing the step size too small can result in round-off error. """ I would like to compute a derivative of an arbitrary order, but by reading the docs, I'm not sure what the n and order parameters exactly means. Someone smarter than me can help me? -- Francesc Alted From oliphant at ee.byu.edu Thu Oct 21 12:59:14 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 21 Oct 2004 10:59:14 -0600 Subject: [SciPy-user] Derivative() usage? In-Reply-To: <200410211803.24608.falted@pytables.org> References: <200410211803.24608.falted@pytables.org> Message-ID: <4177EAE2.7080706@ee.byu.edu> Francesc Alted wrote: >Hi, > >I'm trying to figure out how to compute the derivatives of a function with >scipy, but the documentation is a bit terse for me: > >def derivative(func,x0,dx=1.0,n=1,args=(),order=3): > """Given a function, use an N-point central differenece > formula with spacing dx to compute the nth derivative at > x0, where N is the value of order and must be odd. > > Warning: Decreasing the step size too small can result in > round-off error. > """ > >I would like to compute a derivative of an arbitrary order, but by reading >the docs, I'm not sure what the n and order parameters exactly means. > > > n is the derivative you are computing and order is the order of the central difference approximateion formula you will use to approximate it (i.e. how many sample values of func will be used) order should probably default to n+2 or something rather than only three all the time. But suggestions are welcome. -Travis O. From oliphant at ee.byu.edu Thu Oct 21 13:01:39 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 21 Oct 2004 11:01:39 -0600 Subject: [SciPy-user] scipy debian packages In-Reply-To: References: <4176378D.2050706@ucsd.edu> Message-ID: <4177EB73.1050100@ee.byu.edu> Arnd Baecker wrote: >On Wed, 20 Oct 2004, Robert Kern wrote: > > > >>Arnd Baecker wrote: >> >> >> >>> File "/usr/lib/python2.3/site-packages/scipy/xplt/slice3.py", line 1575, >>>in _construct3 >>> mask = find_mask (below, _node_edges3 [itype]) >>>TypeError: Array can not be safely cast to required type >>> >>> >>This is a problem with Numeric. Bug the maintainer of python-numeric to >>update from the latest 23.5 tarball. The fix somehow didn't make it into >>the first release of the 23.5 tarball but should be in the copy there now. >> >> > >Many thanks! Do you have a simple example demonstrating the problem >in pure Numeric code? >(this would make it simpler to illustrate/test the problem without >referring to scipy and thus more convincing, IMHO). > >Until that happens: is there a file which I could hand-edit >in my installation (of course this would only work if it is on the .py >level) to remove the problem for the moment? > > > don't import slice3.py -Travis From oliphant at ee.byu.edu Thu Oct 21 13:04:15 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 21 Oct 2004 11:04:15 -0600 Subject: [SciPy-user] scipy debian packages In-Reply-To: References: <41764C02.5090905@ucsd.edu> Message-ID: <4177EC0F.6000502@ee.byu.edu> Arnd Baecker wrote: >I think that this should be enough of an example to ask the debian >maintainer of python-numeric for an update. >((Somehow I am wondering, for how long the first release of >the 23.5 tarball was there ... very unfortunate ...)) >Unless there are any further comments, I will mail >the maintainer tomorrow. > > This was an unfortunate mistake. The problem was the windows version of 23.5 had this fixed, but I uploaded the wrong tarball and so the unix version did not. It was like this for a few days unfortunately and left an inconsistency between the windows release and the full release. -Travis From rkern at ucsd.edu Thu Oct 21 13:15:03 2004 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 21 Oct 2004 10:15:03 -0700 Subject: [SciPy-user] Derivative() usage? In-Reply-To: <200410211803.24608.falted@pytables.org> References: <200410211803.24608.falted@pytables.org> Message-ID: <4177EE97.2060701@ucsd.edu> Francesc Alted wrote: > Hi, > > I'm trying to figure out how to compute the derivatives of a function with > scipy, but the documentation is a bit terse for me: > > def derivative(func,x0,dx=1.0,n=1,args=(),order=3): > """Given a function, use an N-point central differenece > formula with spacing dx to compute the nth derivative at > x0, where N is the value of order and must be odd. > > Warning: Decreasing the step size too small can result in > round-off error. > """ > > I would like to compute a derivative of an arbitrary order, but by reading > the docs, I'm not sure what the n and order parameters exactly means. > > Someone smarter than me can help me? 'n' as in d^n/dx^n . Somewhat confusingly, 'N' is being used in the docstring as a synonym for 'order' and is the number of discrete points used to evaluate the numerical derivative. I'm going to fix that. For example, when n=2, and order=3, one is computing the second central derivative using 3 points [x0-dx, x0, x0+dx]. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From falted at pytables.org Thu Oct 21 14:20:50 2004 From: falted at pytables.org (Francesc Alted) Date: Thu, 21 Oct 2004 20:20:50 +0200 Subject: [SciPy-user] optimize.leastsq() Message-ID: <200410212020.50725.falted@pytables.org> Hi, Sorry for the bunch of questions, but I'm preparing some 'hands-on' on scipy, and I'm excercising many parts of it. I've tried to follow the Travis' tutorial for finding the best fit of a series of data, but my results are different from those stated there: In [96]: x = arange(0,6e-2,6e-2/30) In [97]: A,k,theta = 10, 1.0/3e-2, pi/6 In [98]: y_true = A*sin(2*pi*k*x+theta) In [99]: y_meas = y_true + 2*randn(len(x)) In [100]: def residuals(p, y, x): .....: A,k,theta = p .....: err = y-A*sin(2*pi*k*x+theta) .....: return err .....: In [101]: p0 = [8, 1/2.3e-2, pi/3] In [107]: optimize.leastsq(residuals, p0, args=(y_meas, x)) Out[107]: (array([ -2.17634575, 57.4116454 , -3.03266312]), 'Both actual and predicted relative reductions in the sum of squares\n are at most 0.000000') this results are quite different from the 'true' values: [ 10. 33.3333 0.5236] Do you have any idea about this error? I suppose that the message should indicate it, but I can't understand it. I'm using scipy 0.3.2 on Linux. BTW, thanks for clearifying the question about derivative() parameters. It's much more clear now. -- Francesc Alted From oliphant at ee.byu.edu Thu Oct 21 15:01:37 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 21 Oct 2004 13:01:37 -0600 Subject: [SciPy-user] optimize.leastsq() In-Reply-To: <200410212020.50725.falted@pytables.org> References: <200410212020.50725.falted@pytables.org> Message-ID: <41780791.8010506@ee.byu.edu> Francesc Alted wrote: >Hi, > >Sorry for the bunch of questions, but I'm preparing some 'hands-on' on >scipy, and I'm excercising many parts of it. > >I've tried to follow the Travis' tutorial for finding the best fit of a >series of data, but my results are different from those stated there: > >In [96]: x = arange(0,6e-2,6e-2/30) > >In [97]: A,k,theta = 10, 1.0/3e-2, pi/6 > >In [98]: y_true = A*sin(2*pi*k*x+theta) > >In [99]: y_meas = y_true + 2*randn(len(x)) > >In [100]: def residuals(p, y, x): > .....: A,k,theta = p > .....: err = y-A*sin(2*pi*k*x+theta) > .....: return err > .....: > >In [101]: p0 = [8, 1/2.3e-2, pi/3] > >In [107]: optimize.leastsq(residuals, p0, args=(y_meas, x)) >Out[107]: >(array([ -2.17634575, 57.4116454 , -3.03266312]), > 'Both actual and predicted relative reductions in the sum of squares\n are at most 0.000000') > >this results are quite different from the 'true' values: >[ 10. 33.3333 0.5236] > >Do you have any idea about this error? I suppose that the message should >indicate it, but I can't understand it. I'm using scipy 0.3.2 on Linux. > > Can you look at the output of peval(x,p) and compare it to y_true? I just re-ran this experiment and get array([-10.053690336957587, 33.659758123232756, 3.591816659730455)]) which seems right (except for the fact that some of the phase has been used to give -10 instead of 10). -Travis O. From zunzun at zunzun.com Thu Oct 21 16:12:56 2004 From: zunzun at zunzun.com (James R. Phillips) Date: Thu, 21 Oct 2004 16:12:56 -0400 (EDT) Subject: [SciPy-user] optimize.leastsq() In-Reply-To: <200410212020.50725.falted@pytables.org> References: <200410212020.50725.falted@pytables.org> Message-ID: <2111.12.40.30.18.1098389576.squirrel@12.40.30.18> > Hi, > > Sorry for the bunch of questions, but I'm preparing some 'hands-on' on > scipy, and I'm excercising many parts of it. Here is a different simple scipy least squares fit: http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2004-January/002452.html James Phillips http://zunzun.com From oliphant at ee.byu.edu Thu Oct 21 19:49:27 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 21 Oct 2004 17:49:27 -0600 Subject: [SciPy-user] New Numeric Message-ID: <41784B07.2000003@ee.byu.edu> Heads up to SciPy Users A new Numeric has been released: version 23.6 Hopefully this will fix the problems with different versions of Numeric 23.5 floating around In addition argmin now works for unsigned arrays and another bug that wouldn't have shown up unless you use unsigned integer arrays with elements that are larger than the largest signed integer type was fixed. A windows binary won't be released until later this evening. But, rpm's and tarballs are available now at sourceforge. -Travis O. From richter at hephy.oeaw.ac.at Thu Oct 21 19:53:47 2004 From: richter at hephy.oeaw.ac.at (Gerald Richter) Date: Fri, 22 Oct 2004 01:53:47 +0200 Subject: [SciPy-user] the meaning of c_ and r_ Message-ID: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at> Hi everybody. Sorry for such a basic question, or maybe two: shouldn't c_[...] result in something like array([ [ . ], [ . ] ]) while r_ results in array([ ... ]) ? why does: In [23]: a = r_[1:3:5j] In [24]: b = c_[2:6:5j] In [25]: b Out[25]: array([ 2., 3., 4., 5., 6.]) In [26]: a Out[26]: array([ 1. , 1.5, 2. , 2.5, 3. ]) In [27]: transpose a -------> transpose(a) Out[27]: array([ 1. , 1.5, 2. , 2.5, 3. ]) In [28]: transpose b -------> transpose(b) Out[28]: array([ 2., 3., 4., 5., 6.]) not allow transposition in the above mentioned way? And: if I got some functions that might be useful to others, and want to contribute them, where do I turn to? I got some interp2() function, modeled after (translated from) the octave algorithm, and a polyfit() more or less woven from same wool... Also I had to implement a Log-likelyhood fitting algorithm, and with some work it could be generalized to be included in scipy, and there's a 2d-integral() on a grid of given surface. I'm working in high-energy physics, and found out, what a beatiful tool for algorithm prototyping scipy can be... AND I think (and one of my colleagues knows already ;) it will work even better in data-analysis, together with the bindings to ROOT (PyROOT) - http://root.cern.ch where Python can provide a really reasonable shell and scripting environment, instead of ROOT's C++ interpreter(!!!), and scipy can do the necessary data manipulations. Cheers, Gerald. -- Gerald Richter phone: +43 1 5447328/27 Institute of high energy physics (HEPHY) http://wwwhephy.oeaw.ac.at/ Vienna/Austria From rkern at ucsd.edu Thu Oct 21 20:24:50 2004 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 21 Oct 2004 17:24:50 -0700 Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at> References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at> Message-ID: <41785352.7090508@ucsd.edu> Gerald Richter wrote: > Hi everybody. > > Sorry for such a basic question, or maybe two: > > shouldn't c_[...] result in something like > array([ [ . ], > [ . ] ]) > while r_ results in > array([ ... ]) > ? Probably. Travis will probably have to step in here and explain what they are supposed to do in this case. > why does: > > In [23]: a = r_[1:3:5j] > > In [24]: b = c_[2:6:5j] > > In [25]: b > Out[25]: array([ 2., 3., 4., 5., 6.]) > > In [26]: a > Out[26]: array([ 1. , 1.5, 2. , 2.5, 3. ]) > > In [27]: transpose a > -------> transpose(a) > Out[27]: array([ 1. , 1.5, 2. , 2.5, 3. ]) > > In [28]: transpose b > -------> transpose(b) > Out[28]: array([ 2., 3., 4., 5., 6.]) > > not allow transposition in the above mentioned way? transpose(a) only flips the order of the axes. For a rank-1 array, it just maps back to itself. Rank-1 arrays are neither strictly row-vectors or strictly column-vectors. If you want to ensure that they are row- or column-vectors, use the atleast_2d() function. In [7]: a = r_[1:3:5j] In [8]: a.shape Out[8]: (5,) In [9]: transpose(a).shape Out[9]: (5,) In [10]: c = atleast_2d(a) In [11]: c.shape Out[11]: (1, 5) In [13]: transpose(c).shape Out[13]: (5, 1) In [14]: c Out[14]: NumPy array, format: long [ [ 1. 1.5 2. 2.5 3. ]] In [15]: transpose(c) Out[15]: NumPy array, format: long [[ 1. ] [ 1.5] [ 2. ] [ 2.5] [ 3. ]] > And: if I got some functions that might be useful to others, and want to > contribute them, where do I turn to? For batting around the issue on the mailing list, you can post them here if they are small, or preferably put them on a website and post the url here. If you know where they ought to go in scipy, you can make a patch and submit it to the issue tracker. Assign the issue to me (rkern), and I'll make sure it gets dealt with. http://www.scipy.net/roundup/scipy/index > I got some interp2() function, modeled after (translated from) the octave > algorithm, and a polyfit() more or less woven from same wool... That's a little murky license-wise. We want to keep everything BSD-licensed, and I assume that the original sources for these functions are GPLed. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From aisaac at american.edu Thu Oct 21 21:56:42 2004 From: aisaac at american.edu (Alan G Isaac) Date: Thu, 21 Oct 2004 21:56:42 -0400 (Eastern Daylight Time) Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: <41785352.7090508@ucsd.edu> References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at><41785352.7090508@ucsd.edu> Message-ID: > Gerald Richter wrote: >> I got some interp2() function, modeled after (translated from) the octave >> algorithm, and a polyfit() more or less woven from same wool... On Thu, 21 Oct 2004, Robert Kern apparently wrote: > That's a little murky license-wise. We want to keep > everything BSD-licensed, and I assume that the original > sources for these functions are GPLed. I hope that in such circumstances Gerald will take the extra step of informing the author of the Octave function of his translation and, as a matter of politeness as well as of possible licensing issues, request permission to release this Python code under the BSD license. Ideally SciPy will have some arrangement for archiving such permissions. fwiw, Alan Isaac From jh at oobleck.astro.cornell.edu Thu Oct 21 23:22:01 2004 From: jh at oobleck.astro.cornell.edu (Joe Harrington) Date: Thu, 21 Oct 2004 23:22:01 -0400 Subject: [SciPy-user] the meaning of c_ and r_ Message-ID: <200410220322.i9M3M144030829@oobleck.astro.cornell.edu> > And: if I got some functions that might be useful to others, and want to > contribute them, where do I turn to? > I'm working in high-energy physics, and found out, what a beatiful tool for > algorithm prototyping scipy can be... AND I think (and one of my colleagues > knows already ;) it will work even better in data-analysis, together with > the bindings to ROOT (PyROOT) > - http://root.cern.ch > where Python can provide a really reasonable shell and scripting > environment, instead of ROOT's C++ interpreter(!!!), and scipy can do the > necessary data manipulations. If you have or know of software that's not appropriate to add to the core scipy release but that is in coherent packages, please list it on the "Topical Software" wiki on scipy.org. Put your link in the Unindexed section. When there's a critical mass of similar stuff, someone will make a separate page and link it into the index page. If everyone would take a moment to list their favorite packages this way, we'd have a comprehensive listing in no time. --jh-- From nwagner at mecha.uni-stuttgart.de Fri Oct 22 03:14:53 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Oct 2004 09:14:53 +0200 Subject: [SciPy-user] Bugs in linalg.qmr linalg.bicg Message-ID: <4178B36D.8030105@mecha.uni-stuttgart.de> Hi all, I found two bugs in linalg.qmr and linalg.bicg. Traceback (most recent call last): File "sparse_it.py", line 19, in ? sol2,info2 = linalg.qmr(A,r) File "/usr/lib/python2.3/site-packages/scipy/linalg/iterative.py", line 576, in qmr rmatvec = get_rmatvec(A) File "/usr/lib/python2.3/site-packages/scipy/linalg/iterative.py", line 26, in __init__ raise ValueError, "Object must be an array "\ ValueError: Object must be an array or have a callable rmatvec attribute. Traceback (most recent call last): File "sparse_it.py", line 20, in ? sol3,info3 = linalg.bicg(A,r) File "/usr/lib/python2.3/site-packages/scipy/linalg/iterative.py", line 154, in bicg rmatvec = get_rmatvec(A) File "/usr/lib/python2.3/site-packages/scipy/linalg/iterative.py", line 26, in __init__ raise ValueError, "Object must be an array "\ ValueError: Object must be an array or have a callable rmatvec attribute. Nils -------------- next part -------------- A non-text attachment was scrubbed... Name: sparse_it.py Type: text/x-python Size: 833 bytes Desc: not available URL: From nwagner at mecha.uni-stuttgart.de Fri Oct 22 04:05:36 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Oct 2004 10:05:36 +0200 Subject: [SciPy-user] linalg.norm for sparse matrices Message-ID: <4178BF50.3030507@mecha.uni-stuttgart.de> Hi all, AFAIK, linalg.norm cannot be used for sparse matrices >>> linalg.norm(A) 0.0 >>> linalg.norm(A.todense()) 1.3656824382572492 Nils From nwagner at mecha.uni-stuttgart.de Fri Oct 22 04:58:29 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Oct 2004 10:58:29 +0200 Subject: [SciPy-user] A.todense() for complex sparse matrices Message-ID: <4178CBB5.7060406@mecha.uni-stuttgart.de> Python 2.3.3 (#1, Apr 6 2004, 01:47:39) [GCC 3.3.3 (SuSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from scipy import * >>> A = sparse.dok_matrix() >>> A[0,0] = 1j >>> A.todense() Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1257, in todense new[ikey0,ikey1] = self[key] TypeError: can't convert complex to float; use abs(z) >>> Nils From nwagner at mecha.uni-stuttgart.de Fri Oct 22 05:05:40 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Oct 2004 11:05:40 +0200 Subject: [SciPy-user] Sparse Complex matrices and iterative solvers Message-ID: <4178CD64.4090002@mecha.uni-stuttgart.de> Hi all, Iterative solvers cannot be used with sparse complex matrices. Traceback (most recent call last): File "sparse_it.py", line 32, in ? sol0,info0 = linalg.gmres(A,r) File "/usr/lib/python2.3/site-packages/scipy/linalg/iterative.py", line 499, in gmres work[slice2] += sclr1*matvec(work[slice1]) TypeError: return array has incorrect type Nils From nwagner at mecha.uni-stuttgart.de Fri Oct 22 05:12:31 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 22 Oct 2004 11:12:31 +0200 Subject: [SciPy-user] Problems with complex matrices Message-ID: <4178CEFF.2050608@mecha.uni-stuttgart.de> Hi all, Another bug is revealed Traceback (most recent call last): File "complex_it.py", line 6, in ? res=dot(A,x)-r File "/usr/lib/python2.3/site-packages/Numeric/dotblas/__init__.py", line 55, in dot if multiarray.array(a).shape == () or multiarray.array(b).shape == (): TypeError: a float is required Nils -------------- next part -------------- A non-text attachment was scrubbed... Name: complex_it.py Type: text/x-python Size: 139 bytes Desc: not available URL: From falted at pytables.org Fri Oct 22 08:00:22 2004 From: falted at pytables.org (Francesc Alted) Date: Fri, 22 Oct 2004 14:00:22 +0200 Subject: [SciPy-user] optimize.leastsq() In-Reply-To: <41780791.8010506@ee.byu.edu> References: <200410212020.50725.falted@pytables.org> <41780791.8010506@ee.byu.edu> Message-ID: <200410221400.22201.falted@pytables.org> A Dijous 21 Octubre 2004 21:01, Travis Oliphant va escriure: > Can you look at the output of peval(x,p) and compare it to y_true? > > I just re-ran this experiment and get > array([-10.053690336957587, 33.659758123232756, 3.591816659730455)]) > > which seems right (except for the fact that some of the phase has been > used to give -10 instead of 10). Mmmm, I've re-run the example again and get [-10.22083869, 34.03240033, 3.41523692] so, I'm afraid that something weird happened in the run I've made yesterday. Perhaps (I'm guessing here) the way to compute deviations, i.e.: y_meas = y_true + 2*randn(len(x)) can give place to values too far from y_true and that can make the algorithm to fail. It's a pity, but I dind't saved the values from my experiment yesterday, so I can't reproduce the problem. Anyway, maybe it would be sensible to change the line where the computations of deviations are made to read: y_meas = y_true + randn(len(x)) although this may not be the cause, and it was just a human error :-/ Thanks, -- Francesc Alted From falted at pytables.org Fri Oct 22 08:03:44 2004 From: falted at pytables.org (Francesc Alted) Date: Fri, 22 Oct 2004 14:03:44 +0200 Subject: [SciPy-user] optimize.leastsq() In-Reply-To: <2111.12.40.30.18.1098389576.squirrel@12.40.30.18> References: <200410212020.50725.falted@pytables.org> <2111.12.40.30.18.1098389576.squirrel@12.40.30.18> Message-ID: <200410221403.44674.falted@pytables.org> Hi James, A Dijous 21 Octubre 2004 22:12, James R. Phillips va escriure: > Here is a different simple scipy least squares fit: > > http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2004-January/002452.html Thanks for your suggestion. Here is another version of your code, just a bit more 'vectorized': ----------------------------------------------------------------------- from scipy import * xdata = array([5.357, 5.457, 5.797, 5.936, 6.161, 6.697, 6.731, 6.775, 8.442, 9.769, 9.861]) ydata = array([0.376, 0.489, 0.874, 1.049, 1.327, 2.054, 2.077, 2.138, 4.744, 7.068, 7.104]) transpose(array([[1]*11, xdata, xdata*xdata])) # y = 1 + x + x*x coeffs = linalg.basic.lstsq(matrix, ydata)[0] print "scipy.linalg.basic.lstsq curve fitting example" print "fitting data to quadratic equation y = a + bx + cx^2" ycalc = coeffs[0] + coeffs[1] * xdata + coeffs[2] * xdata * xdata error = ycalc - ydata print "yields: x data y data calc value error" for i in range(len(xdata)): print " % .3f % .3f % .3f % .3f" % (xdata[i], ydata[i], ycalc[i], error[i]) print ------------------------------------------------------------------------- Regards, -- Francesc Alted From falted at pytables.org Fri Oct 22 08:09:38 2004 From: falted at pytables.org (Francesc Alted) Date: Fri, 22 Oct 2004 14:09:38 +0200 Subject: [SciPy-user] optimize.leastsq() In-Reply-To: <2111.12.40.30.18.1098389576.squirrel@12.40.30.18> References: <200410212020.50725.falted@pytables.org> <2111.12.40.30.18.1098389576.squirrel@12.40.30.18> Message-ID: <200410221409.38532.falted@pytables.org> Ooops, a small glitch went in my 'vectorized' version. This has been tested: from scipy import * xdata = array([5.357, 5.457, 5.797, 5.936, 6.161, 6.697, 6.731, 6.775, 8.442, 9.769, 9.861]) ydata = array([0.376, 0.489, 0.874, 1.049, 1.327, 2.054, 2.077, 2.138, 4.744, 7.068, 7.104]) matrix=transpose(array([[1]*11, xdata, xdata*xdata])) # y = 1 + x + x*x coeffs = linalg.basic.lstsq(matrix, ydata)[0] print "scipy.linalg.basic.lstsq curve fitting example" print "fitting data to quadratic equation y = a + bx + cx^2" ycalc = coeffs[0] + coeffs[1] * xdata + coeffs[2] * xdata * xdata error = ycalc - ydata print "yields: x data y data calc value error" for i in range(len(xdata)): print " % .3f % .3f % .3f % .3f" % (xdata[i], ydata[i], ycalc[i], error[i]) print -- Francesc Alted From falted at pytables.org Fri Oct 22 08:19:19 2004 From: falted at pytables.org (Francesc Alted) Date: Fri, 22 Oct 2004 14:19:19 +0200 Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at> References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at> Message-ID: <200410221419.19362.falted@pytables.org> A Divendres 22 Octubre 2004 01:53, Gerald Richter va escriure: > shouldn't c_[...] result in something like > array([ [ . ], > [ . ] ]) > while r_ results in > array([ ... ]) > ? > > why does: > > In [23]: a = r_[1:3:5j] > > In [24]: b = c_[2:6:5j] > In SciPy tutorial (http://www.scipy.org/documentation/tutorial.pdf) Travis Oliphant says: """ The "r" stands for row concatenation because if the ob jects between commas are 2 dimensional arrays, they are stacked by rows (and thus must have commensurate columns). There is an equivalent command c that stacks 2d arrays by columns but works identically to r for 1d arrays. """ So, it seems that this is not a bug, but a feature. Although I would also find interesting that r_[1:3:5j] would generate: array([ 1. , 1.5, 2. , 2.5, 3. ]) and that c_[1:3:5j]) would do: array([[ 1. ], [ 1.5], [ 2. ], [ 2.5], [ 3. ]]) However, I don't know if this would be counter-intuitive in some cases. -- Francesc Alted From richter at hephy.oeaw.ac.at Fri Oct 22 09:14:14 2004 From: richter at hephy.oeaw.ac.at (Gerald Richter) Date: Fri, 22 Oct 2004 15:14:14 +0200 Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: <200410221419.19362.falted@pytables.org> References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at> <200410221419.19362.falted@pytables.org> Message-ID: <20041022131414.GA1877@uroboros.hephy.oeaw.ac.at> I understood, just after I sent my first email, that the dimensions of the array are different for the suggested behaviour, since: shape(r_[1:3:5j]) (5,) while for a corresponding row-vector ( 1 by N matrix) it had to be something like: array([ r_[1:3:5j] ]) [ [ 1. 1.5 2. 2.5 3. ]] with: shape(array([ r_[1:3:5j] ])) (1, 5) And the column vectors had to be of shape (5, 1) which is achieved by: transpose(array([c_[1:3:5j]])) or transpose(array([r_[1:3:5j]])) - I found this confusing... So the current behaviour of c_ and r_ IMHO looks like a re-write of vstack and hstack together with linspace functionality, which doesn't supply any distinct functionality, or clearer usability of matrix notations or operations. When I first read the introduction to scipy I was hoping for ease-of-use abbreviations for matrix operations, and at first understood the shortcuts r_ and c_ to help with that. OK. -I was wrong ;) btw.: is it an issue at all, to discuss something like this here? -This is implemented at quite a low level, and I'm not sure if there is a way to retain backwards-compatibility, AND provide another behaviour of c_ and r_. On Fri, Oct 22, 2004 at 02:19:19PM +0200, Francesc Alted wrote: > > In SciPy tutorial (http://www.scipy.org/documentation/tutorial.pdf) Travis > Oliphant says: > > """ > > The "r" stands for row concatenation because if the ob jects between commas > are 2 dimensional arrays, they are stacked by rows (and thus must have > commensurate columns). There is an equivalent command c that stacks 2d > arrays by columns but works identically to r for 1d arrays. > > """ > > So, it seems that this is not a bug, but a feature. Although I would also > find interesting that r_[1:3:5j] would generate: > > array([ 1. , 1.5, 2. , 2.5, 3. ]) > > and that c_[1:3:5j]) would do: > > array([[ 1. ], > [ 1.5], > [ 2. ], > [ 2.5], > [ 3. ]]) > > However, I don't know if this would be counter-intuitive in some cases. > > -- > Francesc Alted > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- Gerald Richter phone: +43 1 5447328/27 Institute of high energy physics (HEPHY) http://wwwhephy.oeaw.ac.at/ Vienna/Austria From richter at hephy.oeaw.ac.at Fri Oct 22 09:47:32 2004 From: richter at hephy.oeaw.ac.at (Gerald Richter) Date: Fri, 22 Oct 2004 15:47:32 +0200 Subject: [SciPy-user] debian package versions... Message-ID: <20041022134732.GA1924@uroboros.hephy.oeaw.ac.at> just installed the new debian packages: # dpkg -s python-scipy Package: python-scipy Status: install ok installed Priority: extra Section: python Installed-Size: 44 Maintainer: Jos\uffff\uffff Fonseca Architecture: all Version: 0.3.2-1 ... # dpkg -s python-scipy-core Package: python-scipy-core Status: install ok installed Priority: extra Section: python Installed-Size: 40 Maintainer: Jos\uffff\uffff Fonseca Architecture: all Version: 0.3.2-1 ... BUT: $ ipython -p scipy In [1]: scipy.__version__ Out[1]: '0.3.0_266.4239' is this just about forgetting to set the right __version__, or is this a bug in the package composition? -- Gerald Richter phone: +43 1 5447328/27 Institute of high energy physics (HEPHY) http://wwwhephy.oeaw.ac.at/ Vienna/Austria From arnd.baecker at web.de Fri Oct 22 10:29:00 2004 From: arnd.baecker at web.de (Arnd Baecker) Date: Fri, 22 Oct 2004 16:29:00 +0200 (CEST) Subject: [SciPy-user] debian package versions... In-Reply-To: <20041022134732.GA1924@uroboros.hephy.oeaw.ac.at> References: <20041022134732.GA1924@uroboros.hephy.oeaw.ac.at> Message-ID: Hi, On Fri, 22 Oct 2004, Gerald Richter wrote: > just installed the new debian packages: [...] > # dpkg -s python-scipy > Package: python-scipy > > # dpkg -s python-scipy-core > Package: python-scipy-core [...] > BUT: > > $ ipython -p scipy > > In [1]: scipy.__version__ > Out[1]: '0.3.0_266.4239' > > is this just about forgetting to set the right __version__, or is this a > bug in the package composition? Interesting - I installed (From deb http://deb-scipy.alioth.debian.org/apt/ ./ ) > dpkg -s python2.3-scipy Package: python2.3-scipy > dpkg -s python2.3-scipy-core Package: python2.3-scipy-core and In [1]: import scipy In [2]: scipy.__version__ Out[2]: '0.3.2' So this looks fine ... Is there any difference between python2.3-scipy and python-scipy? Arnd From richter at hephy.oeaw.ac.at Fri Oct 22 10:52:53 2004 From: richter at hephy.oeaw.ac.at (Gerald Richter) Date: Fri, 22 Oct 2004 16:52:53 +0200 Subject: [SciPy-user] debian package versions... In-Reply-To: References: <20041022134732.GA1924@uroboros.hephy.oeaw.ac.at> Message-ID: <20041022145253.GA1972@uroboros.hephy.oeaw.ac.at> problem resolved. the meta packages python-scipy python-scipy-core are not on http://deb-scipy.alioth.debian.org/apt/ so when I upgraded them, the corresponding packages were taken from ftp.debian.at. They are not up2date there. Thanks for help! On Fri, Oct 22, 2004 at 04:29:00PM +0200, Arnd Baecker wrote: > Hi, > > Interesting - I installed > (From deb http://deb-scipy.alioth.debian.org/apt/ ./ > ) > > > dpkg -s python2.3-scipy > Package: python2.3-scipy > > > dpkg -s python2.3-scipy-core > Package: python2.3-scipy-core > > and > In [1]: import scipy > In [2]: scipy.__version__ > Out[2]: '0.3.2' > > So this looks fine ... > Is there any difference between python2.3-scipy and python-scipy? > > Arnd > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- Gerald Richter phone: +43 1 5447328/27 Institute of high energy physics (HEPHY) http://wwwhephy.oeaw.ac.at/ Vienna/Austria From aisaac at american.edu Fri Oct 22 10:07:59 2004 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 22 Oct 2004 10:07:59 -0400 (Eastern Daylight Time) Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: <20041022131414.GA1877@uroboros.hephy.oeaw.ac.at> References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at><200410221419.19362.falted@pytables.org><20041022131414.GA1877@uroboros.hephy.oeaw.ac.at> Message-ID: On Fri, 22 Oct 2004, Gerald Richter apparently wrote: > So the current behaviour of c_ and r_ IMHO looks like a re-write of > vstack and hstack together with linspace functionality, which doesn't > supply any distinct functionality, or clearer usability of matrix notations > or operations. When I first read the introduction to scipy I was hoping for > ease-of-use abbreviations for matrix operations, and at first understood > the shortcuts r_ and c_ to help with that. Perhaps you are looking for 'bmat', which unfortunately is not covered in the tutorial. hth, Alan Isaac From aisaac at american.edu Fri Oct 22 10:18:06 2004 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 22 Oct 2004 10:18:06 -0400 (Eastern Daylight Time) Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: <200410221419.19362.falted@pytables.org> References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at><200410221419.19362.falted@pytables.org> Message-ID: On Fri, 22 Oct 2004, Francesc Alted apparently wrote: > So, it seems that this is not a bug, but a feature. Although I would also > find interesting that r_[1:3:5j] would generate: > array([ 1. , 1.5, 2. , 2.5, 3. ]) > and that c_[1:3:5j]) would do: > array([[ 1. ], > [ 1.5], > [ 2. ], > [ 2.5], > [ 3. ]]) > However, I don't know if this would be counter-intuitive in some cases. I think that would be backwards of what is expected, since r_[] is supposed to create a stack of rows. But perhaps the following from http://www.american.edu/econ/pytrix/pyGAUSS.py gives you what you want. (Requires access to arange and transpose from Scipy, Numeric, or numarray.) Cheers, Alan Isaac #seqa: n element additive sequence from start by inc def seqa(start,inc,n): return transpose([start+inc*arange(n)]) From oliphant at ee.byu.edu Fri Oct 22 16:07:53 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Fri, 22 Oct 2004 14:07:53 -0600 Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: <41785352.7090508@ucsd.edu> References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at> <41785352.7090508@ucsd.edu> Message-ID: <41796899.9000708@ee.byu.edu> Robert Kern wrote: > Gerald Richter wrote: > >> Hi everybody. >> >> Sorry for such a basic question, or maybe two: >> >> shouldn't c_[...] result in something like >> array([ [ . ], >> [ . ] ]) >> while r_ results in array([ ... ]) >> ? > > > Probably. Travis will probably have to step in here and explain what > they are supposed to do in this case. > >> why does: >> >> In [23]: a = r_[1:3:5j] >> >> In [24]: b = c_[2:6:5j] >> >> In [25]: b >> Out[25]: array([ 2., 3., 4., 5., 6.]) >> >> In [26]: a >> Out[26]: array([ 1. , 1.5, 2. , 2.5, 3. ]) >> >> In [27]: transpose a >> -------> transpose(a) >> Out[27]: array([ 1. , 1.5, 2. , 2.5, 3. ]) >> >> In [28]: transpose b >> -------> transpose(b) >> Out[28]: array([ 2., 3., 4., 5., 6.]) >> >> not allow transposition in the above mentioned way? > > SciPy is early enough in it's development that the behavior of r_ and c_ could be changed without extensive grief at this point, if it was important to change them. The idea of r_ was to allow fast creation of arrays similar to what is available with MATLAB. I wanted a short, quick way to concatenate and generate arrays. For 1-d arrays, r_ and c_ are supposed to be exactly the same. It's only when you give them two dimensional arrays that they differ. Admittedly, I really like the one-dimensional array creation ability of r_ and I use it quite often. The two-dimensional array creation is not as good. bmat is intended to improve that some. I am open to any ideas about how to improve this. Perhaps, we just kill c_ and suggest something else (like an improved bmat) for building 2-d arrays quickly. But, your transpose question is resolved by recognizing that there is a difference between a rank-1 array and a rank-2 matrix (which can be a column or row). Perhaps we should have a mechanism (perhaps a row_[...]) that generates a rank-2 row vector very quickly. Ideas are welcome, -Travis From oliphant at ee.byu.edu Fri Oct 22 16:20:02 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Fri, 22 Oct 2004 14:20:02 -0600 Subject: [SciPy-user] Problems with complex matrices In-Reply-To: <4178CEFF.2050608@mecha.uni-stuttgart.de> References: <4178CEFF.2050608@mecha.uni-stuttgart.de> Message-ID: <41796B72.6080704@ee.byu.edu> Nils Wagner wrote: > Hi all, > > Another bug is revealed > > Traceback (most recent call last): > File "complex_it.py", line 6, in ? > res=dot(A,x)-r > File "/usr/lib/python2.3/site-packages/Numeric/dotblas/__init__.py", > line 55, in dot > if multiarray.array(a).shape == () or multiarray.array(b).shape == (): > TypeError: a float is required > > Nils > >------------------------------------------------------------------------ > >from scipy import * >from RandomArray import * >A = rand(10,10)+1j*rand(10,10) >r = rand(10)+1j*rand(10) >x = linalg.gmres(A,r) > > should be x, info = linalg.gmres(A,r) >res=dot(A,x)-r > > >------------------------------------------------------------------------ > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > From zunzun at zunzun.com Fri Oct 22 16:52:52 2004 From: zunzun at zunzun.com (James R. Phillips) Date: Fri, 22 Oct 2004 16:52:52 -0400 (EDT) Subject: [SciPy-user] optimize.leastsq() In-Reply-To: <200410221403.44674.falted@pytables.org> References: <200410212020.50725.falted@pytables.org> <2111.12.40.30.18.1098389576.squirrel@12.40.30.18> <200410221403.44674.falted@pytables.org> Message-ID: <4221.65.88.95.55.1098478372.squirrel@65.88.95.55> > Thanks for your suggestion. Here is another version > of your code, just a bit more 'vectorized': > > transpose(array([[1]*11, xdata, xdata*xdata])) # y = 1 + x + x*x The comment at the end of this line is not quite correct, I think. Look at the one in the original example again and see what you make of the difference. James Phillips http://zunzun.com From aisaac at american.edu Fri Oct 22 17:33:34 2004 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 22 Oct 2004 17:33:34 -0400 (Eastern Daylight Time) Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: <41796899.9000708@ee.byu.edu> References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at><41785352.7090508@ucsd.edu><41796899.9000708@ee.byu.edu> Message-ID: On Fri, 22 Oct 2004, Travis Oliphant apparently wrote: > The idea of r_ was to allow fast creation of arrays similar to what is > available with MATLAB. I wanted a short, quick way to concatenate and > generate arrays. For 1-d arrays, r_ and c_ are supposed to be exactly > the same. It's only when you give them two dimensional arrays that they > differ. Admittedly, I really like the one-dimensional array creation > ability of r_ and I use it quite often. The two-dimensional array > creation is not as good. bmat is intended to improve that some. I am > open to any ideas about how to improve this. Perhaps, we just kill c_ > and suggest something else (like an improved bmat) for building 2-d > arrays quickly. I find both r_ and c_ nice to have around. I would request a single change: that for 1-d arrays, one of them return transpose([x]) instead of x. (In my view, r_ should do this, but whatever.) fwiw, Alan From swisher at enthought.com Fri Oct 22 18:26:16 2004 From: swisher at enthought.com (Janet Swisher) Date: Fri, 22 Oct 2004 17:26:16 -0500 Subject: [SciPy-user] Versions question from kasparov Message-ID: <006e01c4b886$252ea980$ab01a8c0@SWISHER> I just noticed that "kasparov" added a comment a few days ago to the Troubleshooting wiki on scipy.org, with the following question: "Is it possible to run scipy 0.3.2 with python 2.3 and numeric 23.5. I have this two versions and i don't arrive to run correctly a program that use interpolate.linear_1d" I don't think anybody's monitoring that wiki closely, so it's probably not the best place for tech support questions. ------------------------- Janet Swisher Senior Technical Writer Enthought, Inc. 1-512-536-1057 From oliphant at ee.byu.edu Fri Oct 22 18:42:01 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Fri, 22 Oct 2004 16:42:01 -0600 Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at><41785352.7090508@ucsd.edu><41796899.9000708@ee.byu.edu> Message-ID: <41798CB9.7040001@ee.byu.edu> Alan G Isaac wrote: >On Fri, 22 Oct 2004, Travis Oliphant apparently wrote: > > >>The idea of r_ was to allow fast creation of arrays similar to what is >>available with MATLAB. I wanted a short, quick way to concatenate and >>generate arrays. For 1-d arrays, r_ and c_ are supposed to be exactly >>the same. It's only when you give them two dimensional arrays that they >>differ. Admittedly, I really like the one-dimensional array creation >>ability of r_ and I use it quite often. The two-dimensional array >>creation is not as good. bmat is intended to improve that some. I am >>open to any ideas about how to improve this. Perhaps, we just kill c_ >>and suggest something else (like an improved bmat) for building 2-d >>arrays quickly. >> >> > >I find both r_ and c_ nice to have around. >I would request a single change: >that for 1-d arrays, >one of them return transpose([x]) instead of x. >(In my view, r_ should do this, but whatever.) > > > This would be decidedly different behavior, because 1-d arrays are not 2-d arrays. I would be inclined to introduce another command to rapidly build 2-d row an/or column vectors as you describe instead of changing the 1-d array-creation facility of r_ -Travis From richter at hephy.oeaw.ac.at Mon Oct 25 10:02:44 2004 From: richter at hephy.oeaw.ac.at (Gerald Richter) Date: Mon, 25 Oct 2004 16:02:44 +0200 Subject: [SciPy-user] the meaning of c_ and r_ In-Reply-To: <41796899.9000708@ee.byu.edu> References: <20041021235347.GA564@uroboros.hephy.oeaw.ac.at> <41785352.7090508@ucsd.edu> <41796899.9000708@ee.byu.edu> Message-ID: <20041025140244.GA6377@uroboros.hephy.oeaw.ac.at> I find the idea to introduce something like row_ and col_ very convenient. Given that it does: row_[1:4:4j] = array[ [ 1, 2, 3, 4 ] ] col_[1:4:4j] = array[ [ 1 ], [ 2 ], [ 3 ], [ 4 ] ] also, it seems reasonable, to provide something that does convert any 1-d object to the desired columns or row-shape a = ( 1,2,3) row(a) = array[ [ 1, 2, 3 ] ] ... similar for col() +++ I played arround a little with the functionality of c_ and r_ to understand it better... maybe these are examples to add to the documentation, so that it becomes more clear what these functions do? a = array([c_[1:4:4j]]) [ [ 1. 2. 3. 4.]] at = transpose(a) [[ 1.] [ 2.] [ 3.] [ 4.]] b = array([c_[5:8:4j]]) [ [ 5. 6. 7. 8.]] bt = transpose(b) [[ 5.] [ 6.] [ 7.] [ 8.]] c_[a,b] [ [ 1. 2. 3. 4. 5. 6. 7. 8.]] c_[at,bt] [[ 1. 5.] [ 2. 6.] [ 3. 7.] [ 4. 8.]] r_[a,b] [[ 1. 2. 3. 4.] [ 5. 6. 7. 8.]] r_[at,bt] [[ 1.] [ 2.] [ 3.] [ 4.] [ 5.] [ 6.] [ 7.] [ 8.]] greetings, Gerald On Fri, Oct 22, 2004 at 02:07:53PM -0600, Travis Oliphant wrote: > SciPy is early enough in it's development that the behavior of r_ and c_ > could be changed without extensive grief at this point, if it was > important to change them. > > The idea of r_ was to allow fast creation of arrays similar to what is > available with MATLAB. I wanted a short, quick way to concatenate and > generate arrays. For 1-d arrays, r_ and c_ are supposed to be exactly > the same. It's only when you give them two dimensional arrays that they > differ. Admittedly, I really like the one-dimensional array creation > ability of r_ and I use it quite often. The two-dimensional array > creation is not as good. bmat is intended to improve that some. I am > open to any ideas about how to improve this. Perhaps, we just kill c_ > and suggest something else (like an improved bmat) for building 2-d > arrays quickly. > > But, your transpose question is resolved by recognizing that there is a > difference between a rank-1 array and a rank-2 matrix (which can be a > column or row). Perhaps we should have a mechanism (perhaps a > row_[...]) that generates a rank-2 row vector very quickly. > > Ideas are welcome, > > -Travis > > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From david at dwavesys.com Tue Oct 26 15:47:59 2004 From: david at dwavesys.com (David Grant) Date: Tue, 26 Oct 2004 12:47:59 -0700 Subject: [SciPy-user] Sparse class not working Message-ID: <417EA9EF.2010304@dwavesys.com> Has anyone been able to get scipy.sparse to work? Just running the Sparse.py file I get the following: Representation of a matrix: Traceback (most recent call last): File "E:\My Documents\working_dir\python\mm\testSparse.py", line 26, in ? print repr(a) File "D:\Python23\Lib\site-packages\scipy\sparse\Sparse.py", line 126, in __repr__ return "<%dx%d sparse matrix of type '%s' with %d stored "\ AttributeError: spmatrix instance has no attribute 'shape' I get the same problem if I run my own test code, which looks something like this: from scipy_base import * from scipy_base.fastumath import * import types, sys from scipy.sparse import sparsetools, _superlu from scipy.sparse.Sparse import * from Numeric import * a = spmatrix(arange(1,9),[0,1,1,2,2,3,3,4],[0,1,3,0,2,3,4,4]) print "Representation of a matrix:" print repr(a) print "How a matrix prints." print a print "Adding two matrices." b = a+a print b print "Subtracting two matrices." c = b - a print c print "Multiplying a sparse matrix by a dense vector." d = a*[1,2,3,4,5] print d print [1,2,3,4,5]*a If I comment out the repr(a) line which is causing the problem, b=a+a fails as well, because it says "AttributeError: spmatrix instance has no attribute 'tocsc'" What is going on here? -- David J. Grant -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From david at dwavesys.com Tue Oct 26 16:39:48 2004 From: david at dwavesys.com (David Grant) Date: Tue, 26 Oct 2004 13:39:48 -0700 Subject: [SciPy-user] sparse matrix formats Message-ID: <417EB614.3070004@dwavesys.com> I am a bit boggled by all these sparse matrix types in the sparse class. Can anyone recommend which are the standard one I should use (when in doubt)? I know that one of my matrices is a diagonal matrix and the other matrix is 100% dense, however, it is tensor-producted with the identity matrix, so it becomes less dense. Some elements will be close to zero and can be truncated as well. Most values will be around the diagonals close to the main diagonal. _formats = {'csc':[0,"Compressed Sparse Column"], 'csr':[1,"Compressed Sparse Row"], 'dok':[2,"Dictionary Of Keys"], 'lil':[3,"LInked List"], 'dod':[4,"Dictionary of Dictionaries"], 'sss':[5,"Symmetric Sparse Skyline"], 'coo':[6,"COOrdinate"], 'lba':[7,"Linpack BAnded"], 'egd':[8,"Ellpack-itpack Generalized Diagonal"], 'dia':[9,"DIAgonal"], 'bsr':[10,"Block Sparse Row"], 'msr':[11,"Modified compressed Sparse Row"], 'bsc':[12,"Block Sparse Column"], 'msc':[13,"Modified compressed Sparse Column"], 'ssk':[14,"Symmetric SKyline"], 'nsk':[15,"Nonsymmetric SKyline"], 'jad':[16,"JAgged Diagonal"], 'uss':[17,"Unsymmetric Sparse Skyline"], 'vbr':[18,"Variable Block Row"], 'und':[19,"Undefined"] } -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From oliphant at ee.byu.edu Tue Oct 26 18:20:40 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 26 Oct 2004 16:20:40 -0600 Subject: [SciPy-user] Sparse class not working In-Reply-To: <417EA9EF.2010304@dwavesys.com> References: <417EA9EF.2010304@dwavesys.com> Message-ID: <417ECDB8.1000206@ee.byu.edu> David Grant wrote: > Has anyone been able to get scipy.sparse to work? Just running the > Sparse.py file I get the following: > Yes, rest assured that Sparse matrices work. However, the code at the bottom of the file does not work. It is based on an older idea for sparse matrices. You can look in the test directory under test_Sparse.py for tests that actually run and should pass. I need to update this code down at the bottom of Sparse.py so for now you should ignore it. -Travis From david at dwavesys.com Tue Oct 26 18:26:33 2004 From: david at dwavesys.com (David Grant) Date: Tue, 26 Oct 2004 15:26:33 -0700 Subject: [SciPy-user] Sparse class not working In-Reply-To: <417ECDB8.1000206@ee.byu.edu> References: <417EA9EF.2010304@dwavesys.com> <417ECDB8.1000206@ee.byu.edu> Message-ID: <417ECF19.8000307@dwavesys.com> Travis Oliphant wrote: > David Grant wrote: > >> Has anyone been able to get scipy.sparse to work? Just running the >> Sparse.py file I get the following: >> > Yes, rest assured that Sparse matrices work. > However, the code at the bottom of the file does not work. It is > based on an older idea for sparse matrices. > > You can look in the test directory under test_Sparse.py for tests that > actually run and should pass. > > I need to update this code down at the bottom of Sparse.py so for now > you should ignore it. > > Thanks, you're right that code at the bottom of Sparse.py is old, the test_Sparse.py stuff was more correct. I've written my own equivalent to what was at the bottom of Sparse.py. -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From oliphant at ee.byu.edu Tue Oct 26 18:25:53 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 26 Oct 2004 16:25:53 -0600 Subject: [SciPy-user] sparse matrix formats In-Reply-To: <417EB614.3070004@dwavesys.com> References: <417EB614.3070004@dwavesys.com> Message-ID: <417ECEF1.8030007@ee.byu.edu> David Grant wrote: > I am a bit boggled by all these sparse matrix types in the sparse class. > > Can anyone recommend which are the standard one I should use (when in > doubt)? spmatrix is just the base class and is not functional by itself: The formats at the top are currently best supported. csc_matrix --- used internally by lot's of routines, best for numerics but can be slow to construct using Python indexing csr_matrix --- nearly as fast as csc_matrix and useful for fast transpose operations. dok_matrix --- fast construction in Python (just a simple dictionary), but must be converted to csc_matrix for fast matrix multiplication, etc. I hope this helps, The documentation is lacking for Sparse, but the code should be fairly readable. Just ignore all but csc_matrix, csr_matrix, and dok_matrix for now. There are some bugs in dok_matrix and in mixed csc csr matrix multiplication in SciPy 0.3.2 that have been fixed in CVS. -Travis From david at dwavesys.com Tue Oct 26 18:28:41 2004 From: david at dwavesys.com (David Grant) Date: Tue, 26 Oct 2004 15:28:41 -0700 Subject: [SciPy-user] Sparse class not working In-Reply-To: <417ECDB8.1000206@ee.byu.edu> References: <417EA9EF.2010304@dwavesys.com> <417ECDB8.1000206@ee.byu.edu> Message-ID: <417ECF99.1080800@dwavesys.com> Travis Oliphant wrote: > David Grant wrote: > >> Has anyone been able to get scipy.sparse to work? Just running the >> Sparse.py file I get the following: >> > Yes, rest assured that Sparse matrices work. > However, the code at the bottom of the file does not work. It is > based on an older idea for sparse matrices. > > You can look in the test directory under test_Sparse.py for tests that > actually run and should pass. > > I need to update this code down at the bottom of Sparse.py so for now > you should ignore it. > Travis, How hard would it be for me to get CVS access to scipy? This is something I could have easily fixed. Or I could help add some documentation here and there. It's a lot easier than making patches and emailing them... makes it easier to contribute, even if contributions are small. I'm not sure what your developer structure is, and how open it is. -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From david at dwavesys.com Tue Oct 26 18:29:54 2004 From: david at dwavesys.com (David Grant) Date: Tue, 26 Oct 2004 15:29:54 -0700 Subject: [SciPy-user] sparse matrix formats In-Reply-To: <417ECEF1.8030007@ee.byu.edu> References: <417EB614.3070004@dwavesys.com> <417ECEF1.8030007@ee.byu.edu> Message-ID: <417ECFE2.5010306@dwavesys.com> Travis Oliphant wrote: > David Grant wrote: > >> I am a bit boggled by all these sparse matrix types in the sparse class. >> >> Can anyone recommend which are the standard one I should use (when in >> doubt)? > > > spmatrix is just the base class and is not functional by itself: > > The formats at the top are currently best supported. > csc_matrix --- used internally by lot's of routines, best for > numerics but can be slow to construct using Python indexing > csr_matrix --- nearly as fast as csc_matrix and useful for fast > transpose operations. > dok_matrix --- fast construction in Python (just a simple dictionary), > but must be converted to csc_matrix for fast matrix multiplication, etc. Thanks a lot! > > I hope this helps, > > The documentation is lacking for Sparse, but the code should be fairly > readable. Just ignore all but csc_matrix, csr_matrix, and dok_matrix > for now. Yeah, it looks like those are the only three with complete-ish code written. > > There are some bugs in dok_matrix and in mixed csc csr matrix > multiplication in SciPy 0.3.2 that have been fixed in CVS. > > -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From oliphant at ee.byu.edu Tue Oct 26 18:33:02 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Tue, 26 Oct 2004 16:33:02 -0600 Subject: [SciPy-user] Sparse class not working In-Reply-To: <417ECF99.1080800@dwavesys.com> References: <417EA9EF.2010304@dwavesys.com> <417ECDB8.1000206@ee.byu.edu> <417ECF99.1080800@dwavesys.com> Message-ID: <417ED09E.60807@ee.byu.edu> David Grant wrote: > Travis Oliphant wrote: > >> David Grant wrote: >> >>> Has anyone been able to get scipy.sparse to work? Just running the >>> Sparse.py file I get the following: >>> >> Yes, rest assured that Sparse matrices work. >> However, the code at the bottom of the file does not work. It is >> based on an older idea for sparse matrices. >> >> You can look in the test directory under test_Sparse.py for tests >> that actually run and should pass. >> >> I need to update this code down at the bottom of Sparse.py so for >> now you should ignore it. >> > Travis, > > How hard would it be for me to get CVS access to scipy? This is > something I could have easily fixed. Or I could help add some > documentation here and there. It's a lot easier than making patches > and emailing them... makes it easier to contribute, even if > contributions are small. > > I'm not sure what your developer structure is, and how open it is. > It's pretty open. Basically, CVS read access is open to everybody. We are working on a system for easy documentation contribution that should be available soon. There are quite a few people who get write access to CVS and it is not difficult to become one of them. Basically showing interest is a big step. One requirement is subscribing to the scipy-dev at scipy.net mailing list. I would do that and formally request access on that list. -Travis From david at dwavesys.com Tue Oct 26 19:14:33 2004 From: david at dwavesys.com (David Grant) Date: Tue, 26 Oct 2004 16:14:33 -0700 Subject: [SciPy-user] eigenvalues of sparse matrix Message-ID: <417EDA59.8090308@dwavesys.com> Sorry, another sparse question: Is there anything is scipy which can find the eigenvalues and eigenvectors of a sparse matrix? -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From nwagner at mecha.uni-stuttgart.de Wed Oct 27 02:29:48 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 27 Oct 2004 08:29:48 +0200 Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: <417EDA59.8090308@dwavesys.com> References: <417EDA59.8090308@dwavesys.com> Message-ID: <417F405C.20509@mecha.uni-stuttgart.de> David Grant wrote: > Sorry, another sparse question: Is there anything is scipy which can > find the eigenvalues and eigenvectors of a sparse matrix? > Unfortunately not yet. I have added an entry in the Wiki page (Support for ARPACK in scipy) http://www.scipy.org/wikis/featurerequests/PrioritiesAndWishlist There are some external tools http://jrfonseca.dyndns.org/work/phd/ http://sourceforge.net/projects/pysparse/ http://people.web.psi.ch/geus/pyfemax/ Nils >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > From nwagner at mecha.uni-stuttgart.de Wed Oct 27 02:54:42 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 27 Oct 2004 08:54:42 +0200 Subject: [SciPy-user] More problems with Sparse Message-ID: <417F4632.3000104@mecha.uni-stuttgart.de> Hi Travis, A few days ago I have reported on the following bug in sparse. (recent Bug tracker entries) It would be nice if this problem could be fixed. Thanks in advance. Nils >>> from scipy import * >>> A = sparse.dok_matrix() >>> A[0,0] = 1j >>> A.todense() Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 1326, in todense new[ikey0,ikey1] = self[key] TypeError: can't convert complex to float; use abs(z) From rkern at ucsd.edu Wed Oct 27 03:16:12 2004 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 27 Oct 2004 00:16:12 -0700 Subject: [SciPy-user] More problems with Sparse In-Reply-To: <417F4632.3000104@mecha.uni-stuttgart.de> References: <417F4632.3000104@mecha.uni-stuttgart.de> Message-ID: <417F4B3C.6060706@ucsd.edu> Nils Wagner wrote: > Hi Travis, > > A few days ago I have reported on the following bug in sparse. (recent > Bug tracker entries) > It would be nice if this problem could be fixed. > Thanks in advance. > > Nils > >>>> from scipy import * >>>> A = sparse.dok_matrix() >>>> A[0,0] = 1j >>>> A.todense() > > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line > 1326, in todense > new[ikey0,ikey1] = self[key] > TypeError: can't convert complex to float; use abs(z) It's difficult to determine beforehand if a matrix needs to be complex or not. The default typecode for the dense array is 'd' (double precision real). Use the typecode keyword argument to todense() to choose something else. E.g. A.todense(Complex) I found this out in 30 seconds by looking at the source code. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From nwagner at mecha.uni-stuttgart.de Wed Oct 27 03:30:12 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 27 Oct 2004 09:30:12 +0200 Subject: [SciPy-user] More problems with Sparse In-Reply-To: <417F4B3C.6060706@ucsd.edu> References: <417F4632.3000104@mecha.uni-stuttgart.de> <417F4B3C.6060706@ucsd.edu> Message-ID: <417F4E84.3010104@mecha.uni-stuttgart.de> Robert Kern wrote: > Nils Wagner wrote: > >> Hi Travis, >> >> A few days ago I have reported on the following bug in sparse. >> (recent Bug tracker entries) >> It would be nice if this problem could be fixed. >> Thanks in advance. >> >> Nils >> >>>>> from scipy import * >>>>> A = sparse.dok_matrix() >>>>> A[0,0] = 1j >>>>> A.todense() >>>> >> >> Traceback (most recent call last): >> File "", line 1, in ? >> File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line >> 1326, in todense >> new[ikey0,ikey1] = self[key] >> TypeError: can't convert complex to float; use abs(z) > > > It's difficult to determine beforehand if a matrix needs to be complex > or not. The default typecode for the dense array is 'd' (double > precision real). Use the typecode keyword argument to todense() to > choose something else. > > E.g. > > A.todense(Complex) > > I found this out in 30 seconds by looking at the source code. > Thank you. A tutorial illustrating all these features would be very valuable. Again, I have some trouble with complex matrices and iterative solvers. File "sparse_it.py", line 38, in ? sol0,info0 = linalg.gmres(A,r) File "/usr/lib/python2.3/site-packages/scipy/linalg/iterative.py", line 499, in gmres work[slice2] += sclr1*matvec(work[slice1]) TypeError: return array has incorrect type How can I resolve this problem ? Nils -------------- next part -------------- A non-text attachment was scrubbed... Name: sparse_it.py Type: text/x-python Size: 1303 bytes Desc: not available URL: From nwagner at mecha.uni-stuttgart.de Wed Oct 27 05:40:21 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Wed, 27 Oct 2004 11:40:21 +0200 Subject: [SciPy-user] Mixing different type-codes in iterative solvers Message-ID: <417F6D05.2080407@mecha.uni-stuttgart.de> Hi all, It seems to be invalid to use different type-codes (e.g. complex coefficient matrix and double -precision real right-hand-side) within iterative solvers. However this is no problem in case of direct solvers. Any pointer would be appreciated. Nils From david at dwavesys.com Wed Oct 27 20:41:41 2004 From: david at dwavesys.com (David Grant) Date: Wed, 27 Oct 2004 17:41:41 -0700 Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: <417F405C.20509@mecha.uni-stuttgart.de> References: <417EDA59.8090308@dwavesys.com> <417F405C.20509@mecha.uni-stuttgart.de> Message-ID: <41804045.4060007@dwavesys.com> Nils Wagner wrote: > David Grant wrote: > >> Sorry, another sparse question: Is there anything is scipy which can >> find the eigenvalues and eigenvectors of a sparse matrix? >> > Unfortunately not yet. I have added an entry in the Wiki page > (Support for ARPACK in scipy) > > http://www.scipy.org/wikis/featurerequests/PrioritiesAndWishlist > > There are some external tools > > http://jrfonseca.dyndns.org/work/phd/ > http://sourceforge.net/projects/pysparse/ > http://people.web.psi.ch/geus/pyfemax/ I just looked at pysparse again. It looks like complex numbers cannot be stored. Am I correct? David From myzheng at iris3.simm.ac.cn Wed Oct 27 22:14:16 2004 From: myzheng at iris3.simm.ac.cn (Mingyue Zheng) Date: Thu, 28 Oct 2004 10:14:16 +0800 Subject: [SciPy-user] (no subject) Message-ID: <002401c4bc93$e59d1d30$4c137fca@data4> Hi All! I am trying to install scipy on a SGI workstation running IRIX 6.5, python-2.3.4 and gcc 3.2. On linking xplt lib, it reported the following errors: ld32: FATAL 12 : Expecting n32 objects: /usr/lib/libX11.so is o32. ld32: FATAL 12 : Expecting n32 objects: /usr/lib/libX11.so is o32. Does anyone know how to fix it? =================================================== Mingyue Zheng Drug Discovery and Design Center,SIMM Chinese Academy of Sciences #555 Rd.Zuchongzhi,Zhangjiang Hi-Tech. Park Shanghai 201203, China Tel: +86-21-50806600-1201(ext) E-mail: myzheng at mail.shcnc.ac.cn;? myzheng at iris3.simm.ac.cn; =================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.grant at telus.net Thu Oct 28 12:03:45 2004 From: david.grant at telus.net (David Grant) Date: Thu, 28 Oct 2004 09:03:45 -0700 Subject: [SciPy-user] g2c-pic Message-ID: <41811861.50602@telus.net> Does anyone know where the g2c-pic library is from? I'm trying to build the arpack python extension but it needs g2c-pic. I have g2c on my computer but not g2c-pic. It builds fine with just g2c but I'm not sure what the difference is between the two. Thanks, David -- David J. Grant http://www.davidgrant.ca:81 -------------- next part -------------- A non-text attachment was scrubbed... Name: david.grant.vcf Type: text/x-vcard Size: 200 bytes Desc: not available URL: From david.grant at telus.net Thu Oct 28 12:06:18 2004 From: david.grant at telus.net (David Grant) Date: Thu, 28 Oct 2004 09:06:18 -0700 Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: <417F405C.20509@mecha.uni-stuttgart.de> References: <417EDA59.8090308@dwavesys.com> <417F405C.20509@mecha.uni-stuttgart.de> Message-ID: <418118FA.2010403@telus.net> Nils Wagner wrote: > David Grant wrote: > >> Sorry, another sparse question: Is there anything is scipy which can >> find the eigenvalues and eigenvectors of a sparse matrix? >> > Unfortunately not yet. I have added an entry in the Wiki page > (Support for ARPACK in scipy) > > http://www.scipy.org/wikis/featurerequests/PrioritiesAndWishlist > > There are some external tools > > http://jrfonseca.dyndns.org/work/phd/ Does anyone know how much work it would be to get ARPACK support in scipy? Even just minimal support. This is totally new ground for me, so I'd like to know if I'm biting off more than I can chew. -- David J. Grant http://www.davidgrant.ca:81 -------------- next part -------------- A non-text attachment was scrubbed... Name: david.grant.vcf Type: text/x-vcard Size: 200 bytes Desc: not available URL: From oliphant at ee.byu.edu Thu Oct 28 12:25:38 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 28 Oct 2004 10:25:38 -0600 Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: <418118FA.2010403@telus.net> References: <417EDA59.8090308@dwavesys.com> <417F405C.20509@mecha.uni-stuttgart.de> <418118FA.2010403@telus.net> Message-ID: <41811D82.3040907@ee.byu.edu> > > Does anyone know how much work it would be to get ARPACK support in > scipy? Even just minimal support. This is totally new ground for me, > so I'd like to know if I'm biting off more than I can chew. Not a lot for simple support if you use f2py. My suggestion would be to write and f2py interface for the desired routines and we can build up from there. -Travis From oliphant at ee.byu.edu Thu Oct 28 12:53:24 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 28 Oct 2004 10:53:24 -0600 Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: <418118FA.2010403@telus.net> References: <417EDA59.8090308@dwavesys.com> <417F405C.20509@mecha.uni-stuttgart.de> <418118FA.2010403@telus.net> Message-ID: <41812404.5040008@ee.byu.edu> > Does anyone know how much work it would be to get ARPACK support in > scipy? Even just minimal support. This is totally new ground for me, > so I'd like to know if I'm biting off more than I can chew. After looking over ARPACK, it looks to me that you could get a functional ARPACK interface in 1-2 days, using f2py. Then, you could look at the linalg/iterative methods that interface with reverse-communication fortran code to get an idea how you might write simpler Python wrappers to the raw wrappers produced by f2py. I don't think this would be hard at all. It would be a good way for you to learn f2py, if you are not already familiar with it. Also, you might notice how iterative and sparse f2py interfaces use a (very simple) templating mechanism (in scipy_distutils/from_template.py) so that interfaces for all four precisions are maintained with a single code-base. But, if you produce an interface for the precision you care about, I could handle converting it to a general-purpose interface for all precisions. Is the ARPACK code distributible in Python? -Travis From pearu at scipy.org Thu Oct 28 13:17:32 2004 From: pearu at scipy.org (Pearu Peterson) Date: Thu, 28 Oct 2004 12:17:32 -0500 (CDT) Subject: [SciPy-user] g2c-pic In-Reply-To: <41811861.50602@telus.net> References: <41811861.50602@telus.net> Message-ID: On Thu, 28 Oct 2004, David Grant wrote: > Does anyone know where the g2c-pic library is from? I'm trying to build the > arpack python extension but it needs g2c-pic. I have g2c on my computer but > not g2c-pic. It builds fine with just g2c but I'm not sure what the > difference is between the two. g2c-pic is g2c with a difference that its content is compiled with -fPIC flag enabled. Pearu From david at dwavesys.com Thu Oct 28 13:16:33 2004 From: david at dwavesys.com (David Grant) Date: Thu, 28 Oct 2004 10:16:33 -0700 Subject: [SciPy-user] g2c-pic In-Reply-To: References: <41811861.50602@telus.net> Message-ID: <41812971.5070606@dwavesys.com> Pearu Peterson wrote: > > > On Thu, 28 Oct 2004, David Grant wrote: > >> Does anyone know where the g2c-pic library is from? I'm trying to >> build the arpack python extension but it needs g2c-pic. I have g2c >> on my computer but not g2c-pic. It builds fine with just g2c but I'm >> not sure what the difference is between the two. > > > g2c-pic is g2c with a difference that its content is compiled with > -fPIC flag enabled. > > I've seen -fPIC used a lot... Just looked at it's description on man gcc and I'm thinking that this will work on my machine but perhaps not on others? Dave -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From david at dwavesys.com Thu Oct 28 13:22:19 2004 From: david at dwavesys.com (David Grant) Date: Thu, 28 Oct 2004 10:22:19 -0700 Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: <41811D82.3040907@ee.byu.edu> References: <417EDA59.8090308@dwavesys.com> <417F405C.20509@mecha.uni-stuttgart.de> <418118FA.2010403@telus.net> <41811D82.3040907@ee.byu.edu> Message-ID: <41812ACB.7010106@dwavesys.com> Travis Oliphant wrote: > >> >> Does anyone know how much work it would be to get ARPACK support in >> scipy? Even just minimal support. This is totally new ground for >> me, so I'd like to know if I'm biting off more than I can chew. > > > > Not a lot for simple support if you use f2py. > > My suggestion would be to write an f2py interface for the desired > routines and we can build up from there. > > I assume your suggestion does not involve using this at all: http://jrfonseca.dyndns.org/work/phd/ ? I believe Josa Fonseca was going to use f2py, but he didn't. Here is from his web page: "These bindings weren't generated with any automatic binding generation tool. Even though I initially tried both PyFortran and f2py, both showed to be inappropriate to handle the specificity of the ARPACK API. ARPACK uses a /reverse communication interface/ where basically the API sucessively returns to caller which must take some update steps, and re-call the API with most arguments untouched. The intelligent (and silent) argument conversions made by the above tools made very difficult to implement and debug the most simple example. Also, for large-scale problems we wouldn't want any kind of array conversion/transposing happening behind the scenes as that would completely kill performance." "Therefore the bindings are faithfull to the original FORTRAN API and are not very friendly as is. Nevertheless a Python wrapper to these calls can easily be made, where all kind of type conversions and dummy-safe actions can be made." So who is right? David From david at dwavesys.com Thu Oct 28 13:32:44 2004 From: david at dwavesys.com (David Grant) Date: Thu, 28 Oct 2004 10:32:44 -0700 Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: <41812404.5040008@ee.byu.edu> References: <417EDA59.8090308@dwavesys.com> <417F405C.20509@mecha.uni-stuttgart.de> <418118FA.2010403@telus.net> <41812404.5040008@ee.byu.edu> Message-ID: <41812D3C.1050606@dwavesys.com> Travis Oliphant wrote: > >> Does anyone know how much work it would be to get ARPACK support in >> scipy? Even just minimal support. This is totally new ground for >> me, so I'd like to know if I'm biting off more than I can chew. > > > After looking over ARPACK, it looks to me that you could get a > functional ARPACK interface in 1-2 days, using f2py. Then, you could > look at the linalg/iterative methods that interface with > reverse-communication fortran code to get an idea how you might write > simpler Python wrappers to the raw wrappers produced by f2py. So use f2py. Then look at the stuff here: *http://tinyurl.com/3uzmy* to figure out how to get reverse-communication to work, then write higher-level code which talks to the python code generated by f2py? > I don't think this would be hard at all. It would be a good way for > you to learn f2py, if you are not already familiar with it. Also, you > might notice how iterative and sparse f2py interfaces use a (very > simple) templating mechanism (in scipy_distutils/from_template.py) > so that interfaces for all four precisions are maintained with a > single code-base. > > But, if you produce an interface for the precision you care about, I > could handle converting it to a general-purpose interface for all > precisions. ok > > Is the ARPACK code distributible in Python? > ARPACK is "freely distributable" or "public domain". I've seen both of these used to describe ARPACK's license or lack-therof. -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From tfogal at apollo.sr.unh.edu Thu Oct 28 13:36:13 2004 From: tfogal at apollo.sr.unh.edu (tom fogal) Date: Thu, 28 Oct 2004 13:36:13 -0400 Subject: [SciPy-user] g2c-pic In-Reply-To: Your message of "Thu, 28 Oct 2004 10:16:33 PDT." <41812971.5070606@dwavesys.com> References: <41811861.50602@telus.net> <41812971.5070606@dwavesys.com> Message-ID: <200410281736.i9SHaDJb003743@apollo.sr.unh.edu> <41812971.5070606 at dwavesys.com>David Grant writes: >I've seen -fPIC used a lot... Just looked at it's description on man >gcc and I'm thinking that this will work on my machine but perhaps not >on others? well, yes and no... I ran into this issue when I started using an AMD64 machine -- every library must be compiled with -fPIC or strange things happen on AMD64. The manual page says it will "only work on some architectures" but I don't think you actually need to worry about this. I can't remember exactly anymore but I think "some" in this definition encompasses very esoteric setups you'll likely never see. I've been paying attention to things that got compiled with the flag on all machines I use for a while now, and its never been a problem on any combination of hardware / free UNIX (inluding linux) / compiler platform to date. I wouldn't think twice about it, unless you're on some ill-used architecture that few people have even heard of. Just my $.02... -tom From david at dwavesys.com Thu Oct 28 13:42:10 2004 From: david at dwavesys.com (David Grant) Date: Thu, 28 Oct 2004 10:42:10 -0700 Subject: [SciPy-user] g2c-pic In-Reply-To: <200410281736.i9SHaDJb003743@apollo.sr.unh.edu> References: <41811861.50602@telus.net> <41812971.5070606@dwavesys.com> <200410281736.i9SHaDJb003743@apollo.sr.unh.edu> Message-ID: <41812F72.6@dwavesys.com> tom fogal wrote: > <41812971.5070606 at dwavesys.com>David Grant writes: > > > > >>I've seen -fPIC used a lot... Just looked at it's description on man >>gcc and I'm thinking that this will work on my machine but perhaps not >>on others? >> >> > >well, yes and no... >I ran into this issue when I started using an AMD64 machine -- every >library must be compiled with -fPIC or strange things happen on AMD64. > >The manual page says it will "only work on some architectures" but I >don't think you actually need to worry about this. I can't remember >exactly anymore but I think "some" in this definition encompasses very >esoteric setups you'll likely never see. I've been paying attention to >things that got compiled with the flag on all machines I use for a >while now, and its never been a problem on any combination of hardware >/ free UNIX (inluding linux) / compiler platform to date. > >I wouldn't think twice about it, unless you're on some ill-used >architecture that few people have even heard of. > >Just my $.02... > > > > Is there any way to tell if my g2c.a was actually compiled with -fPIC? And that they didn't rename it to g2c-pic.a? I'm using gentoo. -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From cookedm at physics.mcmaster.ca Thu Oct 28 14:15:32 2004 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Thu, 28 Oct 2004 14:15:32 -0400 Subject: [SciPy-user] g2c-pic In-Reply-To: <200410281736.i9SHaDJb003743@apollo.sr.unh.edu> References: <41811861.50602@telus.net> <41812971.5070606@dwavesys.com> <200410281736.i9SHaDJb003743@apollo.sr.unh.edu> Message-ID: <20041028181532.GA4671@arbutus.physics.mcmaster.ca> On Thu, Oct 28, 2004 at 01:36:13PM -0400, tom fogal wrote: > <41812971.5070606 at dwavesys.com>David Grant writes: > > > >I've seen -fPIC used a lot... Just looked at it's description on man > >gcc and I'm thinking that this will work on my machine but perhaps not > >on others? > > well, yes and no... > I ran into this issue when I started using an AMD64 machine -- every > library must be compiled with -fPIC or strange things happen on AMD64. Also shared libraries on PowerPC linux (it's the default on OS X). From when I ran linux on my iBook, you'd know when some programmer assumed you didn't need it from the long list of RELOC errors the program would spew. My experience is everything *but* i386 needs -fPIC when compiling shared libraries (which Python extensions are). > The manual page says it will "only work on some architectures" but I > don't think you actually need to worry about this. I can't remember > exactly anymore but I think "some" in this definition encompasses very > esoteric setups you'll likely never see. I've been paying attention to If it doesn't work on an architecture, very likely it will be ignored. (Not sure though). > things that got compiled with the flag on all machines I use for a > while now, and its never been a problem on any combination of hardware > / free UNIX (inluding linux) / compiler platform to date. > > I wouldn't think twice about it, unless you're on some ill-used > architecture that few people have even heard of. > > Just my $.02... Another $.02... -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From tfogal at apollo.sr.unh.edu Thu Oct 28 14:18:25 2004 From: tfogal at apollo.sr.unh.edu (tom fogal) Date: Thu, 28 Oct 2004 14:18:25 -0400 Subject: [SciPy-user] g2c-pic In-Reply-To: Your message of "Thu, 28 Oct 2004 10:42:10 PDT." <41812F72.6@dwavesys.com> References: <41811861.50602@telus.net> <41812971.5070606@dwavesys.com> <200410281736.i9SHaDJb003743@apollo.sr.unh.edu> <41812F72.6@dwavesys.com> Message-ID: <200410281818.i9SIIPGY003886@apollo.sr.unh.edu> <41812F72.6 at dwavesys.com>David Grant writes: >tom fogal wrote: > >> <41812971.5070606 at dwavesys.com>David Grant writes: >> >> >>>I've seen -fPIC used a lot... Just looked at it's description on man >>>gcc and I'm thinking that this will work on my machine but perhaps not >>>on others? >>> >>I wouldn't think twice about it, unless you're on some ill-used >>architecture that few people have even heard of. >Is there any way to tell if my g2c.a was actually compiled with -fPIC? >And that they didn't rename it to g2c-pic.a? I'm using gentoo. hrm. good question. i'm not sure, but if you look into it more and find out the answer i'd be interested to hear it. One option is to add -fPIC to your /etc/make.conf's CFLAGS, and then emerge g2c again. This should ensure it gets compiled with the right support and clobber your old g2c installation. HTH, -tom From pearu at scipy.org Thu Oct 28 17:33:56 2004 From: pearu at scipy.org (Pearu Peterson) Date: Thu, 28 Oct 2004 16:33:56 -0500 (CDT) Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: <41812ACB.7010106@dwavesys.com> References: <417EDA59.8090308@dwavesys.com> <417F405C.20509@mecha.uni-stuttgart.de> <418118FA.2010403@telus.net> <41811D82.3040907@ee.byu.edu> <41812ACB.7010106@dwavesys.com> Message-ID: On Thu, 28 Oct 2004, David Grant wrote: > Travis Oliphant wrote: > >> >>> >>> Does anyone know how much work it would be to get ARPACK support in scipy? >>> Even just minimal support. This is totally new ground for me, so I'd like >>> to know if I'm biting off more than I can chew. >> >> >> >> Not a lot for simple support if you use f2py. >> >> My suggestion would be to write an f2py interface for the desired routines >> and we can build up from there. >> >> > I assume your suggestion does not involve using this at all: > http://jrfonseca.dyndns.org/work/phd/ ? > I believe Josa Fonseca was going to use f2py, but he didn't. > > Here is from his web page: > > "These bindings weren't generated with any automatic binding generation tool. > Even though I initially tried both PyFortran and f2py, both showed to be > inappropriate to handle the specificity of the ARPACK API. ARPACK uses a > /reverse communication interface/ where basically the API sucessively returns > to caller which must take some update steps, and re-call the API with most > arguments untouched. The intelligent (and silent) argument conversions made > by the above tools made very difficult to implement and debug the most simple > example. Also, for large-scale problems we wouldn't want any kind of array > conversion/transposing happening behind the scenes as that would completely > kill performance." I cannot agree with these conclusions, at least when using f2py. The array conversion can be easily avoided behind the scenes (because the main loop is in Fortran) and transposing is not even an issue as user-specific parts of ARPACK API contains only 1-dimensional arrays. > "Therefore the bindings are faithfull to the original FORTRAN API and are not > very friendly as is. Nevertheless a Python wrapper to these calls can easily > be made, where all kind of type conversions and dummy-safe actions can be > made." > So who is right? I looked into ARPACK API and I think f2py could be effectively used to wrap ARPACK. For example, when considering SIMPLE/dssimp.f case then I would write a Fortran subroutine that contains dsaupd main-loop and call to dseupd (the subroutine av would be provided as a callback argument) and then wrap this subroutine with f2py. Pearu From oliphant at ee.byu.edu Thu Oct 28 19:09:26 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 28 Oct 2004 17:09:26 -0600 Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: References: <417EDA59.8090308@dwavesys.com> <417F405C.20509@mecha.uni-stuttgart.de> <418118FA.2010403@telus.net> <41811D82.3040907@ee.byu.edu> <41812ACB.7010106@dwavesys.com> Message-ID: <41817C26.1070107@ee.byu.edu> Pearu Peterson wrote: > > > On Thu, 28 Oct 2004, David Grant wrote: > >> Travis Oliphant wrote: >> >>> >>>> >>>> Does anyone know how much work it would be to get ARPACK support in >>>> scipy? Even just minimal support. This is totally new ground for >>>> me, so I'd like to know if I'm biting off more than I can chew. >>> >>> >>> >>> >>> Not a lot for simple support if you use f2py. >>> >>> My suggestion would be to write an f2py interface for the desired >>> routines and we can build up from there. >>> >>> >> I assume your suggestion does not involve using this at all: >> http://jrfonseca.dyndns.org/work/phd/ ? >> I believe Josa Fonseca was going to use f2py, but he didn't. >> >> Here is from his web page: >> >> "These bindings weren't generated with any automatic binding >> generation tool. Even though I initially tried both PyFortran and >> f2py, both showed to be inappropriate to handle the specificity of >> the ARPACK API. ARPACK uses a /reverse communication interface/ where >> basically the API sucessively returns to caller which must take some >> update steps, and re-call the API with most arguments untouched. The >> intelligent (and silent) argument conversions made by the above tools >> made very difficult to implement and debug the most simple example. >> Also, for large-scale problems we wouldn't want any kind of array >> conversion/transposing happening behind the scenes as that would >> completely kill performance." > > > I cannot agree with these conclusions, at least when using f2py. The > array conversion can be easily avoided behind the scenes (because the > main loop is in Fortran) and transposing is not even an issue as > user-specific parts of ARPACK API contains only 1-dimensional arrays. > I am in agreement with Pearu. Look at the iterative package in scipy.linalg. The underlying Fortran code uses reverse communication and this was managed with f2py-generated wrappers. >> "Therefore the bindings are faithfull to the original FORTRAN API and >> are not very friendly as is. Nevertheless a Python wrapper to these >> calls can easily be made, where all kind of type conversions and >> dummy-safe actions can be made." > > >> So who is right? > > > I looked into ARPACK API and I think f2py could be effectively used to > wrap > ARPACK. For example, when considering SIMPLE/dssimp.f case then > I would write a Fortran subroutine that contains dsaupd main-loop and > call to dseupd (the subroutine av would be provided as a callback > argument) and then wrap this subroutine with f2py. My suggestion is to do something very similar as is done in scipy/linalg/iterative.py wherein the object passed to the Python-level code simply requires a matvec method (like all sparse arrays have), or is a normal 2-d array. Then, call python-wrapped dsaupd in a while loop which does the required thing after returning from every dsaupd call. This is the most flexible interface and deserves a place in scipy. Pearu's suggestion is also useful and may be a bit faster (though I'm not sure it would be noticeably faster). -Travis From nwagner at mecha.uni-stuttgart.de Fri Oct 29 07:40:57 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 29 Oct 2004 13:40:57 +0200 Subject: [SciPy-user] High-Performance BLAS by Kazushige Goto Message-ID: <41822C49.5090808@mecha.uni-stuttgart.de> Hi all, Is it possible to use the High-Performance BLAS by Kazushige Goto http://www.cs.utexas.edu/users/flame/goto/ instead of ATLAS ? Any pointer would be appreciated. Nils From pearu at scipy.org Fri Oct 29 08:33:32 2004 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 29 Oct 2004 07:33:32 -0500 (CDT) Subject: [SciPy-user] High-Performance BLAS by Kazushige Goto In-Reply-To: <41822C49.5090808@mecha.uni-stuttgart.de> References: <41822C49.5090808@mecha.uni-stuttgart.de> Message-ID: On Fri, 29 Oct 2004, Nils Wagner wrote: > Hi all, > > Is it possible to use the High-Performance BLAS by Kazushige Goto > > http://www.cs.utexas.edu/users/flame/goto/ > > instead of ATLAS ? > > Any pointer would be appreciated. 1) Download appropiate file libgoto_xxx.so 2) Install it, say, to /usr/local/lib/libgoto_xxx.so 3) Rebuild scipy using the following commands rm -rf build python setup.py build_src build_ext -O/usr/local/lib/libgoto_xxx.so build Pearu From pearu at scipy.org Fri Oct 29 11:56:22 2004 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 29 Oct 2004 10:56:22 -0500 (CDT) Subject: [SciPy-user] eigenvalues of sparse matrix In-Reply-To: <41817C26.1070107@ee.byu.edu> References: <417EDA59.8090308@dwavesys.com> <417F405C.20509@mecha.uni-stuttgart.de> <418118FA.2010403@telus.net> <41811D82.3040907@ee.byu.edu> <41817C26.1070107@ee.byu.edu> Message-ID: On Thu, 28 Oct 2004, Travis Oliphant wrote: >> I looked into ARPACK API and I think f2py could be effectively used to wrap >> ARPACK. For example, when considering SIMPLE/dssimp.f case then >> I would write a Fortran subroutine that contains dsaupd main-loop and call >> to dseupd (the subroutine av would be provided as a callback argument) and >> then wrap this subroutine with f2py. > > My suggestion is to do something very similar as is done in > scipy/linalg/iterative.py wherein the object passed to the Python-level > code simply requires a matvec method (like all sparse arrays have), or is a > normal 2-d array. Then, call python-wrapped dsaupd in a while loop which > does the required thing after returning from every dsaupd call. > This is the most flexible interface and deserves a place in scipy. > > Pearu's suggestion is also useful and may be a bit faster (though I'm not > sure it would be noticeably faster). My suggestion was not to make things faster (though it might turn out to be slightly so) but more robustly to share common data between dsaupd and dseupd calls: the second part of dseupd arguments should be exactly the same as dsaupd plus the input arguments determining the task must be the same. Though wrapping both dsaupd and dseupd to Python gives more flexibilty but I am not sure that will be ever needed nor would avoid incorrect usage of the ARPACK wrappers. Just my 2 Estonian cents, Pearu From david.grant at telus.net Fri Oct 29 18:26:34 2004 From: david.grant at telus.net (David Grant) Date: Fri, 29 Oct 2004 15:26:34 -0700 Subject: [SciPy-user] C++ extensions Message-ID: <4182C39A.3060901@telus.net> Hey guys (and girls, are there any???), I have some C++ code, it does a decomposition of a large matrix.. It has a bunch of objects. It is very black box though, you just declare an object, give it the matrix and it will give an output. I think it uses CLAPACK. I would like to call this from python. I looked at some Weave information, but that didn't help, because I obviously can't run this in-line since it is many files. Any help like web links is appreciated. David From david at dwavesys.com Fri Oct 29 18:37:33 2004 From: david at dwavesys.com (David Grant) Date: Fri, 29 Oct 2004 15:37:33 -0700 Subject: [SciPy-user] C++ extensions In-Reply-To: <4182C39A.3060901@telus.net> References: <4182C39A.3060901@telus.net> Message-ID: <4182C62D.9070806@dwavesys.com> Anyone used SWIG? David Grant wrote: > Hey guys (and girls, are there any???), > > I have some C++ code, it does a decomposition of a large matrix.. It > has a bunch of objects. It is very black box though, you just declare > an object, give it the matrix and it will give an output. I think it > uses CLAPACK. I would like to call this from python. > > I looked at some Weave information, but that didn't help, because I > obviously can't run this in-line since it is many files. > > Any help like web links is appreciated. > > David > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From david at dwavesys.com Fri Oct 29 19:05:31 2004 From: david at dwavesys.com (David Grant) Date: Fri, 29 Oct 2004 16:05:31 -0700 Subject: [SciPy-user] C++ extensions In-Reply-To: <4182C62D.9070806@dwavesys.com> References: <4182C39A.3060901@telus.net> <4182C62D.9070806@dwavesys.com> Message-ID: <4182CCBB.3040804@dwavesys.com> I also see this: http://docs.python.org/ext/ext.html. It says how to build a module but not how to actually USE it?? David David Grant wrote: > Anyone used SWIG? > > David Grant wrote: > >> Hey guys (and girls, are there any???), >> >> I have some C++ code, it does a decomposition of a large matrix.. It >> has a bunch of objects. It is very black box though, you just >> declare an object, give it the matrix and it will give an output. I >> think it uses CLAPACK. I would like to call this from python. >> >> I looked at some Weave information, but that didn't help, because I >> obviously can't run this in-line since it is many files. >> >> Any help like web links is appreciated. >> >> David >> >> _______________________________________________ >> 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 > > -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From pearu at scipy.org Fri Oct 29 19:31:21 2004 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 29 Oct 2004 18:31:21 -0500 (CDT) Subject: [SciPy-user] C++ extensions In-Reply-To: <4182CCBB.3040804@dwavesys.com> References: <4182C39A.3060901@telus.net> <4182C62D.9070806@dwavesys.com> <4182CCBB.3040804@dwavesys.com> Message-ID: On Fri, 29 Oct 2004, David Grant wrote: > I also see this: http://docs.python.org/ext/ext.html. It says how to build a > module but not how to actually USE it?? Did you read the first section of this document: http://docs.python.org/ext/simpleExample.html ? > David Grant wrote: > >> Anyone used SWIG? Yes, of course;-) >> David Grant wrote: >> >>> Hey guys (and girls, are there any???), >>> >>> I have some C++ code, it does a decomposition of a large matrix.. It has >>> a bunch of objects. It is very black box though, you just declare an >>> object, give it the matrix and it will give an output. I think it uses >>> CLAPACK. I would like to call this from python. What kind of a matrix decomposition are you trying to calculate? May be scipy.linalg has it already. Pearu From david at dwavesys.com Fri Oct 29 19:18:24 2004 From: david at dwavesys.com (David Grant) Date: Fri, 29 Oct 2004 16:18:24 -0700 Subject: [SciPy-user] C++ extensions In-Reply-To: References: <4182C39A.3060901@telus.net> <4182C62D.9070806@dwavesys.com> <4182CCBB.3040804@dwavesys.com> Message-ID: <4182CFC0.7020801@dwavesys.com> Pearu Peterson wrote: > > > On Fri, 29 Oct 2004, David Grant wrote: > >> I also see this: http://docs.python.org/ext/ext.html. It says how to >> build a module but not how to actually USE it?? > > > Did you read the first section of this document: > > http://docs.python.org/ext/simpleExample.html > > ? Yeah, but that was for C. Mine is C++. I thought it would be a little different. > >> David Grant wrote: >> >>> Anyone used SWIG? >> > > Yes, of course;-) So will it work for me? From what I've told you so far? > >>> David Grant wrote: >>> >>>> Hey guys (and girls, are there any???), >>>> >>>> I have some C++ code, it does a decomposition of a large matrix.. >>>> It has a bunch of objects. It is very black box though, you just >>>> declare an object, give it the matrix and it will give an output. >>>> I think it uses CLAPACK. I would like to call this from python. >>> > > What kind of a matrix decomposition are you trying to calculate? May > be scipy.linalg has it already. > It does some CSD. But the algorithm is specific to quantum computing, so I doubt it is in scipy.linalg. Although I'm not sure how much of this code is CSD and how much is other stuff. It's possible I guess to use scipy.linalg and rewrite the supporting stuff in python directly. > Pearu > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited. -------------- next part -------------- A non-text attachment was scrubbed... Name: david.vcf Type: text/x-vcard Size: 334 bytes Desc: not available URL: From pearu at scipy.org Fri Oct 29 20:01:50 2004 From: pearu at scipy.org (Pearu Peterson) Date: Fri, 29 Oct 2004 19:01:50 -0500 (CDT) Subject: [SciPy-user] C++ extensions In-Reply-To: <4182CFC0.7020801@dwavesys.com> References: <4182C39A.3060901@telus.net> <4182C62D.9070806@dwavesys.com> <4182CCBB.3040804@dwavesys.com> <4182CFC0.7020801@dwavesys.com> Message-ID: On Fri, 29 Oct 2004, David Grant wrote: > Pearu Peterson wrote: >> >> On Fri, 29 Oct 2004, David Grant wrote: >> >>> I also see this: http://docs.python.org/ext/ext.html. It says how to >>> build a module but not how to actually USE it?? >> >> >> Did you read the first section of this document: >> >> http://docs.python.org/ext/simpleExample.html >> >> ? > > Yeah, but that was for C. Mine is C++. I thought it would be a little > different. Not so much different, see http://docs.python.org/ext/cplusplus.html However, if you need to wrap C++ classes then you can use either SWIG or Boost.Python. >>>> Anyone used SWIG? >> >> Yes, of course;-) > > So will it work for me? From what I've told you so far? >From what you have told us I see no reason why wouldn't it work. >> >>>> David Grant wrote: >>>> >>>>> Hey guys (and girls, are there any???), >>>>> >>>>> I have some C++ code, it does a decomposition of a large matrix.. It >>>>> has a bunch of objects. It is very black box though, you just declare >>>>> an object, give it the matrix and it will give an output. I think it >>>>> uses CLAPACK. I would like to call this from python. >>>> >> >> What kind of a matrix decomposition are you trying to calculate? May be >> scipy.linalg has it already. >> > It does some CSD. But the algorithm is specific to quantum computing, so I > doubt it is in scipy.linalg. Although I'm not sure how much of this code is > CSD and how much is other stuff. It's possible I guess to use scipy.linalg > and rewrite the supporting stuff in python directly. So you would need gsvd in scipy.linalg but that has not been implemented yet. Pearu From jdhunter at ace.bsd.uchicago.edu Fri Oct 29 21:30:05 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Fri, 29 Oct 2004 20:30:05 -0500 Subject: [SciPy-user] C++ extensions In-Reply-To: <4182C39A.3060901@telus.net> (David Grant's message of "Fri, 29 Oct 2004 15:26:34 -0700") References: <4182C39A.3060901@telus.net> Message-ID: >>>>> "David" == David Grant writes: David> Hey guys (and girls, are there any???), I have some C++ David> code, it does a decomposition of a large matrix.. It has a David> bunch of objects. It is very black box though, you just David> declare an object, give it the matrix and it will give an David> output. I think it uses CLAPACK. I would like to call David> this from python. David> I looked at some Weave information, but that didn't help, David> because I obviously can't run this in-line since it is many David> files. pycxx is very nice; boost python is also a good choice. JDH From prabhu_r at users.sf.net Sat Oct 30 03:40:50 2004 From: prabhu_r at users.sf.net (Prabhu Ramachandran) Date: Sat, 30 Oct 2004 13:10:50 +0530 Subject: [SciPy-user] C++ extensions In-Reply-To: <4182C39A.3060901@telus.net> References: <4182C39A.3060901@telus.net> Message-ID: <16771.17794.93175.156932@monster.linux.in> >>>>> "DG" == David Grant writes: DG> I looked at some Weave information, but that didn't help, DG> because I obviously can't run this in-line since it is many DG> files. That seems like an incorrect assumption. Weave will let you call any function you want from within the inlined code. From the information you have provided, I assume you want to do something like this in Python: a = Numeric.array(...) # Setup your matrix the way you want. call_c_code_that_does_stuff_to_array(a) # Continue work from Python... So simply define call_c_code_that_does_stuff_to_array and write some simple C++ code that does what you want. This is definitely doable from weave. The question is what 'output' does your blackbox produce? If its a number/array then they are easy to handle since weave will let you do that. When you call inline you can pass headers and link to libraries that you have built. So in theory you can build your blackbox C++ code as a library, and call its functions from your inlined code. Of course, you can use SWIG or Boost.Python also. But weave is still an option. cheers, prabhu From missive at hotmail.com Sun Oct 31 11:05:47 2004 From: missive at hotmail.com (Lee Harr) Date: Sun, 31 Oct 2004 20:35:47 +0430 Subject: [SciPy-user] Undefined symbol "ATL_cpttrsm" Message-ID: I am running scipy on FreeBSD 4.10 built from ports. Most things seem to work fine, but ... >>>from scipy import * >>>linalg.solve Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/site-packages/scipy_base/ppimport.py", line 270, in __getattr__ module = self._ppimport_importer() File "/usr/local/lib/python2.3/site-packages/scipy_base/ppimport.py", line 243, in _ppimport_importer module = __import__(name,None,None,['*']) File "/usr/local/lib/python2.3/site-packages/scipy/linalg/__init__.py", line 8, in ? from basic import * File "/usr/local/lib/python2.3/site-packages/scipy/linalg/basic.py", line 11, in ? from lapack import get_lapack_funcs File "/usr/local/lib/python2.3/site-packages/scipy/linalg/lapack.py", line 15, in ? import flapack ImportError: /usr/local/lib/libptf77blas.so.1: Undefined symbol "ATL_cpttrsm" Any hints on how to fix this are appreciated ... _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.com/ From pearu at scipy.org Sun Oct 31 11:44:10 2004 From: pearu at scipy.org (Pearu Peterson) Date: Sun, 31 Oct 2004 10:44:10 -0600 (CST) Subject: [SciPy-user] Undefined symbol "ATL_cpttrsm" In-Reply-To: References: Message-ID: On Sun, 31 Oct 2004, Lee Harr wrote: > I am running scipy on FreeBSD 4.10 built from > ports. Most things seem to work fine, but ... > >>>> from scipy import * >>>> linalg.solve > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.3/site-packages/scipy_base/ppimport.py", line > 270, in __getattr__ > module = self._ppimport_importer() > File "/usr/local/lib/python2.3/site-packages/scipy_base/ppimport.py", line > 243, in _ppimport_importer > module = __import__(name,None,None,['*']) > File "/usr/local/lib/python2.3/site-packages/scipy/linalg/__init__.py", line > 8, in ? > from basic import * > File "/usr/local/lib/python2.3/site-packages/scipy/linalg/basic.py", line > 11, in ? > from lapack import get_lapack_funcs > File "/usr/local/lib/python2.3/site-packages/scipy/linalg/lapack.py", line > 15, in ? > import flapack > ImportError: /usr/local/lib/libptf77blas.so.1: Undefined symbol "ATL_cpttrsm" > > > Any hints on how to fix this are appreciated ... Symbol "ATL_cpttrsm" should be defined in atlas library, try `nm /usr/local/lib/libatlas.* | grep ATL_cpttrsm`. So it looks like atlas library was not used during the linking of flapack extension module or -lptf77blas was specified after -latlas. What is the output (both stdout and stderr) of >>> from scipy_distutils.system_info import get_info >>> get_info('lapack_opt') ? Pearu From missive at hotmail.com Sun Oct 31 12:16:19 2004 From: missive at hotmail.com (Lee Harr) Date: Sun, 31 Oct 2004 21:46:19 +0430 Subject: [SciPy-user] Undefined symbol "ATL_cpttrsm" Message-ID: >>ImportError: /usr/local/lib/libptf77blas.so.1: Undefined symbol >>"ATL_cpttrsm" >> >> >>Any hints on how to fix this are appreciated ... > >Symbol "ATL_cpttrsm" should be defined in atlas library, try `nm >/usr/local/lib/libatlas.* | grep ATL_cpttrsm`. $nm /usr/local/lib/libatlas.so.1 | grep ATL_cpttrsm $nm /usr/local/lib/libatlas.a | grep ATL_cpttrsm $nm /usr/local/lib/libatlas_r.so.1 | grep ATL_cpttrsm 005cfeb8 T ATL_cpttrsm 005cfc48 T ATL_cpttrsm0 005cfca8 T ATL_cpttrsm_nt $nm /usr/local/lib/libatlas_r.a | grep ATL_cpttrsm U ATL_cpttrsm0 ATL_cpttrsm.o: 00000244 T ATL_cpttrsm 00000000 T ATL_cpttrsm0 00000054 T ATL_cpttrsm_nt >So it looks like atlas library was not used during the linking of flapack >extension module or -lptf77blas was specified after -latlas. > >What is the output (both stdout and stderr) of > >>>>from scipy_distutils.system_info import get_info >>>>get_info('lapack_opt') > >>>get_info('lapack_opt') lapack_opt_info: atlas_threads_info: scipy_distutils.system_info.atlas_threads_info FOUND: libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/usr/local/lib'] language = f77 include_dirs = ['/usr/local/include'] running build_src building extension "atlas_version" sources creating build creating build/src adding 'build/src/atlas_version_0x3987e8cd.c' to sources. running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext Could not locate executable g77 customize GnuFCompiler customize GnuFCompiler customize GnuFCompiler using build_ext building 'atlas_version' extension compling C sources cc options: '-fno-strict-aliasing -DNDEBUG -O -pipe -D_THREAD_SAFE -DTHREAD_STACK_SIZE=0x20000 -fPIC' creating build/temp.freebsd-4.10-STABLE-i386-2.3 creating build/temp.freebsd-4.10-STABLE-i386-2.3/build creating build/temp.freebsd-4.10-STABLE-i386-2.3/build/src compile options: '-I/usr/local/include -I/usr/local/include/python2.3 -c' cc: build/src/atlas_version_0x3987e8cd.c creating build/lib.freebsd-4.10-STABLE-i386-2.3 /usr/bin/f77 -shared build/temp.freebsd-4.10-STABLE-i386-2.3/build/src/atlas_version_0x3987e8cd.o -L/usr/local/lib -L/usr/lib -latlas -lg2c -o build/lib.freebsd-4.10-STABLE-i386-2.3/atlas_version.so FOUND: libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas'] library_dirs = ['/usr/local/lib'] language = f77 define_macros = [('ATLAS_INFO', '"\\"3.6.0\\""')] include_dirs = ['/usr/local/include'] {'libraries': ['lapack', 'ptf77blas', 'ptcblas', 'atlas'], 'library_dirs': ['/usr/local/lib'], 'language': 'f77', 'define_macros': [('ATLAS_INFO', '"\\"3.6.0\\""')], 'include_dirs': ['/usr/local/include']} so... it looks like the threaded (_r) libs have the symbol, but not the unthreaded, but the threaded libs were not linked in ... I am looking around (through ...Lib/linalg/...) but I do not see where I might point the build to the correct lib. Thanks for your time. _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.com/ From pearu at scipy.org Sun Oct 31 13:22:01 2004 From: pearu at scipy.org (Pearu Peterson) Date: Sun, 31 Oct 2004 12:22:01 -0600 (CST) Subject: [SciPy-user] Undefined symbol "ATL_cpttrsm" In-Reply-To: References: Message-ID: On Sun, 31 Oct 2004, Lee Harr wrote: >>> ImportError: /usr/local/lib/libptf77blas.so.1: Undefined symbol >>> "ATL_cpttrsm" >>> >>> >>> Any hints on how to fix this are appreciated ... >> >> Symbol "ATL_cpttrsm" should be defined in atlas library, try `nm >> /usr/local/lib/libatlas.* | grep ATL_cpttrsm`. > > $nm /usr/local/lib/libatlas.so.1 | grep ATL_cpttrsm > $nm /usr/local/lib/libatlas.a | grep ATL_cpttrsm > $nm /usr/local/lib/libatlas_r.so.1 | grep ATL_cpttrsm > 005cfeb8 T ATL_cpttrsm > 005cfc48 T ATL_cpttrsm0 > 005cfca8 T ATL_cpttrsm_nt > $nm /usr/local/lib/libatlas_r.a | grep ATL_cpttrsm > U ATL_cpttrsm0 > ATL_cpttrsm.o: > 00000244 T ATL_cpttrsm > 00000000 T ATL_cpttrsm0 > 00000054 T ATL_cpttrsm_nt > > >> So it looks like atlas library was not used during the linking of flapack >> extension module or -lptf77blas was specified after -latlas. >> >> What is the output (both stdout and stderr) of >> >>>>> from scipy_distutils.system_info import get_info >>>>> get_info('lapack_opt') >> > > > >>>> get_info('lapack_opt') > build/lib.freebsd-4.10-STABLE-i386-2.3/atlas_version.so > FOUND: > libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas'] > library_dirs = ['/usr/local/lib'] > language = f77 > define_macros = [('ATLAS_INFO', '"\\"3.6.0\\""')] > include_dirs = ['/usr/local/include'] > > {'libraries': ['lapack', 'ptf77blas', 'ptcblas', 'atlas'], 'library_dirs': > ['/usr/local/lib'], 'language': 'f77', 'define_macros': [('ATLAS_INFO', > '"\\"3.6.0\\""')], 'include_dirs': ['/usr/local/include']} > > > > so... it looks like the threaded (_r) libs have the symbol, but not > the unthreaded, but the threaded libs were not linked in ... Hmm, it looks like there are other _r libs as well in freebsd version of atlas: http://www.freebsd.org/cgi/cvsweb.cgi/ports/math/atlas-devel/pkg-plist?rev=1.1&content-type=text/x-cvsweb-markup Do you know where the usage of atlas _r-libraries is documented? I am pretty sure that official atlas does not build such libraries. > I am looking around (through ...Lib/linalg/...) but I do not see where > I might point the build to the correct lib. This should be done in scipy_distutils/system_info.py. Look for the definition of *atlas_threads* classes. If freebsd uses for _r-libraries for threaded linking then pt{f77,c}blas should be replaced with {f77,c}blas_r but I am not sure, the usage of _r-libraries looks odd to me. Could anyone explain why freebsd introduces _r-libraries? And thanks for your feedback! We have had reports from freebsd users having also trouble building scipy but yours one is a step forward for resolving this issue. Pearu From missive at hotmail.com Sun Oct 31 13:34:18 2004 From: missive at hotmail.com (Lee Harr) Date: Sun, 31 Oct 2004 23:04:18 +0430 Subject: [SciPy-user] Undefined symbol "ATL_cpttrsm" Message-ID: >>>>ImportError: /usr/local/lib/libptf77blas.so.1: Undefined symbol >>>>"ATL_cpttrsm" >>>> >>>> >>>>Any hints on how to fix this are appreciated ... >>> >>>Symbol "ATL_cpttrsm" should be defined in atlas library, try `nm >>>/usr/local/lib/libatlas.* | grep ATL_cpttrsm`. >> >> >>so... it looks like the threaded (_r) libs have the symbol, but not >>the unthreaded, but the threaded libs were not linked in ... > >This should be done in scipy_distutils/system_info.py. Look for >the definition of *atlas_threads* classes. If freebsd uses for _r-libraries >for threaded linking then pt{f77,c}blas should be replaced >with {f77,c}blas_r but I am not sure, the usage of _r-libraries looks odd >to me. Could anyone explain why freebsd introduces _r-libraries? > I tried changing: class atlas_threads_info(atlas_info): _lib_names = ['ptf77blas','ptcblas'] class atlas_blas_threads_info(atlas_blas_info): _lib_names = ['ptf77blas','ptcblas'] to: class atlas_threads_info(atlas_info): _lib_names = ['atlas_r','ptf77blas','ptcblas'] class atlas_blas_threads_info(atlas_blas_info): _lib_names = ['atlas_r','ptf77blas','ptcblas'] Now I get this .... >>>from scipy import * >>>linalg.solve Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.3/site-packages/scipy_base/ppimport.py", line 270, in __getattr__ module = self._ppimport_importer() File "/usr/local/lib/python2.3/site-packages/scipy_base/ppimport.py", line 243, in _ppimport_importer module = __import__(name,None,None,['*']) File "/usr/local/lib/python2.3/site-packages/scipy/linalg/__init__.py", line 8, in ? from basic import * File "/usr/local/lib/python2.3/site-packages/scipy/linalg/basic.py", line 11, in ? from lapack import get_lapack_funcs File "/usr/local/lib/python2.3/site-packages/scipy/linalg/lapack.py", line 16, in ? import clapack ImportError: /usr/local/lib/python2.3/site-packages/scipy/linalg/clapack.so: Undefined symbol "clapack_sgesv" but I do not see that one defined anywhere... _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.com/ From pearu at scipy.org Sun Oct 31 14:02:24 2004 From: pearu at scipy.org (Pearu Peterson) Date: Sun, 31 Oct 2004 13:02:24 -0600 (CST) Subject: [SciPy-user] Undefined symbol "ATL_cpttrsm" In-Reply-To: References: Message-ID: On Sun, 31 Oct 2004, Lee Harr wrote: > I tried changing: > > class atlas_threads_info(atlas_info): > _lib_names = ['ptf77blas','ptcblas'] > > class atlas_blas_threads_info(atlas_blas_info): > _lib_names = ['ptf77blas','ptcblas'] > > > to: > > class atlas_threads_info(atlas_info): > _lib_names = ['atlas_r','ptf77blas','ptcblas'] > > class atlas_blas_threads_info(atlas_blas_info): > _lib_names = ['atlas_r','ptf77blas','ptcblas'] > > > Now I get this .... > >>>> from scipy import * >>>> linalg.solve > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/local/lib/python2.3/site-packages/scipy_base/ppimport.py", line > 270, in __getattr__ > module = self._ppimport_importer() > File "/usr/local/lib/python2.3/site-packages/scipy_base/ppimport.py", line > 243, in _ppimport_importer > module = __import__(name,None,None,['*']) > File "/usr/local/lib/python2.3/site-packages/scipy/linalg/__init__.py", line > 8, in ? > from basic import * > File "/usr/local/lib/python2.3/site-packages/scipy/linalg/basic.py", line > 11, in ? > from lapack import get_lapack_funcs > File "/usr/local/lib/python2.3/site-packages/scipy/linalg/lapack.py", line > 16, in ? > import clapack > ImportError: /usr/local/lib/python2.3/site-packages/scipy/linalg/clapack.so: > Undefined symbol "clapack_sgesv" > > but I do not see that one defined anywhere... atlas or atlas_r should be the last in library names list. So try changing 'atlas' to 'atlas_r' in calc_info method of atlas_info class and undo your changes in atlas_threads_info, .. Pearu From missive at hotmail.com Sun Oct 31 16:35:59 2004 From: missive at hotmail.com (Lee Harr) Date: Mon, 01 Nov 2004 02:05:59 +0430 Subject: [SciPy-user] Undefined symbol "ATL_cpttrsm" Message-ID: >atlas or atlas_r should be the last in library names list. So try changing >'atlas' to 'atlas_r' in calc_info method of atlas_info class and undo your >changes in atlas_threads_info, .. > Ok.. I changed ... def calc_info(self): lib_dirs = self.get_lib_dirs() info = {} atlas_libs = self.get_libs('atlas_libs', self._lib_names + ['atlas']) lapack_libs = self.get_libs('lapack_libs',['lapack']) to ... def calc_info(self): lib_dirs = self.get_lib_dirs() info = {} atlas_libs = self.get_libs('atlas_libs', self._lib_names + ['atlas_r']) lapack_libs = self.get_libs('lapack_libs',['lapack']) but I still get ... ImportError: /usr/local/lib/python2.3/site-packages/scipy/linalg/clapack.so: Undefined symbol "clapack_sgesv" _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.com/ From pearu at scipy.org Sun Oct 31 17:19:56 2004 From: pearu at scipy.org (Pearu Peterson) Date: Sun, 31 Oct 2004 16:19:56 -0600 (CST) Subject: [SciPy-user] Undefined symbol "ATL_cpttrsm" In-Reply-To: References: Message-ID: On Mon, 1 Nov 2004, Lee Harr wrote: > >> atlas or atlas_r should be the last in library names list. So try changing >> 'atlas' to 'atlas_r' in calc_info method of atlas_info class and undo your >> changes in atlas_threads_info, .. >> > > > Ok.. I changed ... > > def calc_info(self): > lib_dirs = self.get_lib_dirs() > info = {} > atlas_libs = self.get_libs('atlas_libs', > self._lib_names + ['atlas']) > lapack_libs = self.get_libs('lapack_libs',['lapack']) > > > to ... > > def calc_info(self): > lib_dirs = self.get_lib_dirs() > info = {} > atlas_libs = self.get_libs('atlas_libs', > self._lib_names + ['atlas_r']) > lapack_libs = self.get_libs('lapack_libs',['lapack']) > > > but I still get ... > > ImportError: /usr/local/lib/python2.3/site-packages/scipy/linalg/clapack.so: > Undefined symbol "clapack_sgesv" Symbol "clapack_sgesv" should be defined in atlas liblapack.{a,so}. But this may be different in freebsd. Try changing 'lapack' to 'alapack' or 'alapack_r'. Note that I am just guessing here, so, if you get more undefined symbol errors then try to find out yourself where these symbols are defined using nm, for instance, and modify library name lists accordingly. Let us know about the results. Thanks, Pearu From missive at hotmail.com Sun Oct 31 19:05:49 2004 From: missive at hotmail.com (Lee Harr) Date: Mon, 01 Nov 2004 04:35:49 +0430 Subject: [SciPy-user] Undefined symbol "ATL_cpttrsm" Message-ID: >>but I still get ... >> >>ImportError: >>/usr/local/lib/python2.3/site-packages/scipy/linalg/clapack.so: Undefined >>symbol "clapack_sgesv" > >Symbol "clapack_sgesv" should be defined in atlas liblapack.{a,so}. But >this may be different in freebsd. Try changing 'lapack' to 'alapack' or >'alapack_r'. > >Note that I am just guessing here, so, if you get more undefined symbol >errors then try to find out yourself where these symbols are defined using >nm, for instance, and modify library name lists accordingly. Let us know >about the results. > Does the phrase 'woot!' mean anything to you? def calc_info(self): lib_dirs = self.get_lib_dirs() info = {} atlas_libs = self.get_libs('atlas_libs', self._lib_names + ['atlas_r']) lapack_libs = self.get_libs('lapack_libs',['alapack_r']) did the trick... >>>from scipy import * >>>linalg.solve >>>A = mat('[1 3 5; 2 5 1; 2 3 8]') >>>A.I Matrix([[-1.48, 0.36, 0.88], [ 0.56, 0.08, -0.36], [ 0.16, -0.12, 0.04]]) >>>linalg.inv(A) array([[-1.48, 0.36, 0.88], [ 0.56, 0.08, -0.36], [ 0.16, -0.12, 0.04]]) >>>b = mat('[10;8;3]') >>>A.I * b Matrix([[-9.28], [ 5.16], [ 0.76]]) >>>linalg.solve(A, b) array([[-9.28], [ 5.16], [ 0.76]]) The other patch I needed to get scipy to build under FreeBSD was to remove references to the arctanh_data, arccosh_data, and arcsinh_data from scipy_core/scipy_base/fastumath_unsigned.inc Should I post complete patches here, or create a FreeBSD ports problem report? _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.com/