From bulatov at cs.orst.edu Sun Aug 1 13:44:34 2004 From: bulatov at cs.orst.edu (bulatov at cs.orst.edu) Date: Sun, 1 Aug 2004 10:44:34 -0700 Subject: [SciPy-user] Numarray vs. Numeric for adding doubles Message-ID: <1091382274.410d2c0279337@webmail.oregonstate.edu> I did a microbenchmark to time how long it takes to add up an array of 10 million doubles. Numeric is faster on small sizes, they both have same performance with 1100 elements, after which numarray becomes faster. You can see the graph and numbers on bottom of http://yaroslav.hopto.org/russianwiki/index.php/c-numeric-speed Yaroslav From aisaac at american.edu Sun Aug 1 18:59:01 2004 From: aisaac at american.edu (Alan G Isaac) Date: Sun, 1 Aug 2004 18:59:01 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplt Message-ID: Is there a mechanism for passing global formatting strings to gnuplot using gplt? Right now I need set size square set zeroaxis -1 set noxtics; set noytics set noborder I'm relying on the plot tutorial http://www.scipy.org/documentation/plottutorial.html and I don't see how to do these. Is there a really good reason to have def size(self,size=(1.,1.)): cmd = 'set size %f,%f' % size self._replot(cmd) instead of def size(self,size='1.,1.'): cmd = 'set size ' + size self._replot(cmd) The latter would give access to the full gnuplot functionality for size and fits better with the rest of the gplt syntax. And how about adding something along the lines of def replot(self,plotstr=""): cmd = plotstr + '; replot\n' self._replot(cmd) to allow easy setting of global commands for those familiar with gnuplot? Thanks, Alan Isaac From aisaac at american.edu Sun Aug 1 22:23:35 2004 From: aisaac at american.edu (Alan G Isaac) Date: Sun, 1 Aug 2004 22:23:35 -0400 (Eastern Daylight Time) Subject: [SciPy-user] plot_func Message-ID: I noticed that pyPlot.py has: def plot_func(self,func): self._init_plot() if(type(func) == StringType): self._send('plot '+ func) else: print 'error: requires a function as a string' but gplt.plot_func is not available. Why? I want to use this as part of gplt! How should I proceed? Thanks, Alan Isaac From jmhodge at bgnet.bgsu.edu Mon Aug 2 16:17:02 2004 From: jmhodge at bgnet.bgsu.edu (Jeff Hodges) Date: Mon, 02 Aug 2004 16:17:02 -0400 Subject: [SciPy-user] genetic algorithm examples Message-ID: <1091477822.15531.45.camel@localhost> Hey, Has anyone here used scipy.ga in a project? I'm trying to learn it but I'm running into walls. I've tried checking with the documentation, but all I can find is the api docs that are missing sorely needed explanations. I'm trying to learn it by reading the code as we speak, and I was hoping I might be able to look at someone else's code to really understand how it all ties together. Thanks! From stephen.walton at csun.edu Mon Aug 2 16:25:28 2004 From: stephen.walton at csun.edu (Stephen Walton) Date: Mon, 02 Aug 2004 13:25:28 -0700 Subject: [SciPy-user] Numarray vs. Numeric for adding doubles In-Reply-To: <1091382274.410d2c0279337@webmail.oregonstate.edu> References: <1091382274.410d2c0279337@webmail.oregonstate.edu> Message-ID: <1091478328.22349.2.camel@freyer.sfo.csun.edu> On Sun, 2004-08-01 at 10:44, bulatov at cs.orst.edu wrote: > I did a microbenchmark to time how long it takes to add up an array of 10 > million doubles. Over on the numpy-discussion list, I and a couple of others have been exchanging ways of building Numeric (and Numarray) so that they use the ATLAS tuned BLAS/LAPACK routines instead of the generic ones shipped with the packages. Depending on the platform, factors of 3 to 10 speedups in solving large linear systems with solve_linear_equations from the LinearAlgebra package have been seen. -- Stephen Walton Dept. of Physics & Astronomy, Cal State Northridge From gekauft at hoc.net Tue Aug 3 07:57:15 2004 From: gekauft at hoc.net (Christian Kristukat) Date: Tue, 03 Aug 2004 13:57:15 +0200 Subject: [SciPy-user] lmder Message-ID: <410F7D9B.4010201@hoc.net> Hi, I tried to use scipys lmder wrapper like in the following lines but it segfaults on SuSE9.1/python2.3/scipy0.3a. Am I using it wrong or is this a bug? from scipy import * import math x = r_[0:10] y = 1/3.0*x**2+1/7.0*x-math.pi def res(a, *args): return y-(a[0]*x**2+a[1]*x+a[2]) def jac(*args): j = [] j.append(x**2) j.append(x) j.append(1+0*x) j = array(j) return j a = array([0,0,0]) info = optimize.leastsq(res, a, Dfun=jac, col_deriv=1) print info Thanks for help, Christian From mhellman at mitre.org Tue Aug 3 10:29:52 2004 From: mhellman at mitre.org (Matthew Hellman) Date: Tue, 03 Aug 2004 10:29:52 -0400 Subject: [SciPy-user] gplt Message-ID: <1091543391.5618.2.camel@cytochrome> Does anyone know why the function legend() provides no output on the screen? Also, I would appreciate any suggestions on how to trace 2-D lines so as to be able to view all the data points on the graph. Thanks, Matt From aisaac at american.edu Tue Aug 3 10:44:30 2004 From: aisaac at american.edu (Alan G Isaac) Date: Tue, 3 Aug 2004 10:44:30 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplt In-Reply-To: <1091543391.5618.2.camel@cytochrome> References: <1091543391.5618.2.camel@cytochrome> Message-ID: On Tue, 03 Aug 2004, Matthew Hellman apparently wrote: > Does anyone know why the function legend() provides no output on the > screen? Also, I would appreciate any suggestions on how to trace 2-D > lines so as to be able to view all the data points on the graph. from scipy import * from scipy import gplt d=arange(-1.,1.,0.01) gplt.plot(d,f(d),'with lines lt 1',\ d,f(d),'with points lt 1') gplt.legend('title "Legend"') hth, Alan Isaac From matt at hotdispatch.com Tue Aug 3 14:41:46 2004 From: matt at hotdispatch.com (matt) Date: Tue, 3 Aug 2004 14:41:46 -0400 Subject: [SciPy-user] another gplt question Message-ID: I have code that plots several traces on several plots. I found hold and got that to work for plotting multiple traces on a plot. However, I seem to have frequent issues with data from a previous plot ending up on a subsequent plot in addition to the new data. Is there a way to explicitly tell gplt that a plot is done and all subsequent plot commands are for a new plot? It seems strange that there isn't an gplt instance for each plot or something of that nature. -Matt From aisaac at american.edu Tue Aug 3 12:29:40 2004 From: aisaac at american.edu (Alan G Isaac) Date: Tue, 3 Aug 2004 12:29:40 -0400 (Eastern Daylight Time) Subject: [SciPy-user] Re: plot_func In-Reply-To: References: Message-ID: On Sun, 1 Aug 2004 Alan G Isaac apparently wrote: > I noticed that pyPlot.py has: > def plot_func(self,func): > self._init_plot() > if(type(func) == StringType): > self._send('plot '+ func) > else: > print 'error: requires a function as a string' > but gplt.plot_func is not available. OK, I've confirmed that if I make an instance of scipy.gplt.pyPlot.Plot then the plot_func method works fine for this instance. I don't know enough about Python to guess why gplt is not giving us access to this. Can anyone help? Thank you, Alan Isaac From aisaac at american.edu Tue Aug 3 14:57:09 2004 From: aisaac at american.edu (Alan G Isaac) Date: Tue, 3 Aug 2004 14:57:09 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplt In-Reply-To: <1091546083.5618.20.camel@cytochrome> References: <1091543391.5618.2.camel@cytochrome><1091546083.5618.20.camel@cytochrome> Message-ID: On Tue, 03 Aug 2004, someone wrote: > Is there also a way to print the names of my > datalists instead of the strings "/tmp/@5745.4" as well as to > differentiate the colors of the lines that appear using your gplt.plot > function so I can tell which line corresponds to which data set without > the sole use of the markers? d=arange(-1.,1.,0.01) gplt.plot(d,d**2,"title 'test' with lines lt 3",d,d**2,"notitle with points lt 1") Color is controlled by the linetype, unfortunately. You'll have to see the gnuplot documentation. Cheers, Alan Isaac From aisaac at american.edu Tue Aug 3 16:23:12 2004 From: aisaac at american.edu (Alan G Isaac) Date: Tue, 3 Aug 2004 16:23:12 -0400 (Eastern Daylight Time) Subject: [SciPy-user] pyPlot.py vs. Gnuplot.py Message-ID: As a new SciPy user, I am interested in understanding the relationship between the scipy.gplt module and the Gnuplot.py project. What considerations influence which was chosen, and which a new user should choose? This is especially important to me as I am planning to use one of these in a teaching setting. Thank you, Alan Isaac From Fernando.Perez at colorado.edu Wed Aug 4 00:53:28 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Tue, 03 Aug 2004 22:53:28 -0600 Subject: [SciPy-user] Re: [Gnuplot-py-users] pyPlot.py vs. Gnuplot.py In-Reply-To: References: Message-ID: <41106BC8.7070909@colorado.edu> Alan G Isaac wrote: > As a new SciPy user, I am interested in understanding > the relationship between the scipy.gplt module and the > Gnuplot.py project. > > What considerations influence which was chosen, and > which a new user should choose? > > This is especially important to me as I am planning > to use one of these in a teaching setting. If you decide to use Gnuplot.py, you may want to consider using it through ipython (http://ipython.scipy.org). Ipython, via the IPython.GnuplotRuntime and .GnuplotInteractive modules, adds substantial functionality on top of the default Gnuplot.py, to make interactive work as easy and efficient as possible. There are also some enhancements for scripted use, which facilitate common plotting tasks and EPS generation. I personally decided to use Gnuplot.py (with my enhancements in ipython), because I found the interface to be cleaner than that exhibited by scipy.gplt. This is probably due to the fact that gplt was trying to keep a consistent interface across scipy's 3 plotting subsystems. Note that I use the rest of scipy extensively, it's only for plotting that I decided to use an alternate solution. You may also consider matplotlib, which IMHO holds a lot of promise. I am currently working on a multithreaded version of ipython so it can be used interactively with matplotlib and the Wx/gtk frontends (the Tk one already works fine). Best, f From martin.wiechert at gmx.de Wed Aug 4 05:01:05 2004 From: martin.wiechert at gmx.de (Martin Wiechert) Date: Wed, 4 Aug 2004 11:01:05 +0200 Subject: [SciPy-user] Bug in optimize.newton Message-ID: <200408041101.05424.martin.wiechert@gmx.de> Hi, I've been bitten by a bug in the snippet from optimize.newton below (yesterday's CVS). I think, the actual bug is in line 317, which should read if abs(p-p1) < tol: instead of if abs(p-p0) < tol: This will typically only cause one superfluous iteration, which is no problem. But consider the following situation: alter_numeric () has been called. So, if one passes, say, a Float32 0d array as initial value, this will coerce all other scalars into Float32 0d arrays. So if you happen to get identical p's for two consecutive iterations, this will go unnoticed, because the ZeroDivisionError is not raised (rather the next p is nan), and line 317 doesn't compare the right p's. else: # Secant method p0 = x0 p1 = x0*(1+1e-4) q0 = apply(func,(p0,)+args) q1 = apply(func,(p1,)+args) for iter in range(maxiter): try: p = p1 - q1*(p1-p0)/(q1-q0) except ZeroDivisionError: if p1 != p0: print "Tolerance of %g reached" % (p1-p0) return (p1+p0)/2.0 if abs(p-p0) < tol: return p p0 = p1 q0 = q1 p1 = p q1 = apply(func,(p1,)+args) Regards, Martin Wiechert. From aisaac at american.edu Wed Aug 4 11:14:27 2004 From: aisaac at american.edu (Alan G Isaac) Date: Wed, 4 Aug 2004 11:14:27 -0400 (Eastern Daylight Time) Subject: [SciPy-user] scipy choice of defaults for matrix manipulation Message-ID: The SciPy documentation says: To begin with, all of the Numeric functions have been subsumed into the scipy namespace so that all of those functions are available without additionally importing Numeric. It was therefore unsettling to find that SciPy's function_base defines def cumsum(m,axis=-1): """Returns the cumulative sum of the elements along the given axis """ if axis is None: m = ravel(m) axis = 0 else: m = _asarray1d(m) return add.accumulate(m,axis) This changes the default axis of Numeric and numarray. Bug or feature?? Example: >>> x=[[1,2],[3,4]] >>> from scipy import * >>> print cumsum(x) [[1,3] [3,7]] >>> print Numeric.cumsum(x) [[1,2] [4,6]] I believe this should be considered a serious bug, either in implementation or documentation. Since SciPy is likely to be attracting Numeric and numarray users, I believe it should be considered an implementation bug. Naturally cumprod has the same problem. (I did not try to review the whole list, so there may be others.) There is even a certain schizophrenia: sum and prod choose different axes! It is clear that this has been thought about at some point, since SciPy's sum definition includes a note suggesting that the axis might change in the future (to *conflict* with the choice in Numeric and numarray!!). This is likely to generate great user confusion. It cost me some time. Thank you, Alan Isaac From rkern at ucsd.edu Wed Aug 4 18:07:25 2004 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 04 Aug 2004 17:07:25 -0500 Subject: [SciPy-user] scipy choice of defaults for matrix manipulation In-Reply-To: References: Message-ID: <41115E1D.4010205@ucsd.edu> Alan G Isaac wrote: > The SciPy documentation says: > To begin with, all of the Numeric functions have > been subsumed into the scipy namespace so that all > of those functions are available without > additionally importing Numeric. > > It was therefore unsettling to find that SciPy's function_base defines > def cumsum(m,axis=-1): > """Returns the cumulative sum of the elements along the given axis > """ > if axis is None: > m = ravel(m) > axis = 0 > else: > m = _asarray1d(m) > return add.accumulate(m,axis) > > This changes the default axis of Numeric and numarray. > Bug or feature?? Implementation feature; documentation bug. Numeric's functions have various, inconsistent ("schizophrenic" as you say) choices for the default axis. An attempt, albeit incomplete as you note, was made with SciPy to standardize on always using axis=-1. I'm fairly positive this was documented somewhere at some point, but probably only on the old website. The tutorial really should be updated to prominently note this convention. -- 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 Aug 5 10:09:55 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Thu, 05 Aug 2004 16:09:55 +0200 Subject: [SciPy-user] Constrained Optimizers (multivariate) in scipy Message-ID: <41123FB3.1040707@mecha.uni-stuttgart.de> Dear all, I am looking for a small test example using one of the constrained optimizers currently available in scipy 1. fmin_l_bfgs_b 2. fmin_tnc 3. fmin_cobyla Any pointer would be appreciated. Thanks in advance. Nils From bhoel at web.de Thu Aug 5 15:14:47 2004 From: bhoel at web.de (=?iso-8859-1?q?Berthold_H=F6llmann?=) Date: Thu, 05 Aug 2004 21:14:47 +0200 Subject: [SciPy-user] Re: Building Debug extrensions with scipy_distutils on WinXP In-Reply-To: ( =?iso-8859-1?q?Berthold_H=F6llmann's_message_of?= "Tue, 27 Jul 2004 17:23:30 +0200") References: Message-ID: Berthold H?llmann writes: > Berthold H?llmann writes: > >> Hello, > ... > > I finaly found the patch > > hoel at donau:scipy cvs -q diff scipy_core/scipy_distutils/compaqfcompiler.py > Index: scipy_core/scipy_distutils/compaqfcompiler.py > =================================================================== > RCS file: /home/cvsroot/world/scipy_core/scipy_distutils/compaqfcompiler.py,v > retrieving revision 1.5 > diff -r1.5 compaqfcompiler.py > 86a87,95 >> def _get_cc_args(self, pp_opts, debug, before): >> cc_args = pp_opts >> if debug: >> cc_args[:0] = self.get_flags_debug() >> if before: >> cc_args[:0] = before >> return cc_args >> >> > > which allows me to build debug extension modules under WinXP using > Visual Studio 6.0 and Compaq Visual Fortran 6.1 A. Can anybody comment on this patch. We do need debugging support for Windows and I would like to hear of some scipy developer if there's a chance for this or a similar patch to get into the CVS and later an official release. Kind regards Berthold H?llmann -- bhoel at web.de / http://starship.python.net/crew/bhoel/ From matttdl at hotmail.com Thu Aug 5 16:19:20 2004 From: matttdl at hotmail.com (Matt Kubilus) Date: Thu, 05 Aug 2004 16:19:20 -0400 Subject: [SciPy-user] pyPlot.py vs. Gnuplot.py Message-ID: Another new user commenting. I found that pyPlot was less reliable than gnuplot and had less features. For instance, with the wx based pyPlot, once I closed a window with a plot in my wx based application, I could no longer open the graph. The C object has already been destroyed was the error in a nut shell. Restarting the application was the only workaround. Has anyone else ran into, fixed a similar problem. Gnuplot is also able to do interesting things like 3d plots (not necessary for what I use it for) I use this in a manufacturing/data gathering setting. --Matt Kubilus >From: Alan G Isaac >Reply-To: aisaac at american.edu,SciPy Users List >To: gnuplot-py-users at lists.sourceforge.net,scipy-user > >Subject: [SciPy-user] pyPlot.py vs. Gnuplot.py >Date: Tue, 3 Aug 2004 16:23:12 -0400 (Eastern Daylight Time) > >As a new SciPy user, I am interested in understanding >the relationship between the scipy.gplt module and the >Gnuplot.py project. > >What considerations influence which was chosen, and >which a new user should choose? > >This is especially important to me as I am planning >to use one of these in a teaching setting. > >Thank you, >Alan Isaac > > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user _________________________________________________________________ Discover the best of the best at MSN Luxury Living. http://lexus.msn.com/ From matttdl at hotmail.com Thu Aug 5 16:15:10 2004 From: matttdl at hotmail.com (Matt Kubilus) Date: Thu, 05 Aug 2004 16:15:10 -0400 Subject: [SciPy-user] Re: plot_func Message-ID: Looking at the gplt modules, it appears that the necessary function to send commands directly is a hidden function. I ended up needing to use scipy.gplt with time series data that I was logging. There doesn't appear to be a way to do this (Gnuplot can, scipy.gplt makes this not possible) so anyways, I hacked into the pyPlot.py module and added a function that essentially just sends a command to the hidden function that actually calls the plotting routines. This allowed me to use the full functionality of gnuplot which can to way more than just what scipy.gplt does. If anyone is interested, I can post the actual code changes. --Matt Kubilus >From: Alan G Isaac >Reply-To: aisaac at american.edu,SciPy Users List >To: aisaac at american.edu, scipy-user at scipy.net >CC: scipy-dev at scipy.net >Subject: [SciPy-user] Re: plot_func >Date: Tue, 3 Aug 2004 12:29:40 -0400 (Eastern Daylight Time) > >On Sun, 1 Aug 2004 Alan G Isaac apparently wrote: > > I noticed that pyPlot.py has: > > def plot_func(self,func): > > self._init_plot() > > if(type(func) == StringType): > > self._send('plot '+ func) > > else: > > print 'error: requires a function as a string' > > but gplt.plot_func is not available. > > > > >OK, I've confirmed that if I make an instance of >scipy.gplt.pyPlot.Plot >then the plot_func method works fine for this instance. > >I don't know enough about Python to guess why gplt is >not giving us access to this. Can anyone help? > >Thank you, >Alan Isaac > > > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user _________________________________________________________________ Discover the best of the best at MSN Luxury Living. http://lexus.msn.com/ From haase at msg.ucsf.edu Thu Aug 5 17:32:02 2004 From: haase at msg.ucsf.edu (Sebastian Haase) Date: Thu, 5 Aug 2004 14:32:02 -0700 Subject: [SciPy-user] pyPlot.py vs. Gnuplot.py In-Reply-To: References: Message-ID: <200408051432.02305.haase@msg.ucsf.edu> Hi Matt, In case you mean the plt module from scipy (is that now called pyPlot !?) I ran into exactly the same error message ('destroyed object...') maybe already a year ago. At the time I found this fix/hack somewhere (don't remember who BEC is ...) Here is the diff of wxplt.py old vs. new 627d626 < wx.EVT_CLOSE(self, self.OnCloseWindow) #added by BEC 750,753d748 < < #added by BEC. I don't know if this is the correct action for closing the plot window...bu it works. < def OnCloseWindow(self, event): < self.Show(0) (Essentially these line go inside of class plot_frame(wx.wxFrame)) Let me know if this helped... Sebastian Haase On Thursday 05 August 2004 01:19 pm, Matt Kubilus wrote: > Another new user commenting. > > I found that pyPlot was less reliable than gnuplot and had less features. > > For instance, with the wx based pyPlot, once I closed a window with a plot > in my wx based application, I could no longer open the graph. The C object > has already been destroyed was the error in a nut shell. Restarting the > application was the only workaround. Has anyone else ran into, fixed a > similar problem. > > Gnuplot is also able to do interesting things like 3d plots (not necessary > for what I use it for) > > I use this in a manufacturing/data gathering setting. > > --Matt Kubilus > > >From: Alan G Isaac > >Reply-To: aisaac at american.edu,SciPy Users List > >To: gnuplot-py-users at lists.sourceforge.net,scipy-user > > > >Subject: [SciPy-user] pyPlot.py vs. Gnuplot.py > >Date: Tue, 3 Aug 2004 16:23:12 -0400 (Eastern Daylight Time) > > > >As a new SciPy user, I am interested in understanding > >the relationship between the scipy.gplt module and the > >Gnuplot.py project. > > > >What considerations influence which was chosen, and > >which a new user should choose? > > > >This is especially important to me as I am planning > >to use one of these in a teaching setting. > > > >Thank you, > >Alan Isaac > > > > > >_______________________________________________ > >SciPy-user mailing list > >SciPy-user at scipy.net > >http://www.scipy.net/mailman/listinfo/scipy-user > > _________________________________________________________________ > Discover the best of the best at MSN Luxury Living. http://lexus.msn.com/ > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From aisaac at american.edu Thu Aug 5 00:37:31 2004 From: aisaac at american.edu (Alan G Isaac) Date: Thu, 5 Aug 2004 00:37:31 -0400 (Eastern Daylight Time) Subject: [SciPy-user] scipy choice of defaults for matrix manipulation In-Reply-To: <41115E1D.4010205@ucsd.edu> References: <41115E1D.4010205@ucsd.edu> Message-ID: Alan wrote: >> The SciPy documentation says: >> To begin with, all of the Numeric functions have >> been subsumed into the scipy namespace so that all >> of those functions are available without >> additionally importing Numeric. >> It was therefore unsettling to find that SciPy's function_base defines >> def cumsum(m,axis=-1): >> """Returns the cumulative sum of the elements along the given axis >> """ >> if axis is None: >> m = ravel(m) >> axis = 0 >> else: >> m = _asarray1d(m) >> return add.accumulate(m,axis) >> This changes the default axis of Numeric and numarray. >> Bug or feature?? On Wed, 04 Aug 2004, Robert Kern apparently wrote: > Implementation feature; documentation bug. Numeric's functions have > various, inconsistent ("schizophrenic" as you say) choices for the > default axis. An attempt, albeit incomplete as you note, was made with > SciPy to standardize on always using axis=-1. I'm fairly positive this > was documented somewhere at some point, but probably only on the old > website. The tutorial really should be updated to prominently note this > convention. Looking at briefly at Numeric and numarray, it seems they have made an effort to standardize on axis=0. This is also true in the Matlab module. Wouldn't it be wise for SciPy to join the parade? (I.e., shouldn't these closely related and interdependent packages share a convention? Otherwise, this is going to be VERY confusing for users. (As it was for me.) Now when I call a such a function, I have to remember: is it a SciPy function, or a Numeric/numarray function? Not a good situation, right? Thanks, Alan From aisaac at american.edu Thu Aug 5 20:12:50 2004 From: aisaac at american.edu (Alan G Isaac) Date: Thu, 5 Aug 2004 20:12:50 -0400 (Eastern Daylight Time) Subject: [SciPy-user] Re: plot_func In-Reply-To: References: Message-ID: On Thu, 05 Aug 2004, Matt Kubilus apparently wrote: > I hacked into the pyPlot.py > module and added a function that essentially just sends a command to the > hidden function that actually calls the plotting routines. This allowed me > to use the full functionality of gnuplot which can to way more than just > what scipy.gplt does. Yes, I did the same. To pyPlot.py I added: def replot(self,cmd=''): self._replot(cmd) To interface.py I added: def replot(cmd=''): _validate_active() _active.replot(cmd) This seems to work fine. (Clue me in if it is a bad approach.) BUT Since I want to use SciPy in teaching, this is really pointless unless the developers say they will implement it. I cannot ask students to do such things: they need to use the software as downloaded. Clearly users want this. Can we hear from a developer please? Or can someone tell me if there is a process for submitting such changes. Thank you, Alan Isaac From rkern at ucsd.edu Thu Aug 5 21:26:39 2004 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 05 Aug 2004 20:26:39 -0500 Subject: [SciPy-user] scipy choice of defaults for matrix manipulation In-Reply-To: References: <41115E1D.4010205@ucsd.edu> Message-ID: <4112DE4F.7060008@ucsd.edu> Alan G Isaac wrote: [snip] > Looking at briefly at Numeric and numarray, it seems they > have made an effort to standardize on axis=0. No, they don't. It's a fairly even mix of axis=0 and axis=-1. > This is also > true in the Matlab module. Wouldn't it be wise for SciPy > to join the parade? Not at this time. There's too much SciPy code that would need to be rewritten, namely SciPy itself. The axis=-1 convention will be staying. > (I.e., shouldn't these closely related > and interdependent packages share a convention? > Otherwise, this is going to be VERY confusing for users. > (As it was for me.) Now when I call a such a function, > I have to remember: is it a SciPy function, or a > Numeric/numarray function? Well, if it's SciPy, axis=-1 almost always (the deviations usually being the functions which shadow Numeric functions). If it's Numeric, you also have to remember if it's axis=0 or axis=-1. If it's numarray, then you have other problems since SciPy is currently all-Numeric. The real question you have to ask yourself when coding is "did SciPy overwrite this Numeric function?", a question that needs to be asked for reasons other than the choice of default axis. I would also note that having a terminal running IPython is invaluable when coding. The ? and ?? magic is usually better than a reference manual. > Not a good situation, right? It's arguable that SciPy functions which shadow Numeric functions should have the same defaults. It is also arguable that SciPy functions should be internally consistent, so when a Numeric function is overwritten (to add genericity or whatever) it should follow the SciPy convention. Neither choice has been rigorously implemented although after I poked around in IPython for a minute or two, cumsum() appears to be the only deviation from the first option. This might qualify as a bug. > Thanks, > Alan -- 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 Thu Aug 5 23:05:57 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 05 Aug 2004 21:05:57 -0600 Subject: [SciPy-user] scipy choice of defaults for matrix manipulation In-Reply-To: References: <41115E1D.4010205@ucsd.edu> Message-ID: <4112F595.4050007@ee.byu.edu> Alan G Isaac wrote: >Looking at briefly at Numeric and numarray, it seems they >have made an effort to standardize on axis=0. This is also >true in the Matlab module. Wouldn't it be wise for SciPy >to join the parade? (I.e., shouldn't these closely related >and interdependent packages share a convention? >Otherwise, this is going to be VERY confusing for users. >(As it was for me.) Now when I call a such a function, >I have to remember: is it a SciPy function, or a >Numeric/numarray function? Not a good situation, right? > > This is only true for some functions, others have axis=-1. SciPy came before numarray and we tried to standardize the Numeric functions. The vision of SciPy is that you would have no need to call a Numeric function. You would always call the SciPy function. We have been trying to standardize on axis=-1 to prevent this very confusion you are having. The existence of numarray is actually confusing the situation, because numarray is more than just an array object it is also re-inventing several of the array operations that are already in SciPy. At this point you should ignore the MATLAB module as it is completely obsolete and is a way watered-down version of what SciPy is becoming. This is fragmenting the community and is not a good thing in my opinion. You may make a case for which standard is appropriate but the axis=-1 was decided on after some deliberation. It is open for discussion. -Travis O. From bulatov at cs.orst.edu Fri Aug 6 01:16:05 2004 From: bulatov at cs.orst.edu (bulatov at cs.orst.edu) Date: Thu, 5 Aug 2004 22:16:05 -0700 Subject: [SciPy-user] vectorize question Message-ID: <1091769365.411314157541a@webmail.oregonstate.edu> What's the best way to evaluate a function at every point of a space (ie, for plotting purposes)? For instance, here's how I'd do it in regular python values=zeros((5,5), Float) for i in range(5): for j in range(5): values[i,j]=some_custom_function(i,j) plot(values) Is there some SciPy way of doing it more concisely? I looked at vectorize, but I can only use it for similar task in 1 dimension. Yaroslav From oliphant at ee.byu.edu Fri Aug 6 02:00:08 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Fri, 06 Aug 2004 00:00:08 -0600 Subject: [SciPy-user] vectorize question In-Reply-To: <1091769365.411314157541a@webmail.oregonstate.edu> References: <1091769365.411314157541a@webmail.oregonstate.edu> Message-ID: <41131E68.8020308@ee.byu.edu> bulatov at cs.orst.edu wrote: >What's the best way to evaluate a function at every point of a space (ie, for >plotting purposes)? > >For instance, here's how I'd do it in regular python > >values=zeros((5,5), Float) >for i in range(5): > for j in range(5): > values[i,j]=some_custom_function(i,j) >plot(values) > >Is there some SciPy way of doing it more concisely? I looked at vectorize, but I >can only use it for similar task in 1 dimension. > > > Use ogrid (open grid) and If your function is made up of ufuncs it should vectorize automatically, otherwise you use vectorize. Example: i,j = ogrid[0:5,0:5] (or mgrid if you really want to fill out the values) If some_custom_function is made up only of ufuncs values = some_custom_function(i,j) otherwise new_custom_function = vectorize(some_custom_function) values = new_custom_funcion(i,j) -Travis O. From nwagner at mecha.uni-stuttgart.de Fri Aug 6 02:22:46 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Fri, 06 Aug 2004 08:22:46 +0200 Subject: [SciPy-user] FAIL: check_lpmn (scipy.special.basic.test_basic.test_lpmn) Message-ID: <411323B6.6010706@mecha.uni-stuttgart.de> scipy.test() with latest cvs ====================================================================== FAIL: check_lpmn (scipy.special.basic.test_basic.test_lpmn) ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/scipy/special/tests/test_basic.py", line 1625, in check_lpmn 1.50000]])),4) 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 66.6666666667%): Array 1: [[ [ 1. 0. 0.]] [ [ 0. 0. 0.]]] Array 2: [[ [ 1. 0.5 -0.125]] [ [ 0. 1. 1.5 ]]] ---------------------------------------------------------------------- Ran 936 tests in 2.826s FAILED (failures=1) From aisaac at american.edu Fri Aug 6 11:20:39 2004 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 6 Aug 2004 11:20:39 -0400 (Eastern Daylight Time) Subject: [SciPy-user] scipy choice of defaults for matrix manipulation In-Reply-To: <4112F595.4050007@ee.byu.edu> References: <41115E1D.4010205@ucsd.edu> <4112F595.4050007@ee.byu.edu> Message-ID: On Thu, 05 Aug 2004, Travis Oliphant apparently wrote: > This is fragmenting the community and is not a good thing in my > opinion. You may make a case for which standard is appropriate but the > axis=-1 was decided on after some deliberation. It is open for discussion. Allow me one last comment on this: It was important to know who was deliberating: engineers, economists, statistitians, etc. To illustrate: in numarray (which seeks Numeric compatibility) we find axis=-1: all of fft stuff sort, argsort, argmin, argmax, trapz, diff axis=0: all of the linear algebra stuff (except diff in mlab.py, which numarray no longer documents) along with repeat, concatenate, compress, reduce, accumulate, average, take, alltrue, sometrue, zreduce, areduce, put I hazard the the linear algebra stuff is the most commonly used module. In the econometrics community, data series are by far most often characterized as columns of a 2D array, and the numarray defaults in the linear algebra module seem natural to us. Since scipy plans sensibly to rely on Numeric and then numarray, it just does not seem workable to use different defaults. This will create widespread confusion. I would urge that the scipy and numarray developers hash this out. But in the meantime, I hope the scipy developers will emphasize compatibility of the default behavior of imported functions. If the axis question seems pressing, good simplicity could be achieved here as follows. For sort, argsort, argmin, argmax, trapz, diff *require* an axis argument, and document this prominently. (Also, lean on the numarray folks to change the defaults behavior of these.) For everything else, use the numarray defaults. The bottom line question is: is it really tenable for users to know that scipy relies of Numeric/numarray while adopting different default behavior? I believe not. Here is an additional consideration: the numarray folks are producing pretty decent documentation, and SciPy will be able to rely on that instead of producing its own documentation for the same functions. Time is scarce. Thanks for thinking about this. I will shut up now. Alan Isaac From aisaac at american.edu Fri Aug 6 13:45:17 2004 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 6 Aug 2004 13:45:17 -0400 (Eastern Daylight Time) Subject: [SciPy-user] pyGAUSS Message-ID: Those familiar with the GAUSS programming language may find this useful. (Requires SciPy.) http://www.american.edu/econ/pytrix/pyGAUSS.py It's just a few of my most often used GAUSS commands at this point, but I plan to add to the list. Not that sumc, cumsumc, prodc, and cumprodc always have axis=0. (So those reading this list can guess why I wrote them ;). Comments and contributions welcome. fwiw, Alan Isaac From lanceboyle at cwazy.co.uk Fri Aug 6 19:24:11 2004 From: lanceboyle at cwazy.co.uk (Lance Boyle) Date: Fri, 6 Aug 2004 16:24:11 -0700 Subject: [SciPy-user] Quick and Dirty gnuplot In-Reply-To: References: Message-ID: This talk of gnuplot reminded me of this gem: http://ndevilla.free.fr/gnuplot/gnuplot.py I modified it a bit to work with the excellent AquaTerm on Mac OS X: import os class gnuplot: def __init__(self): print "opening new gnuplot session..." self.session = os.popen("gnuplot","w") def __del__(self): print "closing gnuplot session..." self.session.close() def send(self, cmd): self.session.write(cmd+'\n') self.session.flush() if __name__=="__main__": g1 = gnuplot() g1.send("set terminal aqua 0") # Your code here g1.send("plot sin(x)") del g1 From bulatov at cs.orst.edu Mon Aug 9 05:39:59 2004 From: bulatov at cs.orst.edu (bulatov at cs.orst.edu) Date: Mon, 9 Aug 2004 02:39:59 -0700 Subject: [SciPy-user] fmin_l_bfgs_b problem In-Reply-To: <20040805142839.A085E3EB70@www.scipy.com> References: <20040805142839.A085E3EB70@www.scipy.com> Message-ID: <1092044399.4117466f50c9e@webmail.oregonstate.edu> Was anyone able to use fmin_l_bfgs_b optimizer successfully? When I run it with the same parameters as the fmin_bfgs example in the tutorial, I get the error: xopt = fmin_l_bfgs_b(log_likelihood, x0, fprime=log_likelihood_der) File "C:\Python23\Lib\site-packages\scipy\optimize\lbfgsb.py", line 174, in fm in_l_bfgs_bisave, dsave) error: failed in converting 7th argument `g' of _lbfgsb.setulb to C/Fortran array BTW, are there searchable archives of this list somewhere? Yaroslav From travis at enthought.com Mon Aug 9 06:59:12 2004 From: travis at enthought.com (Travis N. Vaught) Date: Mon, 09 Aug 2004 05:59:12 -0500 Subject: [SciPy-user] fmin_l_bfgs_b problem In-Reply-To: <1092044399.4117466f50c9e@webmail.oregonstate.edu> References: <20040805142839.A085E3EB70@www.scipy.com> <1092044399.4117466f50c9e@webmail.oregonstate.edu> Message-ID: <41175900.1060905@enthought.com> bulatov at cs.orst.edu wrote: > > > BTW, are there searchable archives of this list somewhere? > > Yaroslav > There's a search form at the bottom of the mailing list page at scipy.org: http://www.scipy.org/mailinglists/ Travis V. From david.grant at telus.net Mon Aug 9 13:32:45 2004 From: david.grant at telus.net (David Grant) Date: Mon, 09 Aug 2004 10:32:45 -0700 Subject: [SciPy-user] scipy crashing on Message-ID: <4117B53D.7080805@telus.net> Has there been any progress made on fixing the following bugs? Which are all basically dupes as far as I can tell: http://www.scipy.net/roundup/scipy/issue178 http://www.scipy.net/roundup/scipy/issue163 http://www.scipy.net/roundup/scipy/issue138 I'm really desperate for any workaround...or any possible reasons (specific to my system) which may be the culprit. Thanks, David From david.grant at telus.net Mon Aug 9 13:40:15 2004 From: david.grant at telus.net (David J. Grant) Date: Mon, 9 Aug 2004 10:40:15 -0700 Subject: [SciPy-user] scipy crashing on In-Reply-To: <4117B53D.7080805@telus.net> References: <4117B53D.7080805@telus.net> Message-ID: <1092073215.4117b6ff79ddd@webmail.telus.net> Looks like I found the culprit. I was using Numarray 1.0. I switched to Numeric 23.1, it didn't fix anything at first, but then I re-installed scipy 3.0 so that everything would get re-compiled. That fixed it. Maybe someone can close these bugs, or ask the reporter to installer Numeric instead of Numarray David Quoting David Grant : > Has there been any progress made on fixing the following bugs? Which > are all basically dupes as far as I can tell: > > http://www.scipy.net/roundup/scipy/issue178 > http://www.scipy.net/roundup/scipy/issue163 > http://www.scipy.net/roundup/scipy/issue138 > > I'm really desperate for any workaround...or any possible reasons > (specific to my system) which may be the culprit. > > Thanks, > David > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From cookedm at physics.mcmaster.ca Mon Aug 9 20:56:05 2004 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Mon, 9 Aug 2004 20:56:05 -0400 Subject: [SciPy-user] fmin_l_bfgs_b problem In-Reply-To: <1092044399.4117466f50c9e@webmail.oregonstate.edu> References: <20040805142839.A085E3EB70@www.scipy.com> <1092044399.4117466f50c9e@webmail.oregonstate.edu> Message-ID: <20040810005605.GA10221@arbutus.physics.mcmaster.ca> On Mon, Aug 09, 2004 at 02:39:59AM -0700, bulatov at cs.orst.edu wrote: > Was anyone able to use fmin_l_bfgs_b optimizer successfully? Well, I wrote the wrapper, so I hope so :-) > When I run it with the same parameters as the fmin_bfgs example in the tutorial, > I get the error: > > xopt = fmin_l_bfgs_b(log_likelihood, x0, fprime=log_likelihood_der) > File "C:\Python23\Lib\site-packages\scipy\optimize\lbfgsb.py", line 174, in fm > in_l_bfgs_bisave, dsave) > error: failed in converting 7th argument `g' of _lbfgsb.setulb to C/Fortran > array Are you sure log_likelihood_der returns an array (of the same length as x0)? -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From bulatov at cs.orst.edu Tue Aug 10 04:59:57 2004 From: bulatov at cs.orst.edu (bulatov at cs.orst.edu) Date: Tue, 10 Aug 2004 01:59:57 -0700 Subject: [SciPy-user] fmin_l_bfgs_b problem In-Reply-To: <20040809175902.BFF113EB62@www.scipy.com> References: <20040809175902.BFF113EB62@www.scipy.com> Message-ID: <1092128397.41188e8daa265@webmail.oregonstate.edu> > On Mon, Aug 09, 2004 at 02:39:59AM -0700, bulatov at cs.orst.edu wrote: > > Was anyone able to use fmin_l_bfgs_b optimizer successfully? > > Well, I wrote the wrapper, so I hope so :-) > > > When I run it with the same parameters as the fmin_bfgs example in the tutorial, > > I get the error: > > > > xopt = fmin_l_bfgs_b(log_likelihood, x0, fprime=log_likelihood_der) > > File "C:\Python23\Lib\site-packages\scipy\optimize\lbfgsb.py", line 174, in fm > > in_l_bfgs_bisave, dsave) > > error: failed in converting 7th argument `g' of _lbfgsb.setulb to C/Fortran > > array > > > Are you sure log_likelihood_der returns an array (of the same length as x0)? I found the problem :) Log_likelihood_der returned Numarray array instead of Numeric array. That happened because I couldn't find "zeros" function in SciPy, so I used numarray.zeros to initialize array. When I changed numarray.zeros to Numeric.zeros, problem was fixed. For the future...how do I debug these kinds of problems? I looked in lbfgs.pyf, but couldn't quite understand why Numeric arrays were required Yaroslav From Bob.Cowdery at CGI-Europe.com Tue Aug 10 11:04:37 2004 From: Bob.Cowdery at CGI-Europe.com (Bob.Cowdery at CGI-Europe.com) Date: Tue, 10 Aug 2004 16:04:37 +0100 Subject: [SciPy-user] Weave problems Message-ID: <9B40DB5FBF7D2048AD79C2A91F862A517730C0@STEVAPPS05.Stevenage.CGI-Europe.com> Hi all, I have a serious problem with Weave. I raised it before - the last time I put some in-line code in but managed to work round it by compiling outside the main application. I have now put some more in-line code in and I am back to the same problem and can't seem to shake it off this time. When I try to run my application two things happen. I get a stream of exceptions - Exception exceptions.RuntimeError: 'maximum recursion depth exceeded' in > ignored and then have to terminate my application with task manager. Having done that I am left with wgnuplot.exe and gnuplot_helper.exe between them taking 100% CPU and I have to kill those off as well. I don't use either of those programs, so where on earth are they coming from. I don't even know where to start looking for this one and would really appreciate some help. Thanks Bob Bob Cowdery CGI Senior Technical Architect +44(0)1438 791517 Mobile: +44(0)7771 532138 bob.cowdery at cgi-europe.com *** Confidentiality Notice *** Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -------------- next part -------------- An HTML attachment was scrubbed... URL: From loredo at astro.cornell.edu Tue Aug 10 12:54:30 2004 From: loredo at astro.cornell.edu (Tom Loredo) Date: Tue, 10 Aug 2004 12:54:30 -0400 (EDT) Subject: [SciPy-user] Problems building SciPy-0.3 on OS X Message-ID: <200408101654.i7AGsUL03040@laplace.astro.cornell.edu> Hi folks- I'm trying to build SciPy-0.3 on a G4 (and on a G3 laptop) running 10.2.8 and MacPy 2.3.3, but with no luck---the build halts with a segfault. I've followed Chris's instructions on the scipy web site, with the exception of not installing Gnuplot & AquaTerm. The one possible complication is that I have some fink stuff installed (not python, though), including f77, but I've renamed it f77-fink, and verified that there is no f77 in my path (the g77 install doesn't install one, so I was worried scipy or f2py might find Fink's f77 rather than using g77). On every first install attempt, I get an error compiling _configtest.c, from code in the included file fputest.c. If I merely restart the build after the error, the build proceeds through this part successfully, but perhaps this is an important symptom. Here's the output from the first build attempt: compiling '_configtest.c': #define FPU_DIGITAL #define CONFIG_SCRIPT #include "fputest.c" gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-I/Users/loredo/Python/SciPy_complete-0.3/build/temp.darwin-6.8-Power_Macintosh-2.3/config_pygist -I/Users/loredo/Python/SciPy_complete-0.3/Lib/xplt/src/play -c' gcc: _configtest.c In file included from fputest.c:10, from _configtest.c:3: fpuset.c:27:27: machine/fpu.h: No such file or directory In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:45: warning: implicit declaration of function `ieee_set_fp_control' fpuset.c:45: `IEEE_TRAP_ENABLE_INV' undeclared (first use in this function) fpuset.c:45: (Each undeclared identifier is reported only once fpuset.c:45: for each function it appears in.) fpuset.c:45: `IEEE_TRAP_ENABLE_DZE' undeclared (first use in this function) fpuset.c:46: `IEEE_TRAP_ENABLE_OVF' undeclared (first use in this function) [snip many lines] removing: _configtest.c _configtest.o compiling '_configtest.c': #define FPU_SUN4 #define CONFIG_SCRIPT #include "fputest.c" gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes' compile options: '-I/Users/loredo/Python/SciPy_complete-0.3/build/temp.darwin-6.8-Power_Macintosh-2.3/config_pygist -I/Users/loredo/Python/SciPy_complete-0.3/Lib/xplt/src/play -c' gcc: _configtest.c In file included from fputest.c:10, from _configtest.c:3: fpuset.c: In function `u_fpu_setup': fpuset.c:133: warning: implicit declaration of function `nonstandard_arithmetic' fpuset.c:134: warning: implicit declaration of function `ieee_handler' Traceback (most recent call last): File "setup.py", line 110, in ? setup_package(ignore_packages) File "setup.py", line 83, in setup_package ignore_packages = ignore_packages) File "scipy_core/scipy_distutils/misc_util.py", line 459, in get_subpackages config = setup_module.configuration(*args) File "/Users/loredo/Python/SciPy_complete-0.3/Lib/xplt/setup_xplt.py", line 210, in configuration conf.run() File "/Users/loredo/Python/SciPy_complete-0.3/Lib/xplt/config_pygist.py", line 64, in run self.config_unix() File "/Users/loredo/Python/SciPy_complete-0.3/Lib/xplt/config_pygist.py", line 193, in config_unix self.find_sigfpe(configfile) File "/Users/loredo/Python/SciPy_complete-0.3/Lib/xplt/config_pygist.py", line 311, in find_sigfpe include_dirs=self.unix_include_dirs): File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/command/config.py", line 260, in try_link libraries, library_dirs, lang) File "/Users/loredo/Python/SciPy_complete-0.3/Lib/xplt/config_pygist.py", line 28, in _link library_dirs=library_dirs) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/ccompiler.py", line 860, in link_executable debug, extra_preargs, extra_postargs, None, target_lang) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/unixccompiler.py", line 153, in link libraries) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/distutils/ccompiler.py", line 1249, in gen_lib_options (lib_dir, lib_name) = os.path.split (lib) File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/posixpath.py", line 77, in split i = p.rfind('/') + 1 AttributeError: 'NoneType' object has no attribute 'rfind' As I said, merely running "python setup.py build" again continues the build without complaint, starting: fftw_info: FOUND: libraries = ['rfftw', 'fftw'] library_dirs = ['/usr/local/lib'] define_macros = [('SCIPY_FFTW_H', None)] include_dirs = ['/usr/local/include'] etc.. But it eventually halts with a segfault working on cblas: f2py: build/src/cblas.pyf Reading fortran codes... Reading file 'build/src/cblas.pyf' Post-processing... Block: cblas Block: empty_module Building modules... Building module "cblas"... Constructing wrapper function "empty_module"... empty_module() Wrote C/API module "cblas" to file "build/src/build/src/cblasmodule.c" adding 'build/src/fortranobject.c' to sources. adding 'build/src' to include_dirs. building extension "scipy.linalg.flapack" sources generating flapack interface Segmentation fault Any help anyone can offer on how to diagnose this would be appreciated. Thanks, Tom From pearu at scipy.org Tue Aug 10 14:22:14 2004 From: pearu at scipy.org (Pearu Peterson) Date: Tue, 10 Aug 2004 13:22:14 -0500 (CDT) Subject: [SciPy-user] Problems building SciPy-0.3 on OS X In-Reply-To: <200408101654.i7AGsUL03040@laplace.astro.cornell.edu> References: <200408101654.i7AGsUL03040@laplace.astro.cornell.edu> Message-ID: On Tue, 10 Aug 2004, Tom Loredo wrote: > I'm trying to build SciPy-0.3 on a G4 (and on a G3 laptop) running 10.2.8 > and MacPy 2.3.3, but with no luck---the build halts with a segfault. I've > followed Chris's instructions on the scipy web site, with the exception of > not installing Gnuplot & AquaTerm. The one possible complication is that I > have some fink stuff installed (not python, though), including f77, but > I've renamed it f77-fink, and verified that there is no f77 in my path > (the g77 install doesn't install one, so I was worried scipy or f2py might > find Fink's f77 rather than using g77). > > On every first install attempt, I get an error compiling _configtest.c, > from code in the included file fputest.c. If I merely restart the build > after the error, the build proceeds through this part successfully, but > perhaps this is an important symptom. Here's the output from the first > build attempt: > > compiling '_configtest.c': > File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/posixpath.py", line 77, in split > i = p.rfind('/') + 1 > AttributeError: 'NoneType' object has no attribute 'rfind' > > As I said, merely running "python setup.py build" again continues the build without > complaint, starting: > > fftw_info: > FOUND: > libraries = ['rfftw', 'fftw'] > library_dirs = ['/usr/local/lib'] > define_macros = [('SCIPY_FFTW_H', None)] > include_dirs = ['/usr/local/include'] > > etc.. But it eventually halts with a segfault working on cblas: > > f2py: build/src/cblas.pyf > Reading fortran codes... > Reading file 'build/src/cblas.pyf' > Post-processing... > Block: cblas > Block: empty_module > Building modules... > Building module "cblas"... > Constructing wrapper function "empty_module"... > empty_module() > Wrote C/API module "cblas" to file "build/src/build/src/cblasmodule.c" > adding 'build/src/fortranobject.c' to sources. > adding 'build/src' to include_dirs. > building extension "scipy.linalg.flapack" sources > generating flapack interface > Segmentation fault > > Any help anyone can offer on how to diagnose this would be appreciated. Hmm, the segfault appears while executing pure Python code. I would disable building xplt for now. To do that, add 'xplt' to the ignore_packages list at the end of setup.py file. And then try 'python setup.py build' again. Also, I'd suggest using CVS version of scipy and scipy_distutils when experiencing such build problems. HTH, Pearu From loredo at astro.cornell.edu Tue Aug 10 15:11:08 2004 From: loredo at astro.cornell.edu (Tom Loredo) Date: Tue, 10 Aug 2004 15:11:08 -0400 (EDT) Subject: [SciPy-user] Problems building SciPy-0.3 on OS X Message-ID: <200408101911.i7AJB8103219@laplace.astro.cornell.edu> Hi Pearu- Thanks for the help. > Hmm, the segfault appears while executing pure Python code. Yes. By the admittedly crude approach of inserting lots of print statements, I've determined that it happens in "all_subroutines" in Lib/linalg/interface_gen.py: def all_subroutines(interface_in): # remove comments comment_block_exp = re.compile(r'/\*(?:\s|.)*?\*/') subroutine_exp = re.compile(r'subroutine (?:\s|.)*?end subroutine.*') function_exp = re.compile(r'function (?:\s|.)*?end function.*') print '***** Compiled regexps...' print '***** stripping comments...' interface = comment_block_exp.sub('',interface_in) print '***** finding subrs...' print interface subroutine_list = subroutine_exp.findall(interface) print '***** finding functions...' function_list = function_exp.findall(interface) print '***** concatenating...' subroutine_list = subroutine_list + function_list print '***** stripping...' subroutine_list = map(lambda x: string.strip(x),subroutine_list) return subroutine_list The fault occurs while finding the subroutines via "subroutine_exp.findall(interface)". I've printed out "interface" (too long to post here) and there is nothing obvious wrong with it, but I don't really know what to expect. In years of using Python, this is the first segfault I've seen running a builtin or library module! > Also, I'd suggest using CVS version of scipy Yes, I was afraid you'd suggest this. I'm developing a public package, and a frequent comment from potential users is that they don't want to have to deal with CVS---they would ideally just want an RPM, though I think they'll live with a setup.py. The CVS barrier is admittedly small in scipy's case, but every barrier cuts off another layer of possible users. The latest "official" build really should build on all the major platforms. My own obstacle is that at work I'm on a linux machine; the Mac is at home on a dialup connection. So CVS stuff is slow. But in this case I copied the linux machine's scipy directory via a flash drive to the Mac, and then did a CVS to update it (thus avoiding checking out the whole thing via my modem). The exact same errors happen using today's version on CVS. > I would disable building xplt for now. To do that, add 'xplt' to the > ignore_packages list at the end of setup.py file. And then try 'python > setup.py build' again. I tried that with the CVS version. No go, same problem: building extension "scipy.linalg.cblas" sources adding 'build/src/scipy/linalg/cblas.pyf' to sources. adding 'build/src/fortranobject.c' to sources. adding 'build/src' to include_dirs. building extension "scipy.linalg.flapack" sources generating flapack interface Segmentation fault I've again inserted print statements and verified that the segfault is happening in the same place (using the subroutine_exp regexp). This regexp works fine on earlier modules. Is the earlier error (AttributeError: 'NoneType' object has no attribute 'rfind') perhaps a clue I'm overlooking (i.e., something is not getting set up on that first build attempt, and is getting overlooked on the 2nd attempt)? Help! -Tom From pearu at scipy.org Tue Aug 10 15:55:02 2004 From: pearu at scipy.org (Pearu Peterson) Date: Tue, 10 Aug 2004 14:55:02 -0500 (CDT) Subject: [SciPy-user] Problems building SciPy-0.3 on OS X In-Reply-To: <200408101911.i7AJB8103219@laplace.astro.cornell.edu> References: <200408101911.i7AJB8103219@laplace.astro.cornell.edu> Message-ID: On Tue, 10 Aug 2004, Tom Loredo wrote: > > Hmm, the segfault appears while executing pure Python code. > > Yes. By the admittedly crude approach of inserting lots of print > statements, I've determined that it happens in "all_subroutines" in > Lib/linalg/interface_gen.py: > > def all_subroutines(interface_in): > # remove comments > comment_block_exp = re.compile(r'/\*(?:\s|.)*?\*/') > subroutine_exp = re.compile(r'subroutine (?:\s|.)*?end subroutine.*') > function_exp = re.compile(r'function (?:\s|.)*?end function.*') > print '***** Compiled regexps...' > > print '***** stripping comments...' > interface = comment_block_exp.sub('',interface_in) > print '***** finding subrs...' > print interface > subroutine_list = subroutine_exp.findall(interface) > print '***** finding functions...' > function_list = function_exp.findall(interface) > print '***** concatenating...' > subroutine_list = subroutine_list + function_list > print '***** stripping...' > subroutine_list = map(lambda x: string.strip(x),subroutine_list) > return subroutine_list > > The fault occurs while finding the subroutines via "subroutine_exp.findall(interface)". > I've printed out "interface" (too long to post here) and there is nothing obvious > wrong with it, but I don't really know what to expect. In years of using Python, > this is the first segfault I've seen running a builtin or library module! Could you try running setup.py with different version of Python? Also try saving "interface" string to a file, then from a fresh Python session load the string, and apply subroutine_exp.findall to it. Will Python crash also then? > > Also, I'd suggest using CVS version of scipy > > Yes, I was afraid you'd suggest this. I'm developing a public package, and > a frequent comment from potential users is that they don't want to have to > deal with CVS---they would ideally just want an RPM, though I think they'll > live with a setup.py. The CVS barrier is admittedly small in scipy's case, > but every barrier cuts off another layer of possible users. The latest > "official" build really should build on all the major platforms. I agree. The problem is that currently I don't have access to OSX machines and therefore it is rather difficult to guarantee that the scipy build will work on OSX. I hope that someone having OSX 10.2 could look into this issue and find the cause to these errors. > > I would disable building xplt for now. To do that, add 'xplt' to the > > ignore_packages list at the end of setup.py file. And then try 'python > > setup.py build' again. > > I tried that with the CVS version. No go, same problem: > > building extension "scipy.linalg.cblas" sources > adding 'build/src/scipy/linalg/cblas.pyf' to sources. > adding 'build/src/fortranobject.c' to sources. > adding 'build/src' to include_dirs. > building extension "scipy.linalg.flapack" sources > generating flapack interface > Segmentation fault > > I've again inserted print statements and verified that the segfault is > happening in the same place (using the subroutine_exp regexp). This > regexp works fine on earlier modules. > > Is the earlier error (AttributeError: 'NoneType' object has no attribute 'rfind') > perhaps a clue I'm overlooking (i.e., something is not getting set up on that > first build attempt, and is getting overlooked on the 2nd attempt)? I believe that the two issues (the attribute error and the segfault) are not releated (upto possible bugs in Python, that's why I suggested to disable building xplt in the first place). Pearu From rkern at ucsd.edu Tue Aug 10 16:03:51 2004 From: rkern at ucsd.edu (Robert Kern) Date: Tue, 10 Aug 2004 15:03:51 -0500 Subject: [SciPy-user] Problems building SciPy-0.3 on OS X In-Reply-To: <200408101911.i7AJB8103219@laplace.astro.cornell.edu> References: <200408101911.i7AJB8103219@laplace.astro.cornell.edu> Message-ID: <41192A27.5060706@ucsd.edu> Tom Loredo wrote: > Hi Pearu- > > Thanks for the help. > > >>Hmm, the segfault appears while executing pure Python code. > > > Yes. By the admittedly crude approach of inserting lots of print > statements, I've determined that it happens in "all_subroutines" in > Lib/linalg/interface_gen.py: > > def all_subroutines(interface_in): > # remove comments > comment_block_exp = re.compile(r'/\*(?:\s|.)*?\*/') > subroutine_exp = re.compile(r'subroutine (?:\s|.)*?end subroutine.*') > function_exp = re.compile(r'function (?:\s|.)*?end function.*') > print '***** Compiled regexps...' > > print '***** stripping comments...' > interface = comment_block_exp.sub('',interface_in) > print '***** finding subrs...' > print interface > subroutine_list = subroutine_exp.findall(interface) > print '***** finding functions...' > function_list = function_exp.findall(interface) > print '***** concatenating...' > subroutine_list = subroutine_list + function_list > print '***** stripping...' > subroutine_list = map(lambda x: string.strip(x),subroutine_list) > return subroutine_list > > The fault occurs while finding the subroutines via "subroutine_exp.findall(interface)". > I've printed out "interface" (too long to post here) and there is nothing obvious > wrong with it, but I don't really know what to expect. In years of using Python, > this is the first segfault I've seen running a builtin or library module! If it's the regexp segfaulting, then it may just be an issue with MacPython 2.3.3 on Jaguar. I've never seen this problem with Apple's Python 2.3 on Panther. If you are using the same version of ATLAS on your Linux installations as your Macs? In that case, the *.pyf files in build/src/scipy/linalg ought to be the same, and you can just copy them over to the same location. Alternately, fink's python may work if you don't need to talk to the window server. Or upgrade to Panther. Or downgrade MacPython. >>Also, I'd suggest using CVS version of scipy > > > Yes, I was afraid you'd suggest this. I'm developing a public package, and > a frequent comment from potential users is that they don't want to have to > deal with CVS---they would ideally just want an RPM, though I think they'll > live with a setup.py. The CVS barrier is admittedly small in scipy's case, > but every barrier cuts off another layer of possible users. The latest > "official" build really should build on all the major platforms. Yeah, Mac support is marginal. I'm the only person at Enthought who develops on a Mac, and I'm only here for the summer. However, I will commit to making a SciPy.pkg sometime in the future. I will not commit myself to a timeframe right now, but I will do it unless someone beats me. I probably won't support Jaguar, however. [snip] > Is the earlier error (AttributeError: 'NoneType' object has no attribute 'rfind') > perhaps a clue I'm overlooking (i.e., something is not getting set up on that > first build attempt, and is getting overlooked on the 2nd attempt)? I doubt it. > Help! > > -Tom -- 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 loredo at astro.cornell.edu Tue Aug 10 17:46:05 2004 From: loredo at astro.cornell.edu (Tom Loredo) Date: Tue, 10 Aug 2004 17:46:05 -0400 (EDT) Subject: [SciPy-user] Problems building SciPy-0.3 on OS X Message-ID: <200408102146.i7ALk5903407@laplace.astro.cornell.edu> > Also try saving "interface" string to a file, then from a fresh Python > session load the string, and apply subroutine_exp.findall to it. Will > Python crash also then? Thanks for the suggestion. Here is the interface string, and a Python script that does the check: http://www.museweb.com/interface.txt http://www.museweb.com/check_re.py Running the script with MacPy 2.3.3 on 10.2.8 gives a segfault. Running it with /usr/bin/python works fine. I've also tried it on a Sun machine with python2.2.2 and a linux machine with 2.3.3 and it works fine on those, too. It appears this is a MacPy 2.3.3 bug (presumably in the re module). I will copy this info to Pythonmac-Sig in the hopes that Jack or someone else there can help. I posted the original problem there with no response yet. If anyone out there is running Jaguar, I'd appreciate it if you'd download the script and text and run it, and let us know if you get a segfault. Thanks, Tom From pearu at scipy.org Wed Aug 11 01:12:09 2004 From: pearu at scipy.org (Pearu Peterson) Date: Wed, 11 Aug 2004 00:12:09 -0500 (CDT) Subject: [SciPy-user] Problems building SciPy-0.3 on OS X In-Reply-To: <200408102146.i7ALk5903407@laplace.astro.cornell.edu> References: <200408102146.i7ALk5903407@laplace.astro.cornell.edu> Message-ID: On Tue, 10 Aug 2004, Tom Loredo wrote: > > > Also try saving "interface" string to a file, then from a fresh Python > > session load the string, and apply subroutine_exp.findall to it. Will > > Python crash also then? > > Thanks for the suggestion. Here is the interface string, and a Python > script that does the check: > > http://www.museweb.com/interface.txt > http://www.museweb.com/check_re.py > > Running the script with MacPy 2.3.3 on 10.2.8 gives a segfault. Running > it with /usr/bin/python works fine. I've also tried it on a Sun machine > with python2.2.2 and a linux machine with 2.3.3 and it works fine on those, > too. It appears this is a MacPy 2.3.3 bug (presumably in the re module). > I will copy this info to Pythonmac-Sig in the hopes that Jack or someone > else there can help. I posted the original problem there with no response > yet. Try using the old re module in check_re.py. For that replace import re with import pre as re in check_re.py. What happens? Pearu From scipy at zunzun.com Wed Aug 11 06:25:32 2004 From: scipy at zunzun.com (James R. Phillips) Date: Wed, 11 Aug 2004 06:25:32 -400 Subject: [SciPy-user] Weave problems References: <9B40DB5FBF7D2048AD79C2A91F862A517730C0@STEVAPPS05.Stevenage.CGI-Europe.com> Message-ID: <4119f41c7e32b1.37714847@mercury.sabren.com> > When I try to run my application two things happen. I get a > stream of exceptions - I had odd problems on Windows that require me to occasionally delete all of weave's temporary files and then compile 'int a;' in a python script using weave to kind of restart it. I wrote a batch file to do this, and run it whenever I get problems like these; 90% of the time they clear up for me and the other 10% are my syntax errors. > ...I am left with wgnuplot.exe and gnuplot_helper.exe > between them taking 100% CPU and I have to kill those off > as well. Find and delete these two files, that was my solution. No answer from the mailing list on that one. Randy Phillips http://zunzun.com From loredo at astro.cornell.edu Wed Aug 11 10:27:29 2004 From: loredo at astro.cornell.edu (Tom Loredo) Date: Wed, 11 Aug 2004 10:27:29 -0400 (EDT) Subject: [SciPy-user] Problems building SciPy-0.3 on OS X Message-ID: <200408111427.i7BERTY04198@laplace.astro.cornell.edu> > Try using the old re module in check_re.py. For that replace > > import re > > with > > import pre as re > > in check_re.py. What happens? That works! I didn't even know the pre module existed (it's not in the lib docs). So far only two people on pymac-sig have tried the script; it works for them but none of them are using 2.3.3 on 10.2.8. One is using 2.3.4, so I'll try updating to that. I have to build it from source so it'll have to wait till I can transfer the source archive from my linux box (with a broadband connection). Pearu, thanks for your help with this! -Tom From aisaac at american.edu Wed Aug 11 13:37:34 2004 From: aisaac at american.edu (Alan G Isaac) Date: Wed, 11 Aug 2004 13:37:34 -0400 (Eastern Daylight Time) Subject: [SciPy-user] ADF tests for time series econometrics Message-ID: I've posted simple ADF test code at http://www.american.edu/econ/pytrix/unitroot.py Cheers, Alan Isaac From elcorto at gmx.net Wed Aug 11 14:49:05 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Wed, 11 Aug 2004 20:49:05 +0200 (MEST) Subject: [SciPy-user] genetic algorithm examples References: <1091477822.15531.45.camel@localhost> Message-ID: <3678.1092250145@www35.gmx.net> > Hey, > Has anyone here used scipy.ga in a project? I'm trying to learn it but > I'm running into walls. I've tried checking with the documentation, but > all I can find is the api docs that are missing sorely needed > explanations. I'm trying to learn it by reading the code as we speak, > and I was hoping I might be able to look at someone else's code to > really understand how it all ties together. Thanks! > Hi I gave it up to understand how ga works scince there are literally no docs. I grabbed a book and started coding my own EA. bye steve -- All those who believe in psychokinesis raise my hand. - Steven Wright -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From elcorto at gmx.net Wed Aug 11 14:49:05 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Wed, 11 Aug 2004 20:49:05 +0200 (MEST) Subject: [SciPy-user] genetic algorithm examples References: <1091477822.15531.45.camel@localhost> Message-ID: <3678.1092250145@www35.gmx.net> > Hey, > Has anyone here used scipy.ga in a project? I'm trying to learn it but > I'm running into walls. I've tried checking with the documentation, but > all I can find is the api docs that are missing sorely needed > explanations. I'm trying to learn it by reading the code as we speak, > and I was hoping I might be able to look at someone else's code to > really understand how it all ties together. Thanks! > Hi I gave it up to understand how ga works scince there are literally no docs. I grabbed a book and started coding my own EA. bye steve -- All those who believe in psychokinesis raise my hand. - Steven Wright -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From elcorto at gmx.net Wed Aug 11 15:00:21 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Wed, 11 Aug 2004 21:00:21 +0200 (MEST) Subject: [SciPy-user] another gplt question References: Message-ID: <2726.1092250821@www35.gmx.net> > I have code that plots several traces on several plots. I found hold > and got that to work for plotting multiple traces on a plot. However, > I seem to have frequent issues with data from a previous plot ending up > on a subsequent plot in addition to the new data. Is there a way to > explicitly tell gplt that a plot is done and all subsequent plot > commands are for a new plot? It seems strange that there isn't an gplt > instance for each plot or something of that nature. > > -Matt > Hi If I got you right you want to have 5 e.g. plot windows with say 2 data curves (traces) in each. Maybe something like for i in range(5): figure() plot(....) # curve 1 hold('on') plot(....) # curve 2 can help. bye steve -- All those who believe in psychokinesis raise my hand. - Steven Wright -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From aisaac at american.edu Thu Aug 5 16:28:50 2004 From: aisaac at american.edu (Alan G Isaac) Date: Thu, 5 Aug 2004 16:28:50 -0400 (Eastern Daylight Time) Subject: [SciPy-user] Kronecker product kron(a,b) Message-ID: On Wed Sep 24 16:52:28 2003 Nils Wagner scipy-user at scipy.net wrote > There is another useful function which might be interesting for scipy, > the so-called Kronecker product of two matrices. > def kron(a,b): > if not a.iscontiguous(): > a = reshape(a, a.shape) > if not b.iscontiguous(): > b = reshape(b, b.shape) > o = outerproduct(a,b) > o.shape = a.shape + b.shape > return concatenate(concatenate(o, axis=1), axis=1) > It would be great, if this becomes a standard function in scipy. I agree. It the meantime, thanks for posting this. Apparently the numarray folks are thinking of including a kroneckerproduct function. Cheers, Alan Isaac From elcorto at gmx.net Wed Aug 11 15:30:14 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Wed, 11 Aug 2004 21:30:14 +0200 (MEST) Subject: [SciPy-user] fmin_l_bfgs_b problem References: <1092044399.4117466f50c9e@webmail.oregonstate.edu> Message-ID: <20197.1092252614@www35.gmx.net> > Was anyone able to use fmin_l_bfgs_b optimizer successfully? > When I run it with the same parameters as the fmin_bfgs example in the > tutorial, > I get the error: > > xopt = fmin_l_bfgs_b(log_likelihood, x0, fprime=log_likelihood_der) > File "C:\Python23\Lib\site-packages\scipy\optimize\lbfgsb.py", line 174, > in fm > in_l_bfgs_bisave, dsave) > error: failed in converting 7th argument `g' of _lbfgsb.setulb to > C/Fortran > array > > > BTW, are there searchable archives of this list somewhere? > Hi I used the method some time ago without probs like this (without a gradient routine though) fmin_l_bfgs_b(n,initial_guess,args=(t,y),approx_grad=True, bounds=limits,m=10,maxfun=niter,factr=100) with n beeing a scalar returning function, data arrays t and y, limits an list of lists [[lower, upper],[..,..],...]. Maybe there is a prob with your f2py (but this is really just a _quess_ :)) bye steve -- All those who believe in psychokinesis raise my hand. - Steven Wright -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From elcorto at gmx.net Wed Aug 11 15:44:18 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Wed, 11 Aug 2004 21:44:18 +0200 (MEST) Subject: [SciPy-user] gplt.close() Message-ID: <26704.1092253458@www35.gmx.net> Hi all sorry for beeing so enthusiastic that I eventually sent an RE: twice :) here is my problem: I'm producing some gplt plots (windwos) in a script. When I call the script again I want to delete the old ones first. This works fine with xplt for i in range(n): winkill() [.. plot commands ...] When I try gplt instead: for i in range(n): close() only one window (the last one produced) is killed. Why is that ?? Thanx in advance for any hint. bye steve -- All those who believe in psychokinesis raise my hand. - Steven Wright -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From elcorto at gmx.net Wed Aug 11 16:05:20 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Wed, 11 Aug 2004 22:05:20 +0200 (MEST) Subject: [SciPy-user] gplt and xplt References: <20197.1092252614@www35.gmx.net> Message-ID: <24012.1092254720@www63.gmx.net> Hi all When I generate some plots with several data sets in each plot window for i in range(n): gplt.figure() gplt.plot(x1,y1) gplt.hold('on') gplt.plot(x2,y2) [...] this is _very_ slow compared to e.g. xplt. Any ideas to speed this up? I'm not using xplt because it crashes my whole Python interpreter (PythonWin on WinXP) without warning and leaving me with several wgnuplot.exe and gnuplot_helper.exe processes at 100% CPU action when I try to process the above loop with data arrays x and y containing numbers > 1e40. But e.g. xplt.plot(array([1,2,3,5,5]),array([1,2,3,4,5e200])) works (with Numeric.array()). bye steve -- If you can't beat your computer at chess, try kickboxing. -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From david.grant at telus.net Wed Aug 11 17:10:16 2004 From: david.grant at telus.net (David J. Grant) Date: Wed, 11 Aug 2004 14:10:16 -0700 Subject: [SciPy-user] gplt and xplt In-Reply-To: <24012.1092254720@www63.gmx.net> References: <20197.1092252614@www35.gmx.net> <24012.1092254720@www63.gmx.net> Message-ID: <1092258616.411a8b38b0703@webmail.telus.net> This is a HUGE problem with gplt. There is a long sleep command somewhere in the code. This is necessary because when piping data to gnuplot some kind of badness happens if you do it too fast. There are a ton of plotters for Python out there. Finding the right one is the problem. The community really needs one that can do everything reliably, fast, and on all platforms. Or a very robust wrapper which can call all sorts of Python plotters. If anyone knows anything of use, please let me know. David Quoting Steve Schmerler : > Hi all > > When I generate some plots with several data sets in each plot window > > for i in range(n): > gplt.figure() > gplt.plot(x1,y1) > gplt.hold('on') > gplt.plot(x2,y2) > [...] > > this is _very_ slow compared to e.g. xplt. Any ideas to speed this up? > > I'm not using xplt because it crashes my whole Python interpreter (PythonWin > on WinXP) without warning and leaving me with several wgnuplot.exe and > gnuplot_helper.exe processes at 100% CPU action when I try to process the > above loop with data arrays x and y containing numbers > 1e40. > > But e.g. > > > xplt.plot(array([1,2,3,5,5]),array([1,2,3,4,5e200])) > > works (with Numeric.array()). > > bye > steve > > > -- > If you can't beat your computer at chess, try kickboxing. > -- > > NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! > GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From cdavis at staffmail.ed.ac.uk Wed Aug 11 18:08:10 2004 From: cdavis at staffmail.ed.ac.uk (Cory Davis) Date: Wed, 11 Aug 2004 23:08:10 +0100 Subject: [SciPy-user] Having trouble with scipy_distutils - specifying a fortran compiler Message-ID: <1092262090.25854.21.camel@bruce> Hi All, I have developed a Python package for atmospheric radiative transfer simulations in remote sensing applications (hhtp://www.met.ed.ac.uk/~cory/PyARTS). F2PY and scipy_distutils have been extremely helpful for creating and distributing this package. Until now I have installed the package using the command python setup.py install --home=~ ,which has been fine. But now because I have included some quad precision fortran code I need to use a different fortran compiler (instead of g77), for example the Lahey, or NAG compilers. According to the scipy_distutils section of the f2py user guide, to specify the compiler I now need to use the command 'build_ext' with the --fcompiler argument. The trouble is whenever I try to use this command on its own it complains about the f2py signature file included in the extension module sources. E.g. [cory at bruce PyARTS]$ python setup.py build_ext running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext customize GnuFCompiler customize GnuFCompiler customize GnuFCompiler using build_ext building 'scatsubs' extension compling C sources gcc options: '-pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC' error: unknown file type '.pyf' (from './src/scatsubs.pyf') I'm obviously doing something daft, but I have scoured the net for documentation to no avail. Can anyone offer me some advice? Thanks, Cory From cdavis at staffmail.ed.ac.uk Wed Aug 11 22:26:51 2004 From: cdavis at staffmail.ed.ac.uk (Cory Davis) Date: Thu, 12 Aug 2004 03:26:51 +0100 Subject: [SciPy-user] Having trouble with scipy_distutils - specifying a fortran compiler In-Reply-To: <1092262090.25854.21.camel@bruce> References: <1092262090.25854.21.camel@bruce> Message-ID: <1092277611.2673.5.camel@bruce> Sorry guys. Problem solved. I hadn't realised you could give setup.py several command arguments. The following does the trick... python config_fc --fcompiler={lahey,NAG} build Cory. > > [cory at bruce PyARTS]$ python setup.py build_ext > running build_ext > customize UnixCCompiler > customize UnixCCompiler using build_ext > customize GnuFCompiler > customize GnuFCompiler > customize GnuFCompiler using build_ext > building 'scatsubs' extension > compling C sources > gcc options: '-pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe > -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC' > error: unknown file type '.pyf' (from './src/scatsubs.pyf') > > I'm obviously doing something daft, but I have scoured the net for > documentation to no avail. > > Can anyone offer me some advice? > > Thanks, > > Cory > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From loredo at astro.cornell.edu Thu Aug 12 00:05:16 2004 From: loredo at astro.cornell.edu (Tom Loredo) Date: Thu, 12 Aug 2004 00:05:16 -0400 (EDT) Subject: [SciPy-user] Further OS X (Jaguar) difficulties Message-ID: <200408120405.i7C45GS05105@laplace.astro.cornell.edu> Hello again- Well, building MacPy 2.3.4 from source didn't help me, either. I get the same regexp error. I'm beginning to wonder if there's something wrong with my system (though I don't have any problems with other software, and running DiskWarrior didn't turn up anything nor did it fix the problem). I also tried it on my G3 laptop running 10.2.8, but with MacPy 2.3, and I get the same error. The laptop and my G4 don't have identical software, so I'm not sure what that says about the nature of my problems. I've altered linalg/interface_gen.py to use pre rather than re, and the build goes fine until sparsetools, which causes another segfault: building extension "scipy.signal.sigtools" sources building extension "scipy.signal.spline" sources building extension "scipy.sparse._zsuperlu" sources building extension "scipy.sparse._dsuperlu" sources building extension "scipy.sparse._csuperlu" sources building extension "scipy.sparse._ssuperlu" sources building extension "scipy.sparse.sparsetools" sources creating build/src/Lib/sparse creating build/src/Lib/sparse/sparsetools Segmentation fault Rather than track that down, I omitted 'sparse' from the build and things went a lot further, until I reached fftpack (I do have fftw installed, so I'm not sure I need this). The ld fails; it appears it cannot find Python symbols (lines wrapped below): ------- gcc: build/src/fortranobject.c cc1: warning: changing search order for system directory "/usr/local/include" cc1: warning: as it has already been specified as a non-system directory /usr/local/bin/g77 -lcc_dynamic -bundle build/temp.darwin-6.8-Power_Macintosh-2.3/build/src/Lib/fftpack/ _fftpackmodule.o build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/zfft.o build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/drfft.o build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/zrfft.o build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/zfftnd.o build/temp.darwin-6.8-Power_Macintosh-2.3/build/src/fortranobject.o -L/usr/local/lib -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.0 -Lbuild/temp.darwin-6.8-Power_Macintosh-2.3 -ldfftpack -lrfftw -lfftw -lg2c -o build/lib.darwin-6.8-Power_Macintosh-2.3/scipy/fftpack/_fftpack.so /usr/bin/ld: Undefined symbols: _PyArg_ParseTuple _PyArg_ParseTupleAndKeywords _PyCObject_AsVoidPtr _PyCObject_Type _PyComplex_Type _PyDict_GetItemString _PyDict_SetItemString _PyErr_Clear [snip] _Py_FindMethod __PyObject_New restFP saveFP collect2: ld returned 1 exit status error: Command "/usr/local/bin/g77 -lcc_dynamic -bundle build/temp.darwin-6.8-Power_Macintosh-2.3/build/src/Lib/fftpack/ _fftpackmodule.o build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/zfft.o build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/drfft.o build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/zrfft.o build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/zfftnd.o build/temp.darwin-6.8-Power_Macintosh-2.3/build/src/fortranobject.o -L/usr/local/lib -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.0 -Lbuild/temp.darwin-6.8-Power_Macintosh-2.3 -ldfftpack -lrfftw -lfftw -lg2c -o build/lib.darwin-6.8-Power_Macintosh-2.3/scipy/fftpack/_fftpack.so" failed with exit status 1 -------- If anyone knows how I might fix this, please advise. Or perhaps it's another clue regarding my earlier problems. Thanks again, Tom From gazzar at email.com Thu Aug 12 01:00:51 2004 From: gazzar at email.com (Gary Ruben) Date: Thu, 12 Aug 2004 15:00:51 +1000 Subject: [SciPy-user] gplt and xplt Message-ID: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> David, I'd recommend you look (for mature cross platform packages for Python) at gnuplot.py, Matplotlib and, if you need certain plot types not supported by these, DISLIN (and disipyl). I've mucked around with others but have rejected them for one reason or other. Gary ----- Original Message ----- From: "David J. Grant" Date: Wed, 11 Aug 2004 14:10:16 -0700 To: SciPy Users List ,Steve Schmerler Subject: Re: [SciPy-user] gplt and xplt > This is a HUGE problem with gplt. There is a long sleep command somewhere in > the code. This is necessary because when piping data to gnuplot some kind of > badness happens if you do it too fast. > > There are a ton of plotters for Python out there. Finding the right one is the > problem. The community really needs one that can do everything reliably, fast, > and on all platforms. Or a very robust wrapper which can call all sorts of > Python plotters. If anyone knows anything of use, please let me know. > > David -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm From elcorto at gmx.net Thu Aug 12 04:16:15 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Thu, 12 Aug 2004 10:16:15 +0200 (MEST) Subject: [SciPy-user] gplt and xplt References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> Message-ID: <4050.1092298575@www30.gmx.net> > David, > I'd recommend you look (for mature cross platform packages for Python) at > gnuplot.py, Matplotlib and, if you need certain plot types not supported by > these, DISLIN (and disipyl). I've mucked around with others but have > rejected them for one reason or other. > Gary > > Hi I tried gnuplot.py and I'm impressed. It's more straightforward than gplt and _much_ faster (almost as fast as using gnuplot directly). Thanx steve -- If you can't beat your computer at chess, try kickboxing. -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From bulatov at cs.orst.edu Thu Aug 12 04:46:37 2004 From: bulatov at cs.orst.edu (bulatov at cs.orst.edu) Date: Thu, 12 Aug 2004 01:46:37 -0700 Subject: [SciPy-user] Tensor methods? Message-ID: <1092300397.411b2e6deb0cf@webmail.oregonstate.edu> Is there any work on incorporating some optimization algorithm that uses 3rd or 4th degree information into scipy (ie Tenmin) ? Yaroslav From h.jansen at fel.tno.nl Thu Aug 12 05:08:23 2004 From: h.jansen at fel.tno.nl (H Jansen) Date: Thu, 12 Aug 2004 11:08:23 +0200 Subject: [SciPy-user] array2string Message-ID: <1092301703.18532.125.camel@pc50002760.fel.tno.nl> Wouldn't it be convenient when Numeric's ArrayPrinter.array2string would allow for indentation and be defined as def array2string(a, max_line_width = None, precision = None, suppress_small = None, separator=' ', array_output=0, base_indent=0, indent_first=1 # NEW ): rather than def array2string(a, max_line_width = None, precision = None, suppress_small = None, separator=' ', array_output=0 ): Internally, it calls _arrayToString anywith with default indentation arguments however, rather then letting them be user specified. --Henk BTW: Perhaps this is the wrong list --- I'm not aware however of a dedicate Numeric mailing list. -- ------------------------------------------------------------------------------ The disclaimer that applies to e-mail from TNO Physics and Electronics Laboratory can be found on: http://www.tno.nl/disclaimer/email.html ------------------------------------------------------------------------------ From gazzar at email.com Thu Aug 12 05:15:33 2004 From: gazzar at email.com (Gary Ruben) Date: Thu, 12 Aug 2004 19:15:33 +1000 Subject: [SciPy-user] array2string Message-ID: <20040812091533.4D1F34BDA8@ws1-1.us4.outblaze.com> Hi Henk, > Wouldn't it be convenient when Numeric's ArrayPrinter.array2string would > allow for indentation and be defined as > BTW: Perhaps this is the wrong list --- I'm not aware however of a > dedicate Numeric mailing list. the dedicate Numeric mailing list is here: It would be worth reposting there although someone relevant has probably read your message on this list. Gary -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm From elcorto at gmx.net Thu Aug 12 05:32:38 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Thu, 12 Aug 2004 11:32:38 +0200 (MEST) Subject: [SciPy-user] gnuplot.py References: <24012.1092254720@www63.gmx.net> Message-ID: <23862.1092303158@www31.gmx.net> Hi all I'm missing a function like gplt.figure() and gplt.close() in Gnuplot. Has anyone an idea how to pop up a fresh plot window, plot some stuff in it and then create the next window? I looked through the gnuplot (4.0) man but found only 'exit' and 'quit'. Thx a lot steve -- If you can't beat your computer at chess, try kickboxing. -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From Bob.Cowdery at CGI-Europe.com Thu Aug 12 05:57:03 2004 From: Bob.Cowdery at CGI-Europe.com (Bob.Cowdery at CGI-Europe.com) Date: Thu, 12 Aug 2004 10:57:03 +0100 Subject: [SciPy-user] Weave problems Message-ID: <9B40DB5FBF7D2048AD79C2A91F862A517730C5@STEVAPPS05.Stevenage.CGI-Europe.com> Thanks for the suggestions. I added a PYTHONCOMPILED env var and deleted all the intermediate and compiled files. Then compiled the two routines I have. It did put the compiled files in the right place, still using the temporary directory for intermediate files. It did however put an empty catalogue in PYTHONCOMPILED dir and the real catalogue in my temporary directory under python2_compiled which I don't understand. I think it helped slightly, I still have to keep compiling until it works. Even though I don't change anything it still rebuilds and then on other occations when I do change something it refuses to rebuild!! I also renamed the two plot files and they don't cause a problem now but I would still like to know what they were doing. In all other respects this is an excellent tool but this somewhat bizarre behaviour detracts from its usability. Bob -----Original Message----- From: scipy at zunzun.com [mailto:scipy at zunzun.com] Sent: 11 August 2004 07:26 To: scipy-user at scipy.net Subject: Re: [SciPy-user] Weave problems > When I try to run my application two things happen. I get a stream of > exceptions - I had odd problems on Windows that require me to occasionally delete all of weave's temporary files and then compile 'int a;' in a python script using weave to kind of restart it. I wrote a batch file to do this, and run it whenever I get problems like these; 90% of the time they clear up for me and the other 10% are my syntax errors. > ...I am left with wgnuplot.exe and gnuplot_helper.exe > between them taking 100% CPU and I have to kill those off > as well. Find and delete these two files, that was my solution. No answer from the mailing list on that one. Randy Phillips http://zunzun.com _______________________________________________ SciPy-user mailing list SciPy-user at scipy.net http://www.scipy.net/mailman/listinfo/scipy-user *** Confidentiality Notice *** Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tfogal at apollo.sr.unh.edu Thu Aug 12 10:52:59 2004 From: tfogal at apollo.sr.unh.edu (tom fogal) Date: Thu, 12 Aug 2004 10:52:59 -0400 Subject: [SciPy-user] Further OS X (Jaguar) difficulties In-Reply-To: Your message of "Thu, 12 Aug 2004 00:05:16 EDT." <200408120405.i7C45GS05105@laplace.astro.cornell.edu> References: <200408120405.i7C45GS05105@laplace.astro.cornell.edu> Message-ID: <200408121452.i7CEqxQ9004877@apollo.sr.unh.edu> Hi TomL, <200408120405.i7C45GS05105 at laplace.astro.cornell.edu>Tom Loredo writes: > >I've altered linalg/interface_gen.py to use pre rather than re, and the >build goes fine until sparsetools, which causes another segfault: > > building extension "scipy.signal.sigtools" sources > building extension "scipy.signal.spline" sources > building extension "scipy.sparse._zsuperlu" sources > building extension "scipy.sparse._dsuperlu" sources > building extension "scipy.sparse._csuperlu" sources > building extension "scipy.sparse._ssuperlu" sources > building extension "scipy.sparse.sparsetools" sources > creating build/src/Lib/sparse > creating build/src/Lib/sparse/sparsetools > Segmentation fault Sorry, can't help you there... >gcc: build/src/fortranobject.c >cc1: warning: changing search order for system directory "/usr/local/include" >cc1: warning: as it has already been specified as a non-system directory >/usr/local/bin/g77 -lcc_dynamic -bundle >build/temp.darwin-6.8-Power_Macintosh-2.3/build/src/Lib/fftpack/ >_fftpackmodule.o >build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/zfft.o >build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/drfft.o >build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/zrfft.o >build/temp.darwin-6.8-Power_Macintosh-2.3/Lib/fftpack/src/zfftnd.o >build/temp.darwin-6.8-Power_Macintosh-2.3/build/src/fortranobject.o >-L/usr/local/lib -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.0 >-Lbuild/temp.darwin-6.8-Power_Macintosh-2.3 -ldfftpack -lrfftw -lfftw >-lg2c -o >build/lib.darwin-6.8-Power_Macintosh-2.3/scipy/fftpack/_fftpack.so >/usr/bin/ld: Undefined symbols: >_PyArg_ParseTuple >_PyArg_ParseTupleAndKeywords >_PyCObject_AsVoidPtr >_PyCObject_Type As you can see from your commandline above, the python library is not being linked to (no '-lpython'). I had a similar problem - the solution was to add the linking flag to the end of my 'python setup.py' command line. For example: python setup.py build build_ext -lpython2.3 the 2.3 because I do not have a libpython.so, only libpython2.3.so. You can add as many arguments as you like, but if you have a space I think you need to quote them. This worked for me on linux/x86_64. YMMV. >Thanks again, >Tom Your welcome. Good luck, -tom From Fernando.Perez at colorado.edu Thu Aug 12 12:09:11 2004 From: Fernando.Perez at colorado.edu (Fernando.Perez at colorado.edu) Date: Thu, 12 Aug 2004 10:09:11 -0600 Subject: [SciPy-user] gplt and xplt In-Reply-To: <4050.1092298575@www30.gmx.net> References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> <4050.1092298575@www30.gmx.net> Message-ID: <1092326951.411b96275bde0@webmail.colorado.edu> Quoting Steve Schmerler : > I tried gnuplot.py and I'm impressed. It's more straightforward than gplt > and _much_ faster (almost as fast as using gnuplot directly). If you want to use gnuplot.py, you may want to try ipython (http://ipython.scipy.org). It layers extra functions on top of Gnuplot.py which provide better syntax for many common tasks. You can use it interactively (the provided 'numeric' profile loads Numeric and the gnuplot support), or in scripts; the basic support module is IPython.GnuplotRuntime. Best, f From Fernando.Perez at colorado.edu Thu Aug 12 12:12:46 2004 From: Fernando.Perez at colorado.edu (Fernando.Perez at colorado.edu) Date: Thu, 12 Aug 2004 10:12:46 -0600 Subject: [SciPy-user] gnuplot.py In-Reply-To: <23862.1092303158@www31.gmx.net> References: <24012.1092254720@www63.gmx.net> <23862.1092303158@www31.gmx.net> Message-ID: <1092327166.411b96fe9d0b3@webmail.colorado.edu> Quoting Steve Schmerler : > I'm missing a function like gplt.figure() and gplt.close() in Gnuplot. > > Has anyone an idea how to pop up a fresh plot window, plot some stuff in it > and then create the next window? I looked through the gnuplot (4.0) man but > found only 'exit' and 'quit'. Since Gnuplot only manages one plotting window at a time, you need to create new instances. If you use the extra support in IPython.GnuplotRuntime, you'll find a gp_new() function which does precisely that. The equivalent with bare Gnuplot.py is, if I recall correctly, a call to the class constructor. Best, f From skip at pobox.com Thu Aug 12 12:22:46 2004 From: skip at pobox.com (Skip Montanaro) Date: Thu, 12 Aug 2004 11:22:46 -0500 Subject: [SciPy-user] core dump during import Message-ID: <16667.39254.495376.671170@montanaro.dyndns.org> I'm the "python guy" at work which by default makes me the "scipy installation guy" as well, though I'm not using it for any of my own projects. Awhile ago I performed a very basic installation: install latest f2py install Numeric 23.1 install SciPy_complete-0.3 The platform is Solaris 9 on Intel. I'm using Python 2.3.4 (though originally installed using 2.3.3). GCC and G77 are both at 3.3.2. The installation goes fine with the one caveat that I needed to point LD_RUN_PATH at the g77 lib dir so libg2c.so.0 could be found at runtime. If I execute from scipy.stats import distribution at the interpreter prompt I get a segfault. Here's the beginning of the gdb traceback: #0 0x20ec8356 in ?? () #1 0xdd2d7e24 in Cephes_InitOperators (dictionary=0x8486dfc) at Lib/special/cephesmodule.c:413 #2 0xdd2d7a7a in initcephes () at Lib/special/cephesmodule.c:1105 #3 0x080d082e in _PyImport_LoadDynamicModule ( name=0x8040500 "scipy.special.cephes", pathname=0x8040070 "/opt/lang/python/lib/python2.3/site-packages/scipy/special/cephes.so", fp=0x8148780) at ../Python/importdl.c:53 #4 0x080cd637 in load_module (name=0x8040500 "scipy.special.cephes", fp=0x8148780, buf=0x8040070 "/opt/lang/python/lib/python2.3/site-packages/scipy/special/cephes.so", type=3, loader=0x0) at ../Python/import.c:1708 #5 0x080ce345 in import_submodule (mod=0x8149fa4, subname=0x804050e "cephes", fullname=0x8040500 "scipy.special.cephes") at ../Python/import.c:2291 #6 0x080cdea4 in load_next (mod=0x8149fa4, altmod=0x81265e0, p_name=0x8040930, buf=0x8040500 "scipy.special.cephes", p_buflen=0x80404fc) at ../Python/import.c:2111 #7 0x080cfbf1 in import_module_ex (name=0x0, globals=0x8486c64, locals=0x8486c64, fromlist=0x83e256c) at ../Python/import.c:1957 #8 0x080ced40 in PyImport_ImportModuleEx (name=0x8369c34 "cephes", globals=0x8486c64, locals=0x8486c64, fromlist=0x83e256c) at ../Python/import.c:1998 #9 0x080a1bde in builtin___import__ (self=0x0, args=0x8483d4c) at ../Python/bltinmodule.c:45 #10 0x080fac78 in PyCFunction_Call (func=0x8151bec, arg=0x8483d4c, kw=0x0) at ../Objects/methodobject.c:108 #11 0x08062e90 in PyObject_Call (func=0x8151bec, arg=0x8483d4c, kw=0x0) at ../Objects/abstract.c:1755 Since I don't use SciPy, Cephes or f2py outside of installing SciPy I don't really know where to start poking. Frame 1 is at this line: 413 f = PyUFunc_FromFuncAndData(cephes3a_functions, bdtr_data, cephes_4_types, 2, 3, 1, PyUFunc_None, "bdtr", bdtr_doc, 0); and cephes3a_functions looks suspicious: (gdb) p cephes3a_functions $2 = {0x5, 0x6} I presume considering the variable name those are supposed to be valid function pointers. Stepping through initcephes leads me to this: (gdb) n 393 cephes3a_functions[0] = PyUFunc_fff_f_As_iid_d; (gdb) n 391 cephes3_functions[2] = PyUFunc_ffF_F_As_ddD_D; (gdb) n 392 cephes3_functions[3] = PyUFunc_ddD_D; (gdb) n 394 cephes3a_functions[1] = PyUFunc_ddd_d_As_iid_d; (gdb) n 395 cephes3_2_functions[0] = PyUFunc_fff_ff_As_ddd_dd; (gdb) p cephes3a_functions $9 = {0x5, 0x6} (gdb) p PyUFunc_ddD_D $10 = {void (char **, int *, int *, void *)} 0xdd2e4720 (gdb) p PyUFunc_ddd_d_As_iid_d $11 = {void (char **, int *, int *, void *)} 0xdd2e4a20 It seems there's something amiss with the cephes3a_functions initialization. In fact, other cephes*_functions variables appear bogus as well: (gdb) p cephes3_functions $12 = {0, 0, 0x3, 0x4} (gdb) p cephes1_functions $13 = {0x464c457f, 0x10101} (gdb) p cephes2_4_functions $14 = {0x7e34, 0x7} Does this ring a bell with anybody? Any clues about how to proceed would be appreciated. Thanks, -- Skip Montanaro Got spam? http://www.spambayes.org/ skip at pobox.com From rkern at ucsd.edu Thu Aug 12 13:18:30 2004 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 12 Aug 2004 12:18:30 -0500 Subject: [SciPy-user] Further OS X (Jaguar) difficulties In-Reply-To: <200408120405.i7C45GS05105@laplace.astro.cornell.edu> References: <200408120405.i7C45GS05105@laplace.astro.cornell.edu> Message-ID: <411BA666.5090509@ucsd.edu> Tom Loredo wrote: > Hello again- > > Well, building MacPy 2.3.4 from source didn't help me, either. I get the > same regexp error. I'm beginning to wonder if there's something wrong > with my system (though I don't have any problems with other software, and > running DiskWarrior didn't turn up anything nor did it fix the problem). > I also tried it on my G3 laptop running 10.2.8, but with MacPy 2.3, and I > get the same error. The laptop and my G4 don't have identical software, > so I'm not sure what that says about the nature of my problems. > > I've altered linalg/interface_gen.py to use pre rather than re, and the > build goes fine until sparsetools, which causes another segfault: > > building extension "scipy.signal.sigtools" sources > building extension "scipy.signal.spline" sources > building extension "scipy.sparse._zsuperlu" sources > building extension "scipy.sparse._dsuperlu" sources > building extension "scipy.sparse._csuperlu" sources > building extension "scipy.sparse._ssuperlu" sources > building extension "scipy.sparse.sparsetools" sources > creating build/src/Lib/sparse > creating build/src/Lib/sparse/sparsetools > Segmentation fault > > Rather than track that down, I omitted 'sparse' from the build and > things went a lot further, until I reached fftpack (I do have fftw > installed, so I'm not sure I need this). The ld fails; it appears > it cannot find Python symbols (lines wrapped below): You may have a problem with your new Python build, then. Did you do a framework build? -- 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 Aug 12 10:38:45 2004 From: aisaac at american.edu (Alan G Isaac) Date: Thu, 12 Aug 2004 10:38:45 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplt and xplt In-Reply-To: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> Message-ID: On Thu, 12 Aug 2004, Gary Ruben apparently wrote: > I'd recommend you look (for mature cross platform packages > for Python) at gnuplot.py, Matplotlib and, if you need > certain plot types not supported by these, DISLIN (and > disipyl). Just to note on the particular issue raised by Gary: gnuplot.py faces exactly the same problem as gplt but relies on the user to implement apprpriate delays. What is unclear from the descriptions that I've read is whether this is a gnuplot problem or a problem with pipes under Windows. If the former, do the gnuplot developers know about it? > I've mucked around with others but have rejected them for > one reason or other. Can you summarize your experience with biggles? http://biggles.sourceforge.net/ Thanks, Alan Isaac From cookedm at physics.mcmaster.ca Thu Aug 12 16:37:43 2004 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Thu, 12 Aug 2004 16:37:43 -0400 Subject: [SciPy-user] gplt and xplt In-Reply-To: References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> Message-ID: <20040812203743.GB8465@arbutus.physics.mcmaster.ca> On Thu, Aug 12, 2004 at 10:38:45AM -0400, Alan G Isaac wrote: > On Thu, 12 Aug 2004, Gary Ruben apparently wrote: > > I'd recommend you look (for mature cross platform packages > > for Python) at gnuplot.py, Matplotlib and, if you need > > certain plot types not supported by these, DISLIN (and > > disipyl). > > Just to note on the particular issue raised by Gary: > gnuplot.py faces exactly the same problem as gplt but relies > on the user to implement apprpriate delays. What is unclear > from the descriptions that I've read is whether this is a > gnuplot problem or a problem with pipes under Windows. > If the former, do the gnuplot developers know about it? > > > I've mucked around with others but have rejected them for > > one reason or other. > > Can you summarize your experience with biggles? > http://biggles.sourceforge.net/ I like biggles. It has a clean, object-based, API. It uses plotutils, so it can generate all the formats you need, including output to an X window. You generate your curves, etc., and add them to a plot object. It doesn't have a matrix plot, though. [What I don't like about matplotlib, for instance, is its insistence on using matlab commands acting on a global plot instead of acting on plot objects (like biggles does).] -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From jdhunter at ace.bsd.uchicago.edu Thu Aug 12 16:57:02 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Thu, 12 Aug 2004 15:57:02 -0500 Subject: [SciPy-user] gplt and xplt In-Reply-To: <20040812203743.GB8465@arbutus.physics.mcmaster.ca> ("David M. Cooke"'s message of "Thu, 12 Aug 2004 16:37:43 -0400") References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> <20040812203743.GB8465@arbutus.physics.mcmaster.ca> Message-ID: >>>>> "David" == David M Cooke writes: David> [What I don't like about matplotlib, for instance, is its David> insistence on using matlab commands acting on a global plot David> instead of acting on plot objects (like biggles does).] Not quite accurate - there is no insistence on this at all. In fairness, the matlab interface is by far the best documented, but there is an OO API which you can use in a GUIs, in a script, or from the shell. The matlab interface is a very thin wrapper around this API. Here is a simple "pythonic" example using matplotlib with no hidden usage of global objects - more details at http://matplotlib.sourceforge.net/examples/pythonic_matplotlib.py from matplotlib.matlab import figure, close, axes, subplot, show from matplotlib.numerix import arange, sin, pi t = arange(0.0, 1.0, 0.01) fig = figure(1) ax1 = fig.add_subplot(211) ax1.plot(t, sin(2*pi*t)) ax1.grid(True) ax1.set_ylim( (-2,2) ) ax1.set_ylabel('1 Hz') ax1.set_title('A sine wave or two') for label in ax1.get_xticklabels(): label.set_color('r') ax2 = fig.add_subplot(212) ax2.plot(t, sin(2*2*pi*t)) ax2.grid(True) ax2.set_ylim( (-2,2) ) l = ax2.set_xlabel('Hi mom') l.set_color('g') l.set_fontsize('large') show() I actually prefer the matlab style interface because I find it much more pithy, eg xlabel('Hi mom', color='g', fontsize='large') but many people like you prefer the approach above and use matplotlib that way. JDH From cookedm at physics.mcmaster.ca Thu Aug 12 17:38:37 2004 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Thu, 12 Aug 2004 17:38:37 -0400 Subject: [SciPy-user] gplt and xplt In-Reply-To: References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> <20040812203743.GB8465@arbutus.physics.mcmaster.ca> Message-ID: <20040812213837.GA9009@arbutus.physics.mcmaster.ca> On Thu, Aug 12, 2004 at 03:57:02PM -0500, John Hunter wrote: > >>>>> "David" == David M Cooke writes: > > David> [What I don't like about matplotlib, for instance, is its > David> insistence on using matlab commands acting on a global plot > David> instead of acting on plot objects (like biggles does).] > > Not quite accurate - there is no insistence on this at all. In > fairness, the matlab interface is by far the best documented, but > there is an OO API which you can use in a GUIs, in a script, or from > the shell. The matlab interface is a very thin wrapper around this > API. > > Here is a simple "pythonic" example using matplotlib with no hidden > usage of global objects - more details at > http://matplotlib.sourceforge.net/examples/pythonic_matplotlib.py > > from matplotlib.matlab import figure, close, axes, subplot, show > from matplotlib.numerix import arange, sin, pi > > t = arange(0.0, 1.0, 0.01) > > fig = figure(1) Hidden variable; the '1' is a global identifier for the plot. > ax1 = fig.add_subplot(211) > ax1.plot(t, sin(2*pi*t)) > ax1.grid(True) > ax1.set_ylim( (-2,2) ) > ax1.set_ylabel('1 Hz') > ax1.set_title('A sine wave or two') > > for label in ax1.get_xticklabels(): > label.set_color('r') > > > ax2 = fig.add_subplot(212) > ax2.plot(t, sin(2*2*pi*t)) > ax2.grid(True) > ax2.set_ylim( (-2,2) ) > l = ax2.set_xlabel('Hi mom') > l.set_color('g') > l.set_fontsize('large') > > show() Again, no hidden globals? Then what does show() do? What does it show? savefig() has the same problem. They both have the concept of "current figure" -- which is a global I don't reference above. In essence, can I build up two plots independently at the same time? Then save them? The biggles version of this is import biggles import math, Numeric x = Numeric.arange( 0, 3*math.pi, math.pi/10 ) y = Numeric.sin(x) p = biggles.FramedPlot() p.title = "Title" p.xlabel = "X axis" p.ylabel = "Y axis" p.add( biggles.Histogram(y) ) p.add( biggles.PlotLabel(.5, .5, "Histogram", color=0xcc0000) ) t1 = biggles.Table( 1, 2 ) t1[0,0] = p t1[0,1] = p t2 = biggles.Table( 2, 1 ) t2[0,0] = t1 t2[1,0] = p t2.write_img( 400, 400, "example3.png" ) t2.write_eps( "example3.eps" ) t2.show() Compared to that, matplotlib just doesn't seem pythonic enough for me. It does have its advantages, though: anti-aliased output, different renderers, and you can add interactivity. -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From stephen.walton at csun.edu Thu Aug 12 17:56:34 2004 From: stephen.walton at csun.edu (Stephen Walton) Date: Thu, 12 Aug 2004 14:56:34 -0700 Subject: [SciPy-user] gplt and xplt In-Reply-To: <1092326951.411b96275bde0@webmail.colorado.edu> References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> <4050.1092298575@www30.gmx.net> <1092326951.411b96275bde0@webmail.colorado.edu> Message-ID: <1092347794.14899.12.camel@freyer.sfo.csun.edu> On Thu, 2004-08-12 at 09:09, Fernando.Perez at colorado.edu wrote: > If you want to use gnuplot.py, you may want to try ipython Fernando is too modest. If you want to do _anything_ with Python, you owe it to yourself to try ipython. Perhaps it is the fervor of the recently converted, but I'm a big fan of it. "ipython -p pysh" is a wonder. -- 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 jdhunter at ace.bsd.uchicago.edu Thu Aug 12 17:36:20 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Thu, 12 Aug 2004 16:36:20 -0500 Subject: [SciPy-user] gplt and xplt In-Reply-To: <20040812213837.GA9009@arbutus.physics.mcmaster.ca> ("David M. Cooke"'s message of "Thu, 12 Aug 2004 17:38:37 -0400") References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> <20040812203743.GB8465@arbutus.physics.mcmaster.ca> <20040812213837.GA9009@arbutus.physics.mcmaster.ca> Message-ID: >>>>> "David" == David M Cooke writes: David> Hidden variable; the '1' is a global identifier for the David> plot. OK, good eye. I was playing a little fast and loose. However, the fact remains that you do not need the matlab interface at all. I was using it minimally in my example above. >> show() David> Again, no hidden globals? Then what does show() do? What David> does it show? It provides a consistent interface so that the same script can realize figure windows across the 4 GUI backends: GTK, WX, Tkinter and FLTK. But you're right again - some pixie dust under the hood. David> savefig() has the same problem. They both have the concept David> of "current figure" -- which is a global I don't reference David> above. True, but I didn't call savefig in my example. See below, in any case. David> In essence, can I build up two plots independently David> at the same time? Then save them? Not a problem - here the matlab interface is not imported or used. The use of a separate Figure and FigureCanvas below results from trying to keep a clean separation from the frontend (Figure) and backend (Canvas) from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.numerix import rand fig1 = Figure() fig2 = Figure() canvas1 = FigureCanvas(fig1) canvas2 = FigureCanvas(fig2) ax1 = fig1.add_subplot(111) ax2 = fig2.add_axes([0.2, 0.2, 0.5, 0.5]) # a custom axes in fig2 ax1.plot([1,2,3]) ax2.scatter(rand(12), rand(12)) canvas1.print_figure('fig1.svg') # switches to the svg backend canvas1.print_figure('fig1.png') # native agg saves png canvas2.print_figure('fig2.eps') # switches to the PS backend No call to show, etc.... The hardcopy is created upon executing this script. Here I take advantage of the fact that most backends (agg in this case) can switch backends to render to PS/EPS/SVG/PNG depending on the extension. You don't need to use the switching feature - you could have directly imported the SVG or PS backend canvas, but I included it for illustration. You use the same approach to create GUI canvases for embedding in an application, but the constructor args for the FigureCanvas vary somewhat from backend to backend. And you would have to fire up your GUI mainloop and realize your windows, etc.. Thanks for keeping me honest! I'm working on a users guide and will include a section along these lines. JDH From Fernando.Perez at colorado.edu Thu Aug 12 18:18:36 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Thu, 12 Aug 2004 16:18:36 -0600 Subject: [SciPy-user] gplt and xplt In-Reply-To: <1092347794.14899.12.camel@freyer.sfo.csun.edu> References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> <4050.1092298575@www30.gmx.net> <1092326951.411b96275bde0@webmail.colorado.edu> <1092347794.14899.12.camel@freyer.sfo.csun.edu> Message-ID: <411BECBC.6010900@colorado.edu> Stephen Walton wrote: > On Thu, 2004-08-12 at 09:09, Fernando.Perez at colorado.edu wrote: > > >>If you want to use gnuplot.py, you may want to try ipython > > > Fernando is too modest. If you want to do _anything_ with Python, you > owe it to yourself to try ipython. Perhaps it is the fervor of the > recently converted, but I'm a big fan of it. > > "ipython -p pysh" is a wonder. Many thanks for the kind comment. I really appreciate it. I have no idea how wide the ipython userbase is, and most projects (ipython is not alone here) tend to hear from users only when there are bugs or missing features. I work on ipython for fun and because I use it all day for my own research, so I don't _expect_ any kind of 'reward'. But this kind of response is one of the small joys of working on something which turns out to be valued by others. So with all sincerity, thank you. Best, f ps. I'm glad you like pysh, I think it's a pretty cool feature. Coming soon: gtk support so you can use matplotlib (or any other gtk/wx based program) with ipython, with transparent mainloop thread support. I'll try to post a pre-release of this tomorrow on the ipython list. From cookedm at physics.mcmaster.ca Thu Aug 12 18:47:24 2004 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Thu, 12 Aug 2004 18:47:24 -0400 Subject: [SciPy-user] gplt and xplt In-Reply-To: References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> <20040812203743.GB8465@arbutus.physics.mcmaster.ca> <20040812213837.GA9009@arbutus.physics.mcmaster.ca> Message-ID: <20040812224724.GA12958@arbutus.physics.mcmaster.ca> On Thu, Aug 12, 2004 at 04:36:20PM -0500, John Hunter wrote: > >>>>> "David" == David M Cooke writes: > David> In essence, can I build up two plots independently > David> at the same time? Then save them? > > Not a problem - here the matlab interface is not imported or used. > The use of a separate Figure and FigureCanvas below results from > trying to keep a clean separation from the frontend (Figure) and > backend (Canvas) > > from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas > from matplotlib.figure import Figure > from matplotlib.numerix import rand > > fig1 = Figure() > fig2 = Figure() > > canvas1 = FigureCanvas(fig1) > canvas2 = FigureCanvas(fig2) > > ax1 = fig1.add_subplot(111) > ax2 = fig2.add_axes([0.2, 0.2, 0.5, 0.5]) # a custom axes in fig2 > > ax1.plot([1,2,3]) > > ax2.scatter(rand(12), rand(12)) > > canvas1.print_figure('fig1.svg') # switches to the svg backend > canvas1.print_figure('fig1.png') # native agg saves png > canvas2.print_figure('fig2.eps') # switches to the PS backend > > No call to show, etc.... The hardcopy is created upon executing this > script. Here I take advantage of the fact that most backends (agg in > this case) can switch backends to render to PS/EPS/SVG/PNG depending > on the extension. You don't need to use the switching feature - you > could have directly imported the SVG or PS backend canvas, but I > included it for illustration. Hmm, ok. I like that better. Thanks! -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm at physics.mcmaster.ca From aaron_lamont_w at yahoo.com Fri Aug 13 00:52:47 2004 From: aaron_lamont_w at yahoo.com (Aaron Williams) Date: Thu, 12 Aug 2004 21:52:47 -0700 (PDT) Subject: [SciPy-user] Windows - Symbols Character In-Reply-To: <20040812215702.BD5633EB7F@www.scipy.com> Message-ID: <20040813045247.12320.qmail@web13802.mail.yahoo.com> My question is about python' s character assinments in a Windows 2000. I am in the process of automating oneof my programs, but because I am using Windows I am having a problem with the backslash character. Here is an example: ############################################################# from scipy import * io.array_import #open Fortran Binary array i = 1001 imax = 1142 U = '\O256a' j = imax + 1 while i < j: c = str(i) a = U + c FilePath = 'D:\FFTstuff\netcdf\Newdata\O256a' + U + c + '.bin' fid=io.fopen(FilePath,'r') ________________________________________ Traceback (most recent call last): File "D:\FFTstuff\netcdf\Newdata2\O256a\FFT_converter256O.py", line 21, in ? fid=io.fopen(FilePath,'r') File "D:\PROGRA~1\PYTHON2.3\Lib\site-packages\scipy\io\mio.py", line 91, in __init__ self.__dict__['fid'] = open(file_name,permission) IOError: [Errno 2] No such file or directory: 'D:\\FFTstuff\netcdf\\Newdata2\\O256a\\O256a1001.bin' ################################################################### The file does exist I just need to get rid of the extra backslashes. Do you have any suggestions on how to fix this problem. --------------------------------- Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! -------------- next part -------------- An HTML attachment was scrubbed... URL: From aisaac at american.edu Fri Aug 13 09:27:51 2004 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 13 Aug 2004 09:27:51 -0400 (Eastern Daylight Time) Subject: [SciPy-user] Windows - Symbols Character In-Reply-To: <20040813045247.12320.qmail@web13802.mail.yahoo.com> References: <20040813045247.12320.qmail@web13802.mail.yahoo.com> Message-ID: On Thu, 12 Aug 2004, Aaron Williams apparently wrote: > The file does exist I just need to get rid of the extra backslashes. Do > you have any suggestions on how to fix this problem. Despite the error msg, I think you need to double all your backslashes. I vaguely recall that you can also use forward slashes in Python under Windows. hth, Alan Isaac From gazzar at email.com Fri Aug 13 10:25:02 2004 From: gazzar at email.com (Gary Ruben) Date: Sat, 14 Aug 2004 00:25:02 +1000 Subject: [SciPy-user] gplt and xplt Message-ID: <20040813142502.980191F50B2@ws1-2.us4.outblaze.com> Biggles was the first Python plotting solution I tried to install but it was quite a while ago. I couldn't get it working under Windows so it failed my cross-platform requirement. I haven't tried the more recent version. Gary ----- Original Message ----- From: Alan G Isaac Date: Thu, 12 Aug 2004 10:38:45 -0400 (Eastern Daylight Time) To: SciPy Users List Subject: Re[2]: [SciPy-user] gplt and xplt > On Thu, 12 Aug 2004, Gary Ruben apparently wrote: > > I'd recommend you look (for mature cross platform packages > > for Python) at gnuplot.py, Matplotlib and, if you need > > certain plot types not supported by these, DISLIN (and > > disipyl). > > Just to note on the particular issue raised by Gary: > gnuplot.py faces exactly the same problem as gplt but relies > on the user to implement apprpriate delays. What is unclear > from the descriptions that I've read is whether this is a > gnuplot problem or a problem with pipes under Windows. > If the former, do the gnuplot developers know about it? > > > I've mucked around with others but have rejected them for > > one reason or other. > > Can you summarize your experience with biggles? > http://biggles.sourceforge.net/ > > Thanks, > Alan Isaac -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm From gazzar at email.com Fri Aug 13 10:52:20 2004 From: gazzar at email.com (Gary Ruben) Date: Sat, 14 Aug 2004 00:52:20 +1000 Subject: [SciPy-user] gplt and xplt Message-ID: <20040813145220.E3611164002@ws1-4.us4.outblaze.com> Alan, just a comment on your other point - > Just to note on the particular issue raised by Gary: > gnuplot.py faces exactly the same problem as gplt but relies > on the user to implement apprpriate delays. What is unclear > from the descriptions that I've read is whether this is a > gnuplot problem or a problem with pipes under Windows. > If the former, do the gnuplot developers know about it? I always assumed this was a Windows pipe-system problem. I have experienced problems in other arenas with pipes under Win98 but not under Win2k in which the Windows pipe system changed. My experience of flakiness with pipes driving gnuplot also followed this pattern. ie. very occasionally, I get misbehaviour (broken plots) under Win98 but I haven't seen it under Win2k. When I experience a broken plot, I just re-run the script and it's typically fine. I don't use it interactively from Python. Gary -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm From aisaac at american.edu Fri Aug 13 14:18:44 2004 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 13 Aug 2004 14:18:44 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplt and xplt In-Reply-To: <1092347794.14899.12.camel@freyer.sfo.csun.edu> References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com><4050.1092298575@www30.gmx.net><1092326951.411b96275bde0@webmail.colorado.edu><1092347794.14899.12.camel@freyer.sfo.csun.edu> Message-ID: On Thu, 12 Aug 2004, Stephen Walton apparently wrote: > If you want to do anything with Python, you > owe it to yourself to try ipython. Perhaps it is the fervor of the > recently converted, but I'm a big fan of it. OK. I use Windows 2000. I installed ctypes. I installed readline. I installed IPython. IPython failes with a call to readline.set_completer: AttributeError: module has no attribute set_completer Any ideas? Thanks, Alan Isaac From Fernando.Perez at colorado.edu Fri Aug 13 16:21:33 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Fri, 13 Aug 2004 14:21:33 -0600 Subject: [SciPy-user] gplt and xplt In-Reply-To: References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com><4050.1092298575@www30.gmx.net><1092326951.411b96275bde0@webmail.colorado.edu><1092347794.14899.12.camel@freyer.sfo.csun.edu> Message-ID: <411D22CD.6030401@colorado.edu> Alan G Isaac wrote: > On Thu, 12 Aug 2004, Stephen Walton apparently wrote: > >>If you want to do anything with Python, you >>owe it to yourself to try ipython. Perhaps it is the fervor of the >>recently converted, but I'm a big fan of it. > > > OK. > I use Windows 2000. > I installed ctypes. Which version? There's a notice at http://ipython.scipy.org about a problem with 0.9 & unc-readline, which is the current one. This is unfortunate, but beyond my control. The unc-readline author is working on it, but for now the only solution is to backpedal to ctypes 0.6. > I installed readline. Which one? The unc-readline, from: http://sourceforge.net/projects/uncpythontools is the only one that works correctly. The one here: http://newcenturycomputers.net/projects/readline.html is terminally broken, don't use it. It's not a real readline, it misses critical parts of the api. > I installed IPython. > > IPython failes with a call to readline.set_completer: > AttributeError: module has no attribute set_completer > > Any ideas? I hope this helps, let me know if you need more assistance. Unfortunately things under Windows are always harder than with posix systems, due to the brokenness of many of the necessary underlying subsystems. The fact that I can't test it because I don't have access to a computer running windows anywhere doesn't help. But with user's help (like Gary Bishop, the uncreadline author), ipython under Win32 has actually made a lot of progress. Best, f From aisaac at american.edu Fri Aug 13 18:07:35 2004 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 13 Aug 2004 18:07:35 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplt and xplt In-Reply-To: <411D22CD.6030401@colorado.edu> References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com><4050.1092298575@www30.gmx.net><1092326951.411b96275bde0@webmail.colorado.edu><1092347794.14899.12.camel@freyer.sfo.csun.edu> <411D22CD.6030401@colorado.edu> Message-ID: > Alan G Isaac wrote: >> On Thu, 12 Aug 2004, Stephen Walton apparently wrote: >>> If you want to do anything with Python, you >>> owe it to yourself to try ipython. Perhaps it is the fervor of the >>> recently converted, but I'm a big fan of it. >> OK. >> I use Windows 2000. >> I installed ctypes. On Fri, 13 Aug 2004, Fernando Perez apparently wrote: > There's a notice at http://ipython.scipy.org about a problem > with 0.9 & unc-readline, which is the current one. > This is unfortunate, but beyond my control. The unc-readline author is > working on it, but for now the only solution is to backpedal to ctypes 0.6. Will this involve anything beyond deleting the ctypes folder and then installing 0.6? > The unc-readline, from: > http://sourceforge.net/projects/uncpythontools > is the only one that works correctly. That's the one I used. Thanks, Alan Isaac From elcorto at gmx.net Sat Aug 14 05:41:23 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Sat, 14 Aug 2004 11:41:23 +0200 (MEST) Subject: [SciPy-user] gnuplot.py References: <1092327166.411b96fe9d0b3@webmail.colorado.edu> Message-ID: <4873.1092476483@www52.gmx.net> > Quoting Steve Schmerler : > > > I'm missing a function like gplt.figure() and gplt.close() in Gnuplot. > > > > Has anyone an idea how to pop up a fresh plot window, plot some stuff in > it > > and then create the next window? I looked through the gnuplot (4.0) man > but > > found only 'exit' and 'quit'. > > Since Gnuplot only manages one plotting window at a time, you need to > create new > instances. If you use the extra support in IPython.GnuplotRuntime, you'll > find > a gp_new() function which does precisely that. The equivalent with bare > Gnuplot.py is, if I recall correctly, a call to the class constructor. > you mean: import Gnuplot g=Gnuplot.Gnuplot() Every g=Gnuplot.Gnuplot() kills the current wgnuplot.exe (I'm working on WinXP) as well as the current plot window and starts a new gnuplot session (new wgnuplot.exe). The problem is that I want to keep the former plot windows (I want them to appear one after the other). I've read read about the problems with Win on the IPython page. The function you've mentioned (gp_new()) is a pure IPython feature, right? bye steve -- If you can't beat your computer at chess, try kickboxing. -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From pajer at iname.com Sat Aug 14 11:06:11 2004 From: pajer at iname.com (Gary Pajer) Date: Sat, 14 Aug 2004 11:06:11 -0400 Subject: [SciPy-user] gplt and xplt References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com><4050.1092298575@www30.gmx.net><1092326951.411b96275bde0@webmail.colorado.edu><1092347794.14899.12.camel@freyer.sfo.csun.edu><411D22CD.6030401@colorado.edu> Message-ID: <008401c48210$3c86c790$6400a8c0@playroom> ----- Original Message ----- From: "Alan G Isaac" To: "SciPy Users List" Sent: Friday, August 13, 2004 6:07 PM Subject: Re[2]: [SciPy-user] gplt and xplt > On Fri, 13 Aug 2004, Fernando Perez apparently wrote: > > There's a notice at http://ipython.scipy.org about a problem > > with 0.9 & unc-readline, which is the current one. > > > This is unfortunate, but beyond my control. The unc-readline author is > > working on it, but for now the only solution is to backpedal to ctypes 0.6. > > Will this involve anything beyond deleting the ctypes folder > and then installing 0.6? I just installed the old one over the new one and it worked fine. ymmv. Fernando, maybe you should put a note on the web site about this. I did a new install on a new machine and was quite puzzled for a while... From Fernando.Perez at colorado.edu Sat Aug 14 12:39:49 2004 From: Fernando.Perez at colorado.edu (Fernando.Perez at colorado.edu) Date: Sat, 14 Aug 2004 10:39:49 -0600 Subject: [SciPy-user] gplt and xplt In-Reply-To: References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com><4050.1092298575@www30.gmx.net><1092326951.411b96275bde0@webmail.colorado.edu><1092347794.14899.12.camel@freyer.sfo.csun.edu> <411D22CD.6030401@colorado.edu> Message-ID: <1092501589.411e4055cdda8@webmail.colorado.edu> Quoting Alan G Isaac : > > This is unfortunate, but beyond my control. The unc-readline author is > > working on it, but for now the only solution is to backpedal to ctypes 0.6. > > Will this involve anything beyond deleting the ctypes folder > and then installing 0.6? I suppose so, but you'll have to give it a try. Best, f From Jeremy.Martin at noaa.gov Sat Aug 14 13:51:08 2004 From: Jeremy.Martin at noaa.gov (Jeremy Martin) Date: Sat, 14 Aug 2004 17:51:08 GMT Subject: [SciPy-user] gplot documentation Message-ID: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov> List, Im new to using Scipy and was wondering where to look for documentation on gplot. Ive looked at the gnuplot webpage but havent found any sections that resemble the functions in the plotting tutorial. Thanks, Jeremy From david.grant at telus.net Sat Aug 14 15:04:03 2004 From: david.grant at telus.net (David Grant) Date: Sat, 14 Aug 2004 12:04:03 -0700 Subject: [SciPy-user] gplt and xplt In-Reply-To: References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> Message-ID: <411E6223.20200@telus.net> Alan G Isaac wrote: > http://biggles.sourceforge.net/ > > > > > Can you summarize your experience with biggles? Biggles rocks. It is a big more object oriented if I remember, compared to the others. The only problem is no one has built biggles for windows with python 2.3, so in my opinion it is not cross-platform. I have no idea if further windows packages will ever be built for future python versions so that's why I stay away from it as a long term solution. I love the graphs it produces and it is very fast. -- 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: 177 bytes Desc: not available URL: From david.grant at telus.net Sat Aug 14 15:07:00 2004 From: david.grant at telus.net (David Grant) Date: Sat, 14 Aug 2004 12:07:00 -0700 Subject: [SciPy-user] gplt and xplt In-Reply-To: <20040813142502.980191F50B2@ws1-2.us4.outblaze.com> References: <20040813142502.980191F50B2@ws1-2.us4.outblaze.com> Message-ID: <411E62D4.2090900@telus.net> Hmmm, you're probably under python 2.3 right? Gary Ruben wrote: >Biggles was the first Python plotting solution I tried to install but it was quite a while ago. I couldn't get it working under Windows so it failed my cross-platform requirement. I haven't tried the more recent version. > >Gary > > > -- 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: 177 bytes Desc: not available URL: From david.grant at telus.net Sat Aug 14 15:08:13 2004 From: david.grant at telus.net (David Grant) Date: Sat, 14 Aug 2004 12:08:13 -0700 Subject: [SciPy-user] gplt and xplt In-Reply-To: <20040813145220.E3611164002@ws1-4.us4.outblaze.com> References: <20040813145220.E3611164002@ws1-4.us4.outblaze.com> Message-ID: <411E631D.40600@telus.net> Gary Ruben wrote: >Alan, >just a comment on your other point - > > > >>Just to note on the particular issue raised by Gary: >>gnuplot.py faces exactly the same problem as gplt but relies >>on the user to implement apprpriate delays. What is unclear >>from the descriptions that I've read is whether this is a >>gnuplot problem or a problem with pipes under Windows. >>If the former, do the gnuplot developers know about it? >> >> > >I always assumed this was a Windows pipe-system problem. I have experienced problems in other arenas with pipes under Win98 but not under Win2k in which the Windows pipe system changed. My experience of flakiness with pipes driving gnuplot also followed this pattern. ie. very occasionally, I get misbehaviour (broken plots) under Win98 but I haven't seen it under Win2k. When I experience a broken plot, I just re-run the script and it's typically fine. I don't use it interactively from Python. > > > > Doubtful. It it was just a Windows pipe problem then the developer would have probably implemented a sleep just for win32 and not for linux-based systems. Unless of course he/she didn't test it throughouly on linux. -- 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: 177 bytes Desc: not available URL: From david.grant at telus.net Sat Aug 14 15:20:44 2004 From: david.grant at telus.net (David Grant) Date: Sat, 14 Aug 2004 12:20:44 -0700 Subject: [SciPy-user] gplt and xplt In-Reply-To: References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> <20040812203743.GB8465@arbutus.physics.mcmaster.ca> <20040812213837.GA9009@arbutus.physics.mcmaster.ca> Message-ID: <411E660C.8060505@telus.net> Hi John, John Hunter wrote: > David> In essence, can I build up two plots independently > David> at the same time? Then save them? > >Not a problem - here the matlab interface is not imported or used. >The use of a separate Figure and FigureCanvas below results from >trying to keep a clean separation from the frontend (Figure) and >backend (Canvas) > > from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas > from matplotlib.figure import Figure > from matplotlib.numerix import rand > > fig1 = Figure() > fig2 = Figure() > > canvas1 = FigureCanvas(fig1) > canvas2 = FigureCanvas(fig2) > > ax1 = fig1.add_subplot(111) > ax2 = fig2.add_axes([0.2, 0.2, 0.5, 0.5]) # a custom axes in fig2 > > ax1.plot([1,2,3]) > > ax2.scatter(rand(12), rand(12)) > > canvas1.print_figure('fig1.svg') # switches to the svg backend > canvas1.print_figure('fig1.png') # native agg saves png > canvas2.print_figure('fig2.eps') # switches to the PS backend > >No call to show, etc.... The hardcopy is created upon executing this >script. Here I take advantage of the fact that most backends (agg in >this case) can switch backends to render to PS/EPS/SVG/PNG depending >on the extension. You don't need to use the switching feature - you >could have directly imported the SVG or PS backend canvas, but I >included it for illustration. > >You use the same approach to create GUI canvases for embedding in an >application, but the constructor args for the FigureCanvas vary >somewhat from backend to backend. And you would have to fire up your >GUI mainloop and realize your windows, etc.. > >Thanks for keeping me honest! I'm working on a users guide and will >include a section along these lines. > > > In the script above, how would you make the graphs show to the screen and not just save to a file? Thanks, -- 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: 177 bytes Desc: not available URL: From aisaac at american.edu Sat Aug 14 15:50:50 2004 From: aisaac at american.edu (Alan G Isaac) Date: Sat, 14 Aug 2004 15:50:50 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplot documentation In-Reply-To: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov> References: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov> Message-ID: On Sat, 14 Aug 2004, Jeremy Martin apparently wrote: > Im new to using Scipy and was wondering where to look for > documentation on gplot. Ive looked at the gnuplot webpage but havent > found any sections that resemble the functions in the plotting > tutorial. http://www.scipy.org/documentation/plottutorial.html hth, Alan Isaac From Fernando.Perez at colorado.edu Sat Aug 14 17:31:42 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Sat, 14 Aug 2004 15:31:42 -0600 Subject: [SciPy-user] gplt and xplt In-Reply-To: <008401c48210$3c86c790$6400a8c0@playroom> References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com><4050.1092298575@www30.gmx.net><1092326951.411b96275bde0@webmail.colorado.edu><1092347794.14899.12.camel@freyer.sfo.csun.edu><411D22CD.6030401@colorado.edu> <008401c48210$3c86c790$6400a8c0@playroom> Message-ID: <411E84BE.9080505@colorado.edu> Gary Pajer wrote: >>Will this involve anything beyond deleting the ctypes folder >>and then installing 0.6? > > > I just installed the old one over the new one and it worked fine. ymmv. > > Fernando, maybe you should put a note on the web site about this. I did a > new install on a new machine and was quite puzzled for a while... Mmh, have you been to the page recently? :) http://ipython.scipy.org/ It's been there since Aug. 3, after I started getting reports about the problem. I'll take it down if a solution comes along (which I expect to happen, Gary Bishop is working on it). Best, f From Fernando.Perez at colorado.edu Sat Aug 14 17:35:15 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Sat, 14 Aug 2004 15:35:15 -0600 Subject: [SciPy-user] gnuplot.py In-Reply-To: <4873.1092476483@www52.gmx.net> References: <1092327166.411b96fe9d0b3@webmail.colorado.edu> <4873.1092476483@www52.gmx.net> Message-ID: <411E8593.30909@colorado.edu> Steve Schmerler wrote: > you mean: > > import Gnuplot > g=Gnuplot.Gnuplot() It's a bit more than that, but hardly much at all: import Gnuplot2 as Gnuplot class NotGiven: pass def gp_new(mouse=NotGiven,persist=NotGiven): """Return a new Gnuplot instance. The instance returned uses the improved methods defined in Gnuplot2. Options (boolean): - mouse: if unspecified, the module global gnuplot_mouse is used. - persist: if unspecified, the module global gnuplot_persist is used.""" if mouse is NotGiven: mouse = gnuplot_mouse if persist is NotGiven: persist = gnuplot_persist g = Gnuplot.Gnuplot(persist=persist) if mouse: g('set mouse') return g Note that Gnuplot2 is IPython's enhanced Gnuplot, with support for a few things the original lacks and which I find indispensable for efficient interactive use. > Every > > g=Gnuplot.Gnuplot() > > kills the current wgnuplot.exe (I'm working on WinXP) as well as the current > plot window and starts a new gnuplot session (new wgnuplot.exe). The problem > is that I want to keep the former plot windows (I want them to appear one > after the other). > > I've read read about the problems with Win on the IPython page. The function > you've mentioned (gp_new()) is a pure IPython feature, right? Yes, but you could either backtrack to ctypes 0.6, or just use the code above. However, it's quite possible that the killing of wgnuplot also happens with this. I don't have access to windows computers, so I can't test on the platform. So I have no idea what will happen there. Best, f From david.grant at telus.net Sat Aug 14 18:13:16 2004 From: david.grant at telus.net (David Grant) Date: Sat, 14 Aug 2004 15:13:16 -0700 Subject: [SciPy-user] gnuplot.py In-Reply-To: <411E8593.30909@colorado.edu> References: <1092327166.411b96fe9d0b3@webmail.colorado.edu> <4873.1092476483@www52.gmx.net> <411E8593.30909@colorado.edu> Message-ID: <411E8E7C.8010905@telus.net> Fernando Perez wrote: > Steve Schmerler wrote: > >> you mean: >> >> import Gnuplot >> g=Gnuplot.Gnuplot() > > > It's a bit more than that, but hardly much at all: > > > import Gnuplot2 as Gnuplot > > class NotGiven: pass > > def gp_new(mouse=NotGiven,persist=NotGiven): > """Return a new Gnuplot instance. > > The instance returned uses the improved methods defined in Gnuplot2. > > Options (boolean): > > - mouse: if unspecified, the module global gnuplot_mouse is used. > > - persist: if unspecified, the module global gnuplot_persist is > used.""" > > if mouse is NotGiven: > mouse = gnuplot_mouse > if persist is NotGiven: > persist = gnuplot_persist > g = Gnuplot.Gnuplot(persist=persist) > if mouse: > g('set mouse') > return g > > Note that Gnuplot2 is IPython's enhanced Gnuplot, with support for a > few things the original lacks and which I find indispensable for > efficient interactive use. I'm just curious; was it not possible to just apply patches to Gnuplot.py instead of creating a new module? -- 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: 177 bytes Desc: not available URL: From bill.blum at sbcglobal.net Sat Aug 14 18:53:05 2004 From: bill.blum at sbcglobal.net (William Blum) Date: Sat, 14 Aug 2004 18:53:05 -0400 Subject: [SciPy-user] Question re: Building on FreeBSD Message-ID: <411E97D1.1020309@sbcglobal.net> Okay, count me as another person interested in getting SciPy working on FreeBSD... Anyways-- I've run into a problem, error message included below: --- compling C sources cc options: '-fno-strict-aliasing -DNDEBUG -O -pipe -march=pentium4 -D_THREAD_SA FE -DTHREAD_STACK_SIZE=0x100000 -fPIC' compile options: '-DUSE_MCONF_LITE_LE -I/usr/local/include/python2.3 -c' cc: scipy_core/scipy_base/fastumathmodule.c In file included from scipy_core/scipy_base/fastumathmodule.c:27: scipy_core/scipy_base/fastumath_unsigned.inc:2784: error: `acosh' undeclared her e (not in a function) scipy_core/scipy_base/fastumath_unsigned.inc:2784: error: initializer element is not constant (rest deleted) ---- I went to the mailing archives first, found a message from Pearu suggesting the use of -UHAVE_INVERSE_HYPERBOLIC to solve this... My question is: where on earth do I need to put that in the setup files so that it gets appended as an option to the compiler? Thanks for your help. -Bill Blum From bill.blum at sbcglobal.net Sat Aug 14 19:07:40 2004 From: bill.blum at sbcglobal.net (William Blum) Date: Sat, 14 Aug 2004 19:07:40 -0400 Subject: [SciPy-user] Another Question re: FreeBSD ( was Question re: Building on FreeBSD ) Message-ID: <411E9B3C.8030007@sbcglobal.net> Okay, after even more googling, I found matt (at) hotdispatch (dot) com's solution of commenting out the #ifdef for HAVE_INVERSE_HYPERBOLIC. My install got a little bit farther this time... ----error excerpt below---- compile options: '-I/usr/local/include/python2.3 -c' cc: scipy_core/scipy_base/_compiled_base.c scipy_core/scipy_base/_compiled_base.c:753:28: _scipy_mapping.c: No such file or directory ---- ---- Oh, and for the record: I'm using a tarball from the CVS sources. From rkern at ucsd.edu Sat Aug 14 19:16:27 2004 From: rkern at ucsd.edu (Robert Kern) Date: Sat, 14 Aug 2004 18:16:27 -0500 Subject: [SciPy-user] Question re: Building on FreeBSD In-Reply-To: <411E97D1.1020309@sbcglobal.net> References: <411E97D1.1020309@sbcglobal.net> Message-ID: <411E9D4B.1080203@ucsd.edu> William Blum wrote: > Okay, count me as another person interested in getting SciPy working on > FreeBSD... [snip] > I went to the mailing archives first, found a message from Pearu > suggesting the use of -UHAVE_INVERSE_HYPERBOLIC to solve this... > > > My question is: where on earth do I need to put that in the setup > files so that it gets appended as an option to the compiler? python setup.py build_src build_clib -UHAVE_INVERSE_HYPERBOLIC build_ext -UHAVE_INVERSE_HYPERBOLIC build install I generally put all this gunk into a tiny shell script call "mybuild" and run that every time I need to rebuild SciPy. I hope this works. I have not tested it, not being on FreeBSD. > Thanks for your help. > > -Bill Blum -- 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 pajer at iname.com Sat Aug 14 19:51:49 2004 From: pajer at iname.com (Gary Pajer) Date: Sat, 14 Aug 2004 19:51:49 -0400 Subject: [SciPy-user] gplt and xplt References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com><4050.1092298575@www30.gmx.net><1092326951.411b96275bde0@webmail.colorado.edu><1092347794.14899.12.camel@freyer.sfo.csun.edu><411D22CD.6030401@colorado.edu><008401c48210$3c86c790$6400a8c0@playroom> <411E84BE.9080505@colorado.edu> Message-ID: <003b01c48259$b0801220$6400a8c0@playroom> ----- Original Message ----- From: "Fernando Perez" > Gary Pajer wrote: > > >>Will this involve anything beyond deleting the ctypes folder > >>and then installing 0.6? > > > > > > I just installed the old one over the new one and it worked fine. ymmv. > > > > Fernando, maybe you should put a note on the web site about this. I did a > > new install on a new machine and was quite puzzled for a while... > > Mmh, have you been to the page recently? :) > > http://ipython.scipy.org/ > > It's been there since Aug. 3, The problem is that the font is too big, and it's too close to the top of the page. If you had written it in a tiny hard to read font, and buried it on page six, I would have seen it. :) From Fernando.Perez at colorado.edu Sat Aug 14 20:06:26 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Sat, 14 Aug 2004 18:06:26 -0600 Subject: [SciPy-user] gnuplot.py In-Reply-To: <411E8E7C.8010905@telus.net> References: <1092327166.411b96fe9d0b3@webmail.colorado.edu> <4873.1092476483@www52.gmx.net> <411E8593.30909@colorado.edu> <411E8E7C.8010905@telus.net> Message-ID: <411EA902.6080102@colorado.edu> David Grant wrote: >>Note that Gnuplot2 is IPython's enhanced Gnuplot, with support for a >>few things the original lacks and which I find indispensable for >>efficient interactive use. > > > I'm just curious; was it not possible to just apply patches to > Gnuplot.py instead of creating a new module? I sent Michael Haggerty, the author of gnuplot.py, all of that code so he could incorporate whatever he wanted into the mainline. He took some things, but not all, and I _need_ that functionality for everyday work. Note that my module requires Gnuplot.py, it simply imports it and overrides a few key methods (plot and a few others) to provide better functionality. Michael is free to take that code and use it. But in the meantime, I want ipython users to have an easy out-of-the box system, where they can simply get the normal gnuplot, install ipython, and automatically get all the enhancements. Best, f From bill.blum at sbcglobal.net Sat Aug 14 20:16:24 2004 From: bill.blum at sbcglobal.net (William Blum) Date: Sat, 14 Aug 2004 20:16:24 -0400 Subject: [SciPy-user] Re: Question re: Building on FreeBSD In-Reply-To: <20040815001113.77FC63EB7D@www.scipy.com> References: <20040815001113.77FC63EB7D@www.scipy.com> Message-ID: <411EAB58.4040403@sbcglobal.net> Robert Kern wrote: --- python setup.py build_src build_clib -UHAVE_INVERSE_HYPERBOLIC build_ext -UHAVE_INVERSE_HYPERBOLIC build install I generally put all this gunk into a tiny shell script call "mybuild" and run that every time I need to rebuild SciPy. I hope this works. I have not tested it, not being on FreeBSD. --- Okay, that *almost* worked for me... I had to edit two files to replace 'malloc.h' with 'stdlib.h', and eliminated the first mention of HAVE_INVERSE_HYPERBOLIC from your suggested build command.... and it actually completed building. However, it failed 15 of the selftests. ( more info later, being called away from computer ). Thanks for your help. - Bill Blum From Fernando.Perez at colorado.edu Sat Aug 14 20:22:18 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Sat, 14 Aug 2004 18:22:18 -0600 Subject: [SciPy-user] gplot documentation In-Reply-To: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov> References: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov> Message-ID: <411EACBA.50803@colorado.edu> Jeremy Martin wrote: > List, > > Im new to using Scipy and was wondering where to look for > documentation on gplot. Ive looked at the gnuplot webpage but havent > found any sections that resemble the functions in the plotting > tutorial. With no offense to the core scipy team (I'm an avid user of scipy for all my work _except_ plotting), I think you'd be better served right now with another alternative. Scipy has been slowly developing a very ambitious graphics framework called Chaco, but the project isn't really useful to end users yet. I personally have been using Gnuplot.py (with the additions provided by ipython, which IMHO are absolutely critical to real-world efficient use, especially interactively). But I have been keeping a close eye on matplotlib, and with the latest release (from this past Monday), I think it passed a turning point in usability. Now, I've started promoting it to my coworkers who didn't have tons of gnuplot-based scripts like I do. I will probably transition more slowly, but I'm already working on giving ipython gtk-threading support so it integrates nicely with all of matplotlib's backends. In case you are curious, the key additions to matplotlib which just made it pass _my_ criteria were: 1. Mathtext (latex equations) support in the PS/EPS backend. This is absolutely critical for our regular latex-based workflow. 2. Zooming/panning in the interactive plot windows. I pestered John to add to matplotlib these features in the manner which gnuplot 4.0 supports (I use them constantly, and they are critical to my daily workflow). He was extremely receptive to all my suggestions, and they were available in short order. I _really_ like matplotlib, because it provides today a system which matches the various usage scenarios I need: - concise, efficient syntax for quick interactive use. One-off plots of data when developing code, where you need zero fancy features, but you need to do them quickly and with the _absolute_ minimum amount of typing possible. plot(x) should simply plot the x array against its indices. - a real object-oriented framework for more complex things where the plots are generated by a program. There, extreme conciseness is not the key feature. Instead, a clean object model with programmatic access to all parts of the graph is critical. - the ability to plot either to screen or to generate many plots to eps on disk without ever opening a gui. I have automated test suites which need to run without opening a plotting window, but make many plots as they go. - the same library also exposes its functionality as widgets for wxpython. This means that making a gui program which needs sophisticated plotting is not a problem anymore (that's simply impossible with gnuplot, which was never conceived for such purposes). Besides, it has: - easy generation of all common image formats - array plotting as colormaps. For image processing and even a lot of linear algebra things, this is very useful and non-existent in gnuplot (I think there are patches around for it, but it's not in mainline). Matplotlib still has a few rough edges, but it's improving steadily and I see the overall foundations as being solid enough, that I'm willing to bet my own time by working on ipython support for it. I think that the following trio of systems makes an extremely good base for the graphical side of scientific work today in python: - Matplotlib: regular 2d plots (interactive or scripted), array/image plots, gui-building. - MayaVi: sophisticated 3d visualization, volumetric rendering, etc. - PyX: algorithmic generation of high-quality postscript diagrams with latex equations. Replacing matplotlib with gnuplot at this moment, I have incorporated these tools into fairly complex codes in a very smooth way. After having fought the hell of IDL (matlab is probably similar), the power these tools provide, and their simplicity and elegance, are really a pleasure. I hope this is useful. Best, f From elcorto at gmx.net Sun Aug 15 10:34:36 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Sun, 15 Aug 2004 16:34:36 +0200 (MEST) Subject: [SciPy-user] gplt and xplt References: <411E6223.20200@telus.net> Message-ID: <8396.1092580476@www26.gmx.net> David Grant: > Alan G Isaac wrote: > > > http://biggles.sourceforge.net/ > > > > > > > > > > Can you summarize your experience with biggles? > > Biggles rocks. It is a big more object oriented if I remember, compared > to the others. The only problem is no one has built biggles for windows > with python 2.3, so in my opinion it is not cross-platform. I have no > idea if further windows packages will ever be built for future python > versions so that's why I stay away from it as a long term solution. I > love the graphs it produces and it is very fast. > > -- > David J. Grant > http://www.davidgrant.ca:81 > Hmm, I found a Win32 installer for Python 2.3x on the biggles page. bye steve -- If you can't beat your computer at chess, try kickboxing. -- NEU: WLAN-Router f?r 0,- EUR* - auch f?r DSL-Wechsler! GMX DSL = superg?nstig & kabellos http://www.gmx.net/de/go/dsl From jdhunter at ace.bsd.uchicago.edu Sun Aug 15 12:23:58 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Sun, 15 Aug 2004 11:23:58 -0500 Subject: [SciPy-user] gplt and xplt In-Reply-To: <411E660C.8060505@telus.net> (David Grant's message of "Sat, 14 Aug 2004 12:20:44 -0700") References: <20040812050051.2FB1E1F50B1@ws1-2.us4.outblaze.com> <20040812203743.GB8465@arbutus.physics.mcmaster.ca> <20040812213837.GA9009@arbutus.physics.mcmaster.ca> <411E660C.8060505@telus.net> Message-ID: >>>>> "David" == David Grant writes: David> In the script above, how would you make the graphs show to David> the screen and not just save to a file? Just to make sure we are clear - David Cook asked specifically about using the pure OO API rather than the matlab interface. If all you want to do is show some graphs to the screen, the easiest way is to use the matlab interface (I'll be happy to provide a sample) because it manages all the complexities of creating the navigation toolbar, creating and realizing the figure windows, etc... But I'm assuming you indeed want to know how to use the OO API to show figures to the screen. There are a number of examples in the matplotlib/examples directory of the src distribution (also at http://matplotlib.sourceforge.net/examples). How you do this depends on the GUI package you are using (Tkinter, pygtk, wxpython...). See for example embedding_in_gtk2.py, mbedding_in_tk.py, and embedding_in_wx2.py. Basically, to create multiple figures using the API, you instantiate multiple canvases for the backend of your choice, as in the example above but importing a different canvas, eg FigureCanvasWXAgg. Then you embed these canvases in a GUI window (all the matplotlib GUI FigureCanvases derive from a widget that can be directly embedded in a GUI windowm Let me know if you have any more questions or if these examples above aren't clear. JDH From aisaac at american.edu Sun Aug 15 13:21:59 2004 From: aisaac at american.edu (Alan G Isaac) Date: Sun, 15 Aug 2004 13:21:59 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplot documentation In-Reply-To: <411EACBA.50803@colorado.edu> References: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov><411EACBA.50803@colorado.edu> Message-ID: On Sat, 14 Aug 2004, Fernando Perez apparently wrote: > I think that the following trio of systems makes an extremely good base for > the graphical side of scientific work today in python: > - Matplotlib: regular 2d plots (interactive or scripted), array/image plots, > gui-building. > - MayaVi: sophisticated 3d visualization, volumetric rendering, etc. > - PyX: algorithmic generation of high-quality postscript diagrams with latex > equations. This post was extremely useful. One ambiguity remained for me: are you suggested PyX remains better than Matplotlib if you need LaTeX equations in your EPS files? Thank you, Alan Isaac From jdhunter at ace.bsd.uchicago.edu Sun Aug 15 14:02:30 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Sun, 15 Aug 2004 13:02:30 -0500 Subject: [SciPy-user] gplot documentation In-Reply-To: (Alan G Isaac's message of "Sun, 15 Aug 2004 13:21:59 -0400 (Eastern Daylight Time)") References: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov> <411EACBA.50803@colorado.edu> Message-ID: >>>>> "Alan" == Alan G Isaac writes: Alan> This post was extremely useful. One ambiguity remained for Alan> me: are you suggested PyX remains better than Matplotlib if Alan> you need LaTeX equations in your EPS files? matplotlib and pyx take different approaches to mathtext. PyX uses TeX to typeset the mathematical expressions, and so by definition has full TeX support and awesome rendering. matplotlib uses a custom parser and layout engine, and does not support the full range of TeX expressions (eg there is no \frac command yet). Also, TeX does superior layout - I don't pretend to be Donald Knuth, nor did I spend 10 years working on it :-) So if you need the full power of TeX, only need ps/eps output, and have access to a TeX install on all the platforms on which you work, PyX will be the better choice. What matplotlib offers vis-a-vis mathtext that pyx doesn't is * totally self contained solution - no extra packages required. Cross platform, etc. * mathtext for non-PS outputs (PNG, GUI window) in addition to PS/EPS. Thus you can use mathtext anywhere in your figure in any GTK/WX/Tkinter/FLTK application or save it to hardcopy PNG, eg for a powerpoint presentation. matplotlib uses the computer modern fonts, so the equations will look very similar to TeX equations. And while there is nothing like full TeX support, there is nonetheless substantial support: almost all of the TeX symbols, over/under subscripting with {} groups, fonts, ... see http://matplotlib.sourceforge.net/matplotlib.mathtext.html for more info. Hope this helps, JDH From david.grant at telus.net Sun Aug 15 16:09:20 2004 From: david.grant at telus.net (David Grant) Date: Sun, 15 Aug 2004 13:09:20 -0700 Subject: [SciPy-user] gplt and xplt In-Reply-To: <8396.1092580476@www26.gmx.net> References: <411E6223.20200@telus.net> <8396.1092580476@www26.gmx.net> Message-ID: <411FC2F0.3090105@telus.net> Steve Schmerler wrote: >David Grant: > > > >>Alan G Isaac wrote: >> >> >> >>>http://biggles.sourceforge.net/ >>> >>> >>> >>> >>>Can you summarize your experience with biggles? >>> >>> >>Biggles rocks. It is a big more object oriented if I remember, compared >>to the others. The only problem is no one has built biggles for windows >>with python 2.3, so in my opinion it is not cross-platform. I have no >>idea if further windows packages will ever be built for future python >>versions so that's why I stay away from it as a long term solution. I >>love the graphs it produces and it is very fast. >> >>-- >>David J. Grant >>http://www.davidgrant.ca:81 >> >> >> > >Hmm, I found a Win32 installer for Python 2.3x on the biggles page. > > Well that's something very new then. -- 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: 177 bytes Desc: not available URL: From Fernando.Perez at colorado.edu Sun Aug 15 18:58:07 2004 From: Fernando.Perez at colorado.edu (Fernando.Perez at colorado.edu) Date: Sun, 15 Aug 2004 16:58:07 -0600 Subject: [SciPy-user] gplot documentation In-Reply-To: References: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov><411EACBA.50803@colorado.edu> Message-ID: <1092610687.411fea7f81ccf@webmail.colorado.edu> Quoting Alan G Isaac : > On Sat, 14 Aug 2004, Fernando Perez apparently wrote: > > I think that the following trio of systems makes an extremely good base for > > the graphical side of scientific work today in python: > > - Matplotlib: regular 2d plots (interactive or scripted), array/image > plots, > > gui-building. > > - MayaVi: sophisticated 3d visualization, volumetric rendering, etc. > > - PyX: algorithmic generation of high-quality postscript diagrams with > latex > > equations. > > > This post was extremely useful. One ambiguity remained for > me: are you suggested PyX remains better than Matplotlib if > you need LaTeX equations in your EPS files? John already addressed the key points better than I can, so just let me add a few details, since I realize my original post wasn't too clear on this point. I think what I meant is best explained with a real world example: http://amath.colorado.edu/faculty/fperez/tmp/04_03_ams_athens.pdf contains examples of a fairly complex code which integrates mayavi, pyx and gnuplot (read matplotlib for future uses, this was done months ago). All the plots and figures you find there are actually methods built into my function and operator objects, which makes interactive work a dream. They call whichever library is best suited for a given task, whether it's 2d plots (gnuplot/matplotlib), 3d surfaces (mayavi) or what I call 'diagrams' (pyx). The distinction between what pyx does and tools like gnuplot/matplotlib is best seen by looking at diagrams like those on pages numbered 6 and 8 (pyx diagrams) vs the more common plots of page 5, for example. Those diagrams, which represent adaptive decompositions of domains in 1 and 2d, don't really fit into the normal definition of a 'plot', so they'd be very hard to generate with a tool like gnuplot or matplotlib. Yet pyx, which is more of an object-oriented frontend to Postscript, makes it very easy to produce them. You get a canvas, and you can say 'put blue squares of this size at all these coordinates, an arrow here, a label here, red squares here, fill these in, etc'. Perhaps matplotlib also offers tools for this task; with gnuplot it would definitely be a major uphill battle to get it done. I'm sure you _could_, but you would feel like you were beating your tool into doing something it wasn't really designed for. PyX, on the other hand makes it very natural. A good example of this is on the pyx page: the code to produce a beautiful Sierpinski triangle is just a few lines, because the problem is so simple to express algorithmically. For a 'plotting' program this would be a far less natural task, I think. I hope this clarifies where I see the two tools complementing each other, in addition to John's comments. Best, f From jdhunter at ace.bsd.uchicago.edu Sun Aug 15 19:19:40 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Sun, 15 Aug 2004 18:19:40 -0500 Subject: [SciPy-user] gplot documentation In-Reply-To: <1092610687.411fea7f81ccf@webmail.colorado.edu> (Fernando.Perez@colorado.edu's message of "Sun, 15 Aug 2004 16:58:07 -0600") References: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov> <411EACBA.50803@colorado.edu> <1092610687.411fea7f81ccf@webmail.colorado.edu> Message-ID: >>>>> "Fernando" == Fernando Perez writes: Fernando> Perhaps matplotlib also offers tools for this task; with Fernando> gnuplot it would definitely be a major uphill battle to Fernando> get it done. I'm sure you _could_, but you would feel Fernando> like you were beating your tool into doing something it Fernando> wasn't really designed for. PyX, on the other hand Fernando> makes it very natural. A good example of this is on the Fernando> pyx page: the code to produce a beautiful Sierpinski Fernando> triangle is just a few lines, because the problem is so Fernando> simple to express algorithmically. For a 'plotting' Fernando> program this would be a far less natural task, I think. I second this. While it is possible to draw block/state diagrams in gnuplot/matplotlib/your-favorite plotting package because you can create all the primitives (lines, text, rectangles, polygons) it's not easy w/o some dedicated code to support the task. One could certainly add them, eg when John Gill wrote a table class for matplotlib, creating a Cell and Table class to do the layout, but as Fernando says, w/o this extra support, these diagrams won't come naturally. Some day some enterprising young soul will probably come along and add support, but until then pyx, graphviz, omnigrafflle, or any one of the many latex macro packages will serve better. JDH From Fernando.Perez at colorado.edu Sun Aug 15 19:50:40 2004 From: Fernando.Perez at colorado.edu (Fernando.Perez at colorado.edu) Date: Sun, 15 Aug 2004 17:50:40 -0600 Subject: [SciPy-user] gplot documentation In-Reply-To: References: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov> <411EACBA.50803@colorado.edu> <1092610687.411fea7f81ccf@webmail.colorado.edu> Message-ID: <1092613840.411ff6d06b0d6@webmail.colorado.edu> Quoting John Hunter : > Some day some enterprising young soul will probably come along and add > support, but until then pyx, graphviz, omnigrafflle, or any one of the > many latex macro packages will serve better. Let me add that I don't view this as a limitation of matplotlib in any way. I think that pyx and matplotlib address different problem domains (albeit with some overlap, since pyx also has normal 'plotting'). I'm happy to have _both_ tools, and I just use the one that is best suited to the task at hand. Best, f From aisaac at american.edu Sun Aug 15 18:16:24 2004 From: aisaac at american.edu (Alan G Isaac) Date: Sun, 15 Aug 2004 18:16:24 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplot documentation In-Reply-To: References: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov><411EACBA.50803@colorado.edu> Message-ID: On Sun, 15 Aug 2004, John Hunter apparently wrote: > So if you need the full power of TeX, only need ps/eps output, and > have access to a TeX install on all the platforms on which you work, > PyX will be the better choice. > What matplotlib offers vis-a-vis mathtext that pyx doesn't is > * totally self contained solution - no extra packages required. > Cross platform, etc. > * mathtext for non-PS outputs (PNG, GUI window) in addition to > PS/EPS. Thus you can use mathtext anywhere in your figure in any > GTK/WX/Tkinter/FLTK application or save it to hardcopy PNG, eg for > a powerpoint presentation. > matplotlib uses the computer modern fonts, so the equations will look > very similar to TeX equations. And while there is nothing like full > TeX support, there is nonetheless substantial support: almost all of > the TeX symbols, over/under subscripting with {} groups, fonts, > ... see http://matplotlib.sourceforge.net/matplotlib.mathtext.html for > more info. Very helpful! I've decide to give matplotlib a try. I probably should note that the earlier discussion showing that matplotlib allows an object oriented approach to plot generation was important to this decision. Thanks, Alan Isaac From jdhunter at ace.bsd.uchicago.edu Mon Aug 16 09:38:02 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Mon, 16 Aug 2004 08:38:02 -0500 Subject: [SciPy-user] gplot documentation In-Reply-To: (Alan G Isaac's message of "Sun, 15 Aug 2004 18:16:24 -0400 (Eastern Daylight Time)") References: <114352113c8b.113c8b114352@noaa.gov crmsg1.crh.noaa.gov> <411EACBA.50803@colorado.edu> Message-ID: >>>>> "Alan" == Alan G Isaac writes: Alan> Very helpful! I've decide to give matplotlib a try. I Alan> probably should note that the earlier discussion showing Alan> that matplotlib allows an object oriented approach to plot Alan> generation was important to this decision. Great! Thanks for letting me know - I'll be sure to emphasize the OO usage in the users guide, which I'm hoping to have it ready by SciPy. We shall see... JDH From gpajer at rider.edu Mon Aug 16 11:03:56 2004 From: gpajer at rider.edu (gpajer at rider.edu) Date: Mon, 16 Aug 2004 11:03:56 -0400 (EDT) Subject: [SciPy-user] gplot documentation In-Reply-To: <1092610687.411fea7f81ccf@webmail.colorado.edu> References: <411EACBA.50803@colorado.edu> <1092610687.411fea7f81ccf@webmail.colorado.edu> Message-ID: <3182.10.68.2.14.1092668636.squirrel@10.68.2.14> > Quoting Alan G Isaac : > >> On Sat, 14 Aug 2004, Fernando Perez apparently wrote: > http://amath.colorado.edu/faculty/fperez/tmp/04_03_ams_athens.pdf > > contains examples of a fairly complex code which integrates mayavi, pyx > and > gnuplot (read matplotlib for future uses, this was done months ago). This pdf along with your description of your computing environment (posted a few days ago) are priceless. A few questions about the presentation: I assume the equations were generated in TeX. What font is that? Did you generate the presentation in PowerPoint, or a LaTeX (or ConTeXt?) presentation style? Or OpenOffice.org? [Wait ... wouldn't be PowerPoint ... you're on Linux ...] Or did you use PyX to generate the equations? >All > the > plots and figures you find there are actually methods built into my > function > and operator objects, which makes interactive work a dream. They call > whichever library is best suited for a given task, whether it's 2d plots > (gnuplot/matplotlib), 3d surfaces (mayavi) or what I call 'diagrams' > (pyx). I'm not sure I understand, but I'm more than a little interested in making "interactive work a dream". Could you elaborate a bit: What do your functions and objects do? Do you mean that the function and operator objects have "side effect" (in distinction from methods that I might call "primary" in the sense that they do mathematical processing and whatnot) methods that create appropriate plots? And much thanks for your contributions to the community. -gary From Fernando.Perez at colorado.edu Mon Aug 16 13:09:18 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Mon, 16 Aug 2004 11:09:18 -0600 Subject: [SciPy-user] gplot documentation In-Reply-To: <3182.10.68.2.14.1092668636.squirrel@10.68.2.14> References: <411EACBA.50803@colorado.edu> <1092610687.411fea7f81ccf@webmail.colorado.edu> <3182.10.68.2.14.1092668636.squirrel@10.68.2.14> Message-ID: <4120EA3E.7090306@colorado.edu> gpajer at rider.edu wrote: >>>On Sat, 14 Aug 2004, Fernando Perez apparently wrote: > > >>http://amath.colorado.edu/faculty/fperez/tmp/04_03_ams_athens.pdf >> >>contains examples of a fairly complex code which integrates mayavi, pyx >>and >>gnuplot (read matplotlib for future uses, this was done months ago). > > This pdf along with your description of your computing environment (posted > a few days ago) are priceless. > > A few questions about the presentation: > > I assume the equations were generated in TeX. What font is that? > Did you generate the presentation in PowerPoint, or a LaTeX (or ConTeXt?) > presentation style? Or OpenOffice.org? > [Wait ... wouldn't be PowerPoint ... you're on Linux ...] > Or did you use PyX to generate the equations? The document is latex, but it was actually written using LyX. My preamble contains: % Packages to get good-looking PDFs \usepackage[T1]{fontenc} \usepackage{ae,aecompl} \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet} The last two select the fonts for math you are asking about. I prefer them over Computer Modern for presentations, because many lines in the CM fonts are extremely thin and display very poorly on typical 1024x768 LCD projectors. This Euler font has thicker lines, and results in more readable presentations on low-resolution displays. Incidentally, this is the font used by Knuth in his Discrete Math text, so it's not only a screen font, it's just much less well known than the CM family. The CM fonts print very well, but a laser printer has MUCH more resolution than an LCD projector. On a side note, lyx is a very pleasant environment for scientific document creation, esp. when combined with pybliographic for bibliography management (accidentally another remarkable python program, see the trend ? :). And some in the Lyx team have been very receptive to the idea of having a mathematica-like environment (I'm talking about the notebook interface, not the symbolic capabilities) for python use based on Lyx. But this is a topic for another day... >>All >>the >>plots and figures you find there are actually methods built into my >>function >>and operator objects, which makes interactive work a dream. They call >>whichever library is best suited for a given task, whether it's 2d plots >>(gnuplot/matplotlib), 3d surfaces (mayavi) or what I call 'diagrams' >>(pyx). > > > I'm not sure I understand, but I'm more than a little interested in making > "interactive work a dream". > > Could you elaborate a bit: What do your functions and objects do? > Do you mean that the function and operator objects have "side effect" (in > distinction from methods that I might call "primary" in the sense that > they do mathematical processing and whatnot) methods that create > appropriate plots? Exactly. They either have methods which directly generate plots when appropriate, or which return other objects suitable for plotting. For example, a Poisson kernel has things like: poisson.plot_kernel_err -> plots the error in the approximation of the kernel poisson.norm2sc_table -> return a dict of arrays which can be plotted directly with the plot2() routine included in ipython's gnuplot extensions (this allows plotting of dicts of arrays, with an auto-generated legend by key, extremely useful for many of my codes). poisson.info, poisson.info_norm, poisson.info_ranges -> these print various useful information about many mathematical details of the object, useful in debugging and benchmarkig. etc... The idea is that instead of writing monolithic codes which are meant to be only run in batch mode, I create objects whose methods (by calling mayavi, gnuplot, pyx, or simply printing out stuff) make them very flexible and convenient at the interactive prompt. Combined with ipython, which gives me via @run and @pdb a rapid test/debug/profile environment, I find that I can work in a way which is far more flexible and pleasant than the style with traditional 'big' C/Fortran codes. Note that since all of these methods are inside the objects, they can still be used in batch mode if needed, by simply redirecting the plots to files instead of to the screen. This way, the library automatically comes with builtin, 'smart' plotting (smart in the sense that each plotting method knows how to generate the appropriate plot, scale the axes, labels, etc. This is better than spitting out plain text files and relying on a jumble of semi-random external plotting scripts which _always_ get lost or fall out of sync with the core code). I hope this is useful. Your questions have given me an idea about my next talk at scipy'04. Instead of talking only about the mathematical side of this stuff, I may include a bit on this workflow. It may not necessarily be obvious to everybody how efficient this combination can be. I still see people using python as a regular write/compile/run language, just with the convenience that the compilation step is automatic for them. In my opinion, this is a dramatic underuse of python's potential for scientific development. > And much thanks for your contributions to the community. Thanks for the feedback, I'm glad you've found my stuff useful. Best, f From eric at enthought.com Mon Aug 16 13:42:11 2004 From: eric at enthought.com (eric jones) Date: Mon, 16 Aug 2004 12:42:11 -0500 Subject: [SciPy-user] ANN: Python/Scientific Job openings at Enthought Message-ID: <4120F1F3.4020006@enthought.com> Hey Folks, Enthought continues to grow, and we're hiring again. There are several positions open, and most of them involve python+scientific computing. A couple of the positions also involve support of SciPy. I'm very interested in finding a person for the "scientist" job posting that is both able to work well with our customers and also has the personality and interest to work with the SciPy community to help push the library forward. More information is available on our web site. http://www.enthought.com/careers.htm Our current development efforts are in the areas of electromagnetics, geophysics, and graphics (2D and 3D). If you have any questions, please feel free to contact me. Please forward the link to anyone you feel might be interested. thanks, eric From prabhu at aero.iitm.ernet.in Mon Aug 16 13:48:43 2004 From: prabhu at aero.iitm.ernet.in (Prabhu Ramachandran) Date: Mon, 16 Aug 2004 13:48:43 -0400 Subject: [SciPy-user] gplot documentation In-Reply-To: <4120EA3E.7090306@colorado.edu> References: <411EACBA.50803@colorado.edu> <1092610687.411fea7f81ccf@webmail.colorado.edu> <3182.10.68.2.14.1092668636.squirrel@10.68.2.14> <4120EA3E.7090306@colorado.edu> Message-ID: <16672.62331.502685.190544@enthought.hathway.com> >>>>> "FP" == Fernando Perez writes: [snip] I'm honestly surprised that more folks don't use this kind of workflow. All the interactive work for my PhD was via IPython and several classes and Python scripts I wrote. For plots I used Grace with Nathan Gray's gracePlot.py and MayaVi for the 3D stuff. FP> Your questions have given me an idea about my next talk at FP> scipy'04. Instead of talking only about the mathematical side FP> of this stuff, I may include a bit FP> on this workflow. It may not necessarily be obvious to FP> everybody how FP> efficient this combination can be. I still see people using FP> python as a regular write/compile/run language, just with the FP> convenience that the compilation step is automatic for them. Most of my talk will focus on showing how Python (plus several useful modules) combined with C/C++/Fortran is one hell of a combination for scientific computation. I think the math part is fun. However it is not as generally useful (to the audience) as a good demonstration of the amazing power of Python for scientific computing. FP> In my opinion, this is a dramatic underuse of python's FP> potential for scientific development. Absolutely. cheers, prabhu From Fernando.Perez at colorado.edu Mon Aug 16 13:54:55 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Mon, 16 Aug 2004 11:54:55 -0600 Subject: [SciPy-user] gplot documentation In-Reply-To: <16672.62331.502685.190544@enthought.hathway.com> References: <411EACBA.50803@colorado.edu> <1092610687.411fea7f81ccf@webmail.colorado.edu> <3182.10.68.2.14.1092668636.squirrel@10.68.2.14> <4120EA3E.7090306@colorado.edu> <16672.62331.502685.190544@enthought.hathway.com> Message-ID: <4120F4EF.30400@colorado.edu> Prabhu Ramachandran wrote: >>>>>>"FP" == Fernando Perez writes: > > > [snip] > > I'm honestly surprised that more folks don't use this kind of > workflow. All the interactive work for my PhD was via IPython and > several classes and Python scripts I wrote. For plots I used Grace > with Nathan Gray's gracePlot.py and MayaVi for the 3D stuff. Well, that's my view as well, but I wonder if it's universally known or not. Do you think it's worth presenting this to a large audience, or will we just get yawns about the obviousness of it all? f From prabhu at aero.iitm.ernet.in Mon Aug 16 14:06:13 2004 From: prabhu at aero.iitm.ernet.in (Prabhu Ramachandran) Date: Mon, 16 Aug 2004 14:06:13 -0400 Subject: [SciPy-user] gplot documentation In-Reply-To: <4120F4EF.30400@colorado.edu> References: <411EACBA.50803@colorado.edu> <1092610687.411fea7f81ccf@webmail.colorado.edu> <3182.10.68.2.14.1092668636.squirrel@10.68.2.14> <4120EA3E.7090306@colorado.edu> <16672.62331.502685.190544@enthought.hathway.com> <4120F4EF.30400@colorado.edu> Message-ID: <16672.63381.722337.117376@enthought.hathway.com> >>>>> "FP" == Fernando Perez writes: FP> Prabhu Ramachandran wrote: >>>>>>> "FP" == Fernando Perez >>>>>>> writes: >> [snip] >> >> I'm honestly surprised that more folks don't use this kind of >> workflow. All the interactive work for my PhD was via IPython >> and several classes and Python scripts I wrote. For plots I >> used Grace with Nathan Gray's gracePlot.py and MayaVi for the >> 3D stuff. FP> Well, that's my view as well, but I wonder if it's universally FP> known or not. Do you think it's worth presenting this to a FP> large audience, or will we just get yawns about the FP> obviousness of it all? No clue. I guess some section of the audience will yawn one way or another (hopefully not either way though). ;-) cheers, prabhu From gpajer at rider.edu Mon Aug 16 14:47:31 2004 From: gpajer at rider.edu (gpajer at rider.edu) Date: Mon, 16 Aug 2004 14:47:31 -0400 (EDT) Subject: [SciPy-user] gplot documentation In-Reply-To: <16672.63381.722337.117376@enthought.hathway.com> References: <411EACBA.50803@colorado.edu> <1092610687.411fea7f81ccf@webmail.colorado.edu> <3182.10.68.2.14.1092668636.squirrel@10.68.2.14> <4120EA3E.7090306@colorado.edu> <16672.62331.502685.190544@enthought.hathway.com> <4120F4EF.30400@colorado.edu> <16672.63381.722337.117376@enthought.hathway.com> Message-ID: <3288.10.68.2.14.1092682051.squirrel@10.68.2.14> >>>>>> "FP" == Fernando Perez writes: > > FP> Prabhu Ramachandran wrote: > >>>>>>> "FP" == Fernando Perez > >>>>>>> writes: > >> [snip] > >> > >> I'm honestly surprised that more folks don't use this kind of > >> workflow. All the interactive work for my PhD was via IPython > >> and several classes and Python scripts I wrote. For plots I > >> used Grace with Nathan Gray's gracePlot.py and MayaVi for the > >> 3D stuff. > > FP> Well, that's my view as well, but I wonder if it's universally > FP> known or not. Do you think it's worth presenting this to a > FP> large audience, or will we just get yawns about the > FP> obviousness of it all? > > No clue. I guess some section of the audience will yawn one way or > another (hopefully not either way though). ;-) Here's a clue: It's obvious to me that I'm underutilizing the interactive capabilities of python. It's not obvious to me what combination of facilities will put me in that state of being "one with the system". There are a lot of combinations and permutations, each with a learning curve to get through even before you can make a judgement. I've been going through this process of exploration for a year or so, trying to find my way out of the write/compile/run rut. I'm grateful to anyone who can point out shortcuts or workflow/structure ideas. I don't think you would generate yawns in a presentation to a wide audience. The landscape is rather rich with possibilities, and I'm sure no one in the audience will have constructed the same system. Everyone would get something out of such a talk. > > cheers, > prabhu > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user > From Fernando.Perez at colorado.edu Mon Aug 16 15:03:50 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Mon, 16 Aug 2004 13:03:50 -0600 Subject: [SciPy-user] gplot documentation In-Reply-To: <3288.10.68.2.14.1092682051.squirrel@10.68.2.14> References: <411EACBA.50803@colorado.edu> <1092610687.411fea7f81ccf@webmail.colorado.edu> <3182.10.68.2.14.1092668636.squirrel@10.68.2.14> <4120EA3E.7090306@colorado.edu> <16672.62331.502685.190544@enthought.hathway.com> <4120F4EF.30400@colorado.edu> <16672.63381.722337.117376@enthought.hathway.com> <3288.10.68.2.14.1092682051.squirrel@10.68.2.14> Message-ID: <41210516.9030801@colorado.edu> gpajer at rider.edu wrote: > I don't think you would generate yawns in a presentation to a wide > audience. The landscape is rather rich with possibilities, and I'm sure > no one in the audience will have constructed the same system. Everyone > would get something out of such a talk. Good enough, thanks. I'll include some of this then. It seems to me like there's a need for a solid book/tutorial on scientific computing with python which combines: - description of existing tools, but making a justified choice of a suitable 'best' one for real-life work. Laundry lists are semi-useless because they leave to the users the task of trying everything out there. - documenting the scipy core in detail. The existing tutorial is good, but missing parts. This would obviously mean extending, not rewriting, the existing docs. - presenting workflow suggestions, with real-world examples of how to achieve this efficiently. This includes interactive work, C/C++/Fortran integration, plotting/visualization, making all of this batch and gui-less-friendly, etc. And then, we need to build a mathematica-notebook-like environment for python, so we can work, write text and equations, plot and print finished documents, all from within a single system. So much to do, so little time... Best, f From oliphant at ee.byu.edu Mon Aug 16 16:14:01 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Mon, 16 Aug 2004 14:14:01 -0600 Subject: [SciPy-user] fmin_l_bfgs_b problem In-Reply-To: <1092128397.41188e8daa265@webmail.oregonstate.edu> References: <20040809175902.BFF113EB62@www.scipy.com> <1092128397.41188e8daa265@webmail.oregonstate.edu> Message-ID: <41211589.1000809@ee.byu.edu> bulatov at cs.orst.edu wrote: >>On Mon, Aug 09, 2004 at 02:39:59AM -0700, bulatov at cs.orst.edu wrote: >> >> >>>Was anyone able to use fmin_l_bfgs_b optimizer successfully? >>> >>> >>Well, I wrote the wrapper, so I hope so :-) >> >> >> >>>When I run it with the same parameters as the fmin_bfgs example in the >>> >>> >tutorial, > > >>>I get the error: >>> >>>xopt = fmin_l_bfgs_b(log_likelihood, x0, fprime=log_likelihood_der) >>>File "C:\Python23\Lib\site-packages\scipy\optimize\lbfgsb.py", line 174, in >>> >>> >fm > > >>>in_l_bfgs_bisave, dsave) >>>error: failed in converting 7th argument `g' of _lbfgsb.setulb to C/Fortran >>>array >>> >>> >>>Are you sure log_likelihood_der returns an array (of the same length as >>> >>> >x0)? > >I found the problem :) Log_likelihood_der returned Numarray array instead of >Numeric array. That happened because I couldn't find "zeros" function in SciPy, >so I used numarray.zeros to initialize array. When I changed numarray.zeros to >Numeric.zeros, problem was fixed. > > scipy.zeros will also work (i.e. you should never have to call Numeric). This is the safest way to go because then you are guaranteed that whatever zeros scipy is using (Numeric or numarray) will be consistent. >For the future...how do I debug these kinds of problems? I looked in lbfgs.pyf, >but couldn't quite understand why Numeric arrays were required > > SciPy currently uses only numeric arrays internally. Now, most functions should happily accept any sequence (including Numarray arrays) and if they don't then that should be looked at as a bug --- there might be lots of this little bugs. -Travis O. >Yaroslav > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > From liwuren at yahoo.com Tue Aug 17 13:17:21 2004 From: liwuren at yahoo.com (Wuren Li) Date: Tue, 17 Aug 2004 10:17:21 -0700 (PDT) Subject: [SciPy-user] Install problem Message-ID: <20040817171721.5367.qmail@web52408.mail.yahoo.com> Hello- I'm installing SciPy for the first time, on Fedora core 2. I downloaded the rpms, installing (hopefully this is correct, directions aren't clear): Numeric-23.1-1_py23.i386.rpm Scipy_core-0.3.0_108.1820-2_py23_rh9.i386.rpm F2PY-2.39.235_1693-2ee_py22_rh9.noarch.rpm SciPy-0.3.0_266.4239-1ee_py23_Linux_PIII_rh9.i386.rpm The last of these won't install due to dependencies on libfftw.so.2 and librfftw.so.2. Are these necessary, and if so, where is the best place to get them? Thanks! P.S. Numeric-23.1-1_py23.i386.rpm has a small glitch--a dependency on Python 2.3 that prevented installation even though I have 2.3.3. Used --nodeps to force installation. --------------------------------- Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aisaac at american.edu Tue Aug 17 20:31:45 2004 From: aisaac at american.edu (Alan G Isaac) Date: Tue, 17 Aug 2004 20:31:45 -0400 (Eastern Daylight Time) Subject: [SciPy-user] Matplotlib problem under Windows: %HOME% expands to %USERPROFILE% Message-ID: I found a Matplotlib problem under Win 2000. THE SYMPTOM: Matplotlib appears to install fine under Windows 2000, but trying to include text in a plot produces the following error message: Traceback (most recent call last): [snip] File "C:\programs\Python23\lib\site-packages\matplotlib\font_manager.py", line 764, in __init__ pickle.dump(self.ttfdict, file(ttfcache, 'w')) IOError: [Errno 2] No such file or directory: '%USERPROFILE%\\.ttffont.cache' THE PROBLEM: In matplotlib's font_manager.py, we find the line ttfpath = os.environ.get('HOME', get_data_path()) (as well as one more problematic use of HOME). Under Windows 2000 (and other Windows?), %HOME% expands to %USERPROFILE%, *not* to the user's home directory. %USERPROFILE% in turn expands to the user's home directory, but this expansion is not done by the line above. COMMENT: this problem affects the installation as well: a directory called literally '%USERPROFILE% is created! THE HACK for Windows users with the problematic install and behavior: change HOME to USERPROFILE in font_manager.py. Hopefully there is also a simple solution for Matplotlib, but I'm just an end user so I won't propose one. Cheers, Alan Isaac From aisaac at american.edu Tue Aug 17 23:17:34 2004 From: aisaac at american.edu (Alan G Isaac) Date: Tue, 17 Aug 2004 23:17:34 -0400 (Eastern Daylight Time) Subject: [SciPy-user] Matplotlib font encoding problem Message-ID: Matplotlib is doing something with its fonts that is unfriendly. E.g., Ghostscript and Distiller choke on http://www.american.edu/econ/problems/matplotlib.fontproblem.eps Ghostscript says it is an invalid front. If I get rid of the verdana font encoding, the file displays fine. I have the same problem when I try to use the TeX fonts. I'm hoping there's a quick fix... Alan Isaac using Matplotlib with Numeric under Python 2.3 OS: Win 2000 Pro From stephen.walton at csun.edu Wed Aug 18 00:40:50 2004 From: stephen.walton at csun.edu (Stephen Walton) Date: Tue, 17 Aug 2004 21:40:50 -0700 Subject: [SciPy-user] Install problem In-Reply-To: <20040817171721.5367.qmail@web52408.mail.yahoo.com> References: <20040817171721.5367.qmail@web52408.mail.yahoo.com> Message-ID: <1092804050.5805.2.camel@localhost.localdomain> On Tue, 2004-08-17 at 10:17, Wuren Li wrote: > Hello- > I'm installing SciPy for the first time... > The last of these won't install due to dependencies on > libfftw.so.2 and librfftw.so.2. Are these necessary, > and if so, where is the best place to get them? If you have a yum.conf file which contains the Fedora US package entry like this: [fedora-us-stable] name=Fedora US Packages (stable) baseurl=http://download.fedora.us/fedora/fedora/$releasever/$basearch/yum/stable then a simple "yum install fftw" will get you what you need. -- Stephen Walton Dept. of Physics & Astronomy, CSU 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 jdhunter at ace.bsd.uchicago.edu Wed Aug 18 07:30:45 2004 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Wed, 18 Aug 2004 06:30:45 -0500 Subject: [SciPy-user] Re: Matplotlib problem under Windows: %HOME% expands to %USERPROFILE% In-Reply-To: (Alan G Isaac's message of "Tue, 17 Aug 2004 20:31:45 -0400 (Eastern Daylight Time)") References: Message-ID: >>>>> "Alan" == Alan G Isaac writes: Alan> I found a Matplotlib problem under Win 2000. THE SYMPTOM: Alan> Matplotlib appears to install fine under Windows 2000, but Alan> trying to include text in a plot produces the following Alan> error message: Traceback (most recent call last): [snip] Alan> File Alan> "C:\programs\Python23\lib\site-packages\matplotlib\font_manager.py", Alan> line 764, in __init__ pickle.dump(self.ttfdict, Alan> file(ttfcache, 'w')) IOError: [Errno 2] No such file or Alan> directory: '%USERPROFILE%\\.ttffont.cache' Hi Alan, I'm going to forward this post and the subsequent one about font problems to the matplotlib-users list and address them there. Sorry for the troubles! JDH From mhellman at mitre.org Wed Aug 18 09:49:17 2004 From: mhellman at mitre.org (Matthew Hellman) Date: Wed, 18 Aug 2004 09:49:17 -0400 Subject: [SciPy-user] gplt plotting In-Reply-To: References: Message-ID: <1092836956.13874.5.camel@cytochrome> Hi, I'm having a minor problem with the plotting function from gplt. When I use the line gplt.plot(x, y, "with lines lt 1", x, y, "with points lt 1") the graph appears as expected; however, the legend in the top right labels the line as "/tmp/@14079.22" or some small variation on the number. Is there a way to prevent this from occurring or to even label it with a string from another location? Thanks, Matt From aisaac at american.edu Wed Aug 18 11:00:30 2004 From: aisaac at american.edu (Alan G Isaac) Date: Wed, 18 Aug 2004 11:00:30 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplt plotting (series titles) In-Reply-To: <1092836956.13874.5.camel@cytochrome> References: <1092836956.13874.5.camel@cytochrome> Message-ID: On Wed, 18 Aug 2004, Matthew Hellman apparently wrote: > When I use the line > gplt.plot(x, y, "with lines lt 1", x, y, "with points lt 1") > the graph appears as expected; however, the legend in the top right > labels the line as "/tmp/@14079.22" or some small variation on the > number. Is there a way to prevent this from occurring or to even label > it with a string from another location? http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2004-August/003071.html hth, Alan Isaac From mhellman at mitre.org Wed Aug 18 11:10:10 2004 From: mhellman at mitre.org (Matthew Hellman) Date: Wed, 18 Aug 2004 11:10:10 -0400 Subject: [SciPy-user] gplt plotting (series titles) In-Reply-To: References: <1092836956.13874.5.camel@cytochrome> Message-ID: <1092841810.13874.7.camel@cytochrome> That worked great. Thanks. On Wed, 2004-08-18 at 11:00, Alan G Isaac wrote: > On Wed, 18 Aug 2004, Matthew Hellman apparently wrote: > > When I use the line > > gplt.plot(x, y, "with lines lt 1", x, y, "with points lt 1") > > the graph appears as expected; however, the legend in the top right > > labels the line as "/tmp/@14079.22" or some small variation on the > > number. Is there a way to prevent this from occurring or to even label > > it with a string from another location? > > > http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2004-August/003071.html > > hth, > Alan Isaac > > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user From skip at pobox.com Tue Aug 17 13:48:22 2004 From: skip at pobox.com (Skip Montanaro) Date: Tue, 17 Aug 2004 12:48:22 -0500 Subject: [SciPy-user] Re: core dump during import Message-ID: <16674.17638.251233.868612@montanaro.dyndns.org> A few days ago on scipy-user and earlier today on numpy-discussion I wrote: If I execute from scipy.stats import distribution at the interpreter prompt I get a segfault. Stepping through the suspect code yielded very strange results, so I tried recompiling cephesmodule.c with -O0. That seems to have solved the problem for now. I guess that means it's a GCC optimizer bug. -- Skip Montanaro Got spam? http://www.spambayes.org/ skip at pobox.com From curzio.basso at unibas.ch Thu Aug 19 07:10:08 2004 From: curzio.basso at unibas.ch (Curzio Basso) Date: Thu, 19 Aug 2004 13:10:08 +0200 Subject: [SciPy-user] sparse matrices Message-ID: <41248A90.6020300@unibas.ch> Hi all! Can anyone point me to any kind documentation for the scipy.sparse modules? Or I'd better explore it? cheers From oliphant at ee.byu.edu Thu Aug 19 17:33:42 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Thu, 19 Aug 2004 15:33:42 -0600 Subject: [SciPy-user] sparse matrices In-Reply-To: <41248A90.6020300@unibas.ch> References: <41248A90.6020300@unibas.ch> Message-ID: <41251CB6.4010508@ee.byu.edu> Curzio Basso wrote: > > Hi all! > > Can anyone point me to any kind documentation for the scipy.sparse > modules? Or I'd better explore it? cheers The sparse support is pretty new and is not yet well documented. You would be best exploring the source (be prepared to find some little bugs). -Travis From curzio.basso at unibas.ch Fri Aug 20 03:38:43 2004 From: curzio.basso at unibas.ch (Curzio Basso) Date: Fri, 20 Aug 2004 09:38:43 +0200 Subject: [SciPy-user] sparse matrices In-Reply-To: <41251CB6.4010508@ee.byu.edu> References: <41248A90.6020300@unibas.ch> <41251CB6.4010508@ee.byu.edu> Message-ID: <4125AA83.5000104@unibas.ch> Travis Oliphant wrote: > The sparse support is pretty new and is not yet well documented. You > would be best exploring the source (be prepared to find some little bugs). Thanks for the answer. At the end, however, I preferred to write a small wrapper for the UMFPACK library. bye From oliphant at ee.byu.edu Fri Aug 20 12:56:39 2004 From: oliphant at ee.byu.edu (Travis Oliphant) Date: Fri, 20 Aug 2004 10:56:39 -0600 Subject: [SciPy-user] sparse matrices In-Reply-To: <4125AA83.5000104@unibas.ch> References: <41248A90.6020300@unibas.ch> <41251CB6.4010508@ee.byu.edu> <4125AA83.5000104@unibas.ch> Message-ID: <41262D47.6090506@ee.byu.edu> Curzio Basso wrote: > Travis Oliphant wrote: > >> The sparse support is pretty new and is not yet well documented. You >> would be best exploring the source (be prepared to find some little >> bugs). > > > Thanks for the answer. At the end, however, I preferred to write a > small wrapper for the UMFPACK library. There are several who have done that (including me) and it was also part of SciPy for a time. SciPy currently uses SuperLU for it's sparse matrix inverse capability. -Travis From Fernando.Perez at colorado.edu Sun Aug 22 18:56:38 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Sun, 22 Aug 2004 16:56:38 -0600 Subject: [SciPy-user] ipython, gtk & matplotlib support; end of current ipython development Message-ID: <412924A6.1030003@colorado.edu> Hi everyone, sorry for the cross post to those of you who are on all these lists, but since this will affect ipython's future quite a bit, I want a significant heads-up to be seen by all potentially affected. 1. PyGTK & matplotlib --------------------- Thanks to Antoon Pardon and John Hunter, ipython has nearly ready full support for interactive matplotlib with all backends. In this process, we've also added GTK threading support, so you can now use ipython for pygtk development. This code is now in IPython's CVS, and the matplotlib features require matplotlib CVS (for matplotlib use only; matplotlib has NOT become a general ipython requirement). So those of you willing to bleed a little can use it, and now is your opportunity to let us know of any problems you find. Our solution is simpler, but more limited in scope, than scipy's gui_thread. However it currently does NOT work with the WX backends, only with Tk and GTK (-AGG or not). Help from any WX guru is welcome, the place to look is at the end of IPython/Shell.py. I hope that we can find, at least in our more limited context, a working solution for WX which doesn't require all the complexity of gui_thread. In order to use this, do an 'ipython -upgrade' after a cvs update; this will get the necessary support files into ~/.ipython. You will then need to use the new threading options; copying from the docs: -gthread, -mpthread: these are special options, only one of which can be given, and which can ONLY be given as the FIRST option passed to IPython (they will have no effect in any other position). If -gthread is given, IPython starts running a separate thread for GTK operation, so that pyGTK-based programs can open GUIs without blocking IPython. The -mpthread option adds special support for the matplotlib library (http://matplotlib.sourceforge.net), allowing interactive usage of the GTK and WX backends. This also modifies the @run command to correctly execute any matplotlib-based script which calls show() at the end, without blocking. The most convenient way to use this is the new pylab profile, which should be invoked as follows (aliasing this in your shell may be a good idea): $ ipython -mpthread -p pylab pylab will honor your choice of matplotlib backend, though currently it will revert (with a warning) WX to TkAgg, since WX is broken. This will go away once we figure out the WX problems. 2. IPython's future ------------------- Once this support for matplotlib is working to satisfaction, it will mean the end of the line for any more feature-related changes to ipython for quite a while. Once this is reasonably shaken (I hope with at most one more release beyond 0.6.3, which will officially include this), I plan on beginning the long-awaited internal cleanup of ipython. Given my very limited time, this will mean essentially ZERO new features on ipython for quite a while. It will also mean that the new ipython will: - require python 2.3: I want to deprecate as much redundant code as I can from the ipython distribution. I'll use optparse and any other new module from the stdlib which can help shrink ipython. - break backwards compatibility in many areas. In particular, the ipythonrc files will become true python files. - the internal class structure of ipython will drastically change. If you have code which uses ipython via IPython.Shell, you should be fine, as I'll try to keep that API stable. If you've been poking your dirty fingers into iplib or ipmaker directly, expect things to break badly, and don't even think about complaining :) Hopefully once this is over, it will mean having a much cleaner ipython, with an easy path for including it into GUI shells (such as pycrust), and a sane internal code structure. As the new design shakes down, we'll eventually have an ipython 1.0 at last ;) Because of these changes coming down the pipe, if you have any further patches or changes for the current ipython which you'd like to see included, please send them NOW to me. Once I shift gears to the cleanup project, I'll unfortunately have to drop most changes not going in that direction, simply for lack of time. I'd like to thank everybody who has contributed to ipython's development so far, and to encourage others to join in. The cleanup should not be too hard, and it will open the door for having ipython as the interactive core for very high quality python-based environments in the future. Best regards, f From Fernando.Perez at colorado.edu Thu Aug 26 16:57:49 2004 From: Fernando.Perez at colorado.edu (Fernando Perez) Date: Thu, 26 Aug 2004 14:57:49 -0600 Subject: [SciPy-user] xSYMM from BLAS-3 in scipy? Message-ID: <412E4ECD.2060903@colorado.edu> Hi all, I'm running a pretty recent CVS of scipy, and I'm needing to use the blas3 xSYMM routines (dSYMM, specifically). I notice they are not there, and after poking around a bit, it would _seem_ like extending the xGEMM wrapper shouldn't be too hard. But since I'm not at all familiar with this code, I'm a bit afraid of breaking too many things, and right now (with scipy'04 coming up and 2 talks yet to be written :) I don't have the time to write the necessary tests to make this a committable change. Is there anyone out there who has wrapped the rest of the blas3 routines? A quick scan (by tab-completion and source study) seems to show that the only blas3 stuff wrapped is xGEMM. At least having xSYMM, xHEMM and xTRMM would be great, though I guess at some point we should try to have all of blas3. I can try to do this at a later time, but it would be great if someone already has this kind of code available. Best, f From p.berkes at biologie.hu-berlin.de Tue Aug 24 14:05:17 2004 From: p.berkes at biologie.hu-berlin.de (Pietro Berkes and Tiziano Zito) Date: Tue, 24 Aug 2004 20:05:17 +0200 (CEST) Subject: [SciPy-user] Modular toolkit for Data Processing (MDP) released Message-ID: We are pleased to announce the first public release of the MDP library for Python (http://mdp-toolkit.sourceforge.net). This package has been developed in the context of computational neuroscience research, but it should fit the needs of a larger audience of scientists and developers. Modular toolkit for Data Processing is a Python library to implement data processing elements (nodes) and to combine them into data processing sequences (flows). A node corresponds to a learning algorithm or to a generic data processing unit. Each node can have a training phase, during which the internal structures are learned from training data (e.g. the weights of a neural network are adapted or the covariance matrix is estimated) and an execution phase, where new data can be processed forwards (by processing the data through the node) or backwards (by applying the inverse of the transformation computed by the node if defined). MDP is designed to make the implementation of new algorithms easy and intuitive, for example by setting automatically input and output dimension and by casting the data to match the typecode (e.g. float or double) of the internal structures. The nodes were designed to be applied to arbitrarily long sets of data: the internal structures can be updated successively by sending chunks of the input data (this is equivalent to online learning if the chunks consists of single observations, or to batch learning if the whole data is sent in a single chunk). Already implemented nodes include Principal Component Analysis (PCA), Independent Component Analysis (ICA), and Slow Feature Analysis (SFA). A flow consists in an acyclic graph of nodes (currently only node sequences are implemented). The data is sent to an input node and is successively processed by the following nodes on the graph. The general flow implementation automatizes the training, execution and inverse execution (if defined) of the whole graph. A subclass of the basic flow class allows user-supplied checkpoint functions to be executed at the end of each phase, for example to save the internal structures of a node for later analysis. Best regards, Pietro Berkes and Tiziano Zito ---------------------------------------- {p.berkes, t.zito}@biologie.hu-berlin.de Institute for Theoretical Biology Humboldt University Invalidenstrasse 43 D-10115 Berlin, Germany ---------------------------------------- From jean-michel.philippe at irsid.arcelor.com Fri Aug 27 09:28:20 2004 From: jean-michel.philippe at irsid.arcelor.com (Jean-Michel Philippe) Date: Fri, 27 Aug 2004 15:28:20 +0200 Subject: [SciPy-user] scipy_base.squeeze Message-ID: <412F36F4.40404@irsid.arcelor.com> Hi, I recently had troubles with the squeeze function from scipy_base. It squeezes all the dimensions when I pass a (1,1) array, resulting in an empty one! Is it a known side effect? Regards. JM. Philippe -------------------------- PS: I modified the 'site-packages/scipy_base/shape_base.py' script this way to get rid of the problem: def squeeze(a): "Returns a with any ones from the shape of a removed" a = asarray(a) b = asarray(a.shape) dims = tuple (compress (not_equal (b, 1), b)) if len(dims) == 0: dims = (1, ) val = reshape (a, dims) return val -------------------------- From tyrone_1066 at yahoo.com Fri Aug 27 10:24:33 2004 From: tyrone_1066 at yahoo.com (Ty Rone) Date: Fri, 27 Aug 2004 07:24:33 -0700 (PDT) Subject: [SciPy-user] gplt axis interval question Message-ID: <20040827142433.61549.qmail@web50209.mail.yahoo.com> Is there a way to change the axis interval in gplt so that the major tics and numbers increase by 24 (0, 24, 48, 72)? Thanks, Ty __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail From oliphant at ee.byu.edu Fri Aug 27 15:32:06 2004 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Fri, 27 Aug 2004 13:32:06 -0600 Subject: [SciPy-user] scipy_base.squeeze In-Reply-To: <412F36F4.40404@irsid.arcelor.com> References: <412F36F4.40404@irsid.arcelor.com> Message-ID: <412F8C36.2000805@ee.byu.edu> Jean-Michel Philippe wrote: > Hi, > > I recently had troubles with the squeeze function from scipy_base. It > squeezes all the dimensions when I pass a (1,1) array, resulting in an > empty one! I don't understand the problem. If you have a (1,1) array then according to the documentation squeeze should return an array with all dimensions of length one removed. Therefore, you end up with a zero-dimensional array (this is not an empty array...) It seems to work for me: >>> a = array([[5]]) >>> a.shape (1, 1) >>> b = squeeze(a) >>> shape(b) () >>> b 5 >>> This is not a "side effect" but a documented effect. If you want to ensure a 1d array as it seems you do, then you could use b = atleast_1d(squeeze(a)) -Travis From aisaac at american.edu Fri Aug 27 16:35:17 2004 From: aisaac at american.edu (Alan G Isaac) Date: Fri, 27 Aug 2004 16:35:17 -0400 (Eastern Daylight Time) Subject: [SciPy-user] gplt axis interval question In-Reply-To: <20040827142433.61549.qmail@web50209.mail.yahoo.com> References: <20040827142433.61549.qmail@web50209.mail.yahoo.com> Message-ID: On Fri, 27 Aug 2004, Ty Rone apparently wrote: > Is there a way to change the axis interval in gplt so > that the major tics and numbers increase by 24 (0, 24, > 48, 72)? You can hack the sources so that you can send gnuplot an arbitrary gnuplot command: http://www.scipy.org/mailinglists/mailman?fn=scipy-user/2004-August/003083.html This functionality has been requested of the developers, but they have not yet responded. Cheers, Alan Isaac From elcorto at gmx.net Sat Aug 28 05:23:53 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Sat, 28 Aug 2004 11:23:53 +0200 (MEST) Subject: [SciPy-user] mpfit References: Message-ID: <24676.1093685033@www3.gmx.net> Hi all If someone happens to use Mark Rivers' mpfit (http://cars.uchicago.edu/software) for (constrained) Levenberg-Marquardt fitting instead of scipy.optimize.leastsq (both are based on MINPACK) there is a bug regarding 'mpmaxstep' (set the max iteration step length): around line 930 it reads wh = Numeric.nonzero((qmin!=0.) & (qmax!=0.)) but should rather be something like wh = Numeric.nonzero((qmax!=0.)) Maybe this helps someone to save a _lot_ of time wondering why nothing happens :) bye steve -- If you can't beat your computer at chess, try kickboxing. -- Superg?nstige DSL-Tarife + WLAN-Router f?r 0,- EUR* Jetzt zu GMX wechseln und sparen http://www.gmx.net/de/go/dsl From elcorto at gmx.net Sat Aug 28 08:50:22 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Sat, 28 Aug 2004 14:50:22 +0200 (MEST) Subject: [SciPy-user] mpfit again References: <24676.1093685033@www3.gmx.net> Message-ID: <31830.1093697422@www13.gmx.net> Hi In addition line 1186 seems also to be incorrect: mrat = max(Numeric.take(nwa1, whmax) / Numeric.take(maxstep, whmax)) I changed it to mrat = max(abs(Numeric.take(nwa1, whmax)) / abs(Numeric.take(maxstep, whmax))) The latter version also works for negative parameter changes (towards the lower limit). bye steve -- If you can't beat your computer at chess, try kickboxing. -- NEU: Bis zu 10 GB Speicher f?r e-mails & Dateien! 1 GB bereits bei GMX FreeMail http://www.gmx.net/de/go/mail From elcorto at gmx.net Sat Aug 28 08:52:22 2004 From: elcorto at gmx.net (Steve Schmerler) Date: Sat, 28 Aug 2004 14:52:22 +0200 (MEST) Subject: [SciPy-user] mpfit again References: <24676.1093685033@www3.gmx.net> Message-ID: <5061.1093697542@www13.gmx.net> Hi In addition line 1186 seems also to be incorrect: mrat = max(Numeric.take(nwa1, whmax) / Numeric.take(maxstep, whmax)) I changed it to mrat = max(abs(Numeric.take(nwa1, whmax)) / abs(Numeric.take(maxstep, whmax))) The latter version also works for negative parameter changes (towards the lower limit). bye steve -- If you can't beat your computer at chess, try kickboxing. -- NEU: Bis zu 10 GB Speicher f?r e-mails & Dateien! 1 GB bereits bei GMX FreeMail http://www.gmx.net/de/go/mail From jean-michel.philippe at irsid.arcelor.com Mon Aug 30 03:00:01 2004 From: jean-michel.philippe at irsid.arcelor.com (Jean-Michel Philippe) Date: Mon, 30 Aug 2004 09:00:01 +0200 Subject: [SciPy-user] scipy_base.squeeze In-Reply-To: <0000125619C5E1B4@POP3.MEMO> References: <0000125619C5E1B4@POP3.MEMO> Message-ID: <4132D071.9000501@irsid.arcelor.com> Ok, this is due to the Matlab way of thinking I have. Obviously in Python/SciPy scalars are not a particular case of arrays and I understood that shape(b) = () in your example just means that. Couldn't this be a cause of type conversion issues, for example when a function returns a double or an array depending on the input data? (and squeeze seems to be a good example for that) JM. NB: note that help(squeeze) just tells % Help on function squeeze in module scipy_base.shape_base: % %squeeze(a) % Returns a with any ones from the shape of a removed which does not mean that the type of 'a' could be the same or could be changed depending on the result. oliphant at ee.byu.edu wrote: > I don't understand the problem. If you have a (1,1) array then > according to the documentation squeeze should return an array with all > dimensions of length one removed. Therefore, you end up with a > zero-dimensional array (this is not an empty array...) > > It seems to work for me: > > >>> a = array([[5]]) > >>> a.shape > (1, 1) > >>> b = squeeze(a) > >>> shape(b) > () > >>> b > 5 > >>> > > > This is not a "side effect" but a documented effect. If you want to > ensure a 1d array as it seems you do, then you could use > > b = atleast_1d(squeeze(a)) > > -Travis > From christophe.grimault at novagrid.com Mon Aug 30 06:44:48 2004 From: christophe.grimault at novagrid.com (christophe grimault) Date: Mon, 30 Aug 2004 12:44:48 +0200 Subject: [SciPy-user] IMPORTANT BUG in scipy... rescue me !! References: <24676.1093685033@www3.gmx.net> <31830.1093697422@www13.gmx.net> Message-ID: <41330520.3000202@novagrid.com> Hi all, There is a critical bug in scipy, about *very* basic operations between arrays, under MS Windows. Here's the facts : import scipy a=scipy.arange( N, typecode='F' ) c=a*a crashes with N = 258168. The same code does not crash for N = 258167. So 258168 is a kind of limit, because for any lower value, it is OK. This is no memory problem (258168 is not a big value and I have 512 Mb RAM !-). Moreover, if I change scipy for Numeric, the problem disappears ! Also, the interpreter crashes with no error message at all, as if some 'exit()' code was encountered somewhere. What's going on ? How to solve this ? To me it is a very important bug. We can deal on this list about the color of graphics or about some weird special function... but here we're dealing about the integrity of simple computations. Could the readers of this mail try the code on their windows box and tell me if they can reproduce the bug. Any idea to overcome this problem, or just a hint is welcome, because I'm completely stuck !!!!! Thanks in advance, C. Grimault -------------- next part -------------- An HTML attachment was scrubbed... URL: From aisaac at american.edu Mon Aug 30 10:21:16 2004 From: aisaac at american.edu (Alan G Isaac) Date: Mon, 30 Aug 2004 10:21:16 -0400 (Eastern Daylight Time) Subject: [SciPy-user] IMPORTANT BUG in scipy... rescue me !! In-Reply-To: <41330520.3000202@novagrid.com> References: <24676.1093685033@www3.gmx.net> <31830.1093697422@www13.gmx.net><41330520.3000202@novagrid.com> Message-ID: On Mon, 30 Aug 2004, christophe grimault apparently wrote: > import scipy > a=scipy.arange( N, typecode='F' ) > c=a*a > crashes with N = 258168. The same code does not crash for N = 258167. > Could the readers of this mail try the code on their windows box and tell me if they > can reproduce the bug. Confirmed: crash in Scipy, no crash in Numeric. Cheers, Alan Isaac From nwagner at mecha.uni-stuttgart.de Mon Aug 30 10:26:35 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon, 30 Aug 2004 16:26:35 +0200 Subject: [SciPy-user] IMPORTANT BUG in scipy... rescue me !! In-Reply-To: References: <24676.1093685033@www3.gmx.net> <31830.1093697422@www13.gmx.net><41330520.3000202@novagrid.com> Message-ID: <4133391B.7050205@mecha.uni-stuttgart.de> Alan G Isaac wrote: >On Mon, 30 Aug 2004, christophe grimault apparently wrote: > > >>import scipy >>a=scipy.arange( N, typecode='F' ) >>c=a*a >>crashes with N = 258168. The same code does not crash for N = 258167. >>Could the readers of this mail try the code on their windows box and tell me if they >>can reproduce the bug. >> >> > >Confirmed: crash in Scipy, no crash in Numeric. > >Cheers, >Alan Isaac > > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > BTW, it works fine on Linux 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. >>> import scipy >>> scipy.__version__ '0.3.1_283.4228' >>> N = 258168 >>> a=scipy.arange( N, typecode='F' ) >>> c = a*a >>> Nils From christophe.grimault at novagrid.com Mon Aug 30 10:49:18 2004 From: christophe.grimault at novagrid.com (christophe grimault) Date: Mon, 30 Aug 2004 16:49:18 +0200 Subject: [SciPy-user] IMPORTANT BUG in scipy... rescue me !! References: <24676.1093685033@www3.gmx.net> <31830.1093697422@www13.gmx.net><41330520.3000202@novagrid.com> <4133391B.7050205@mecha.uni-stuttgart.de> Message-ID: <41333E6E.60102@novagrid.com> Thanks for the test on Linux. I already knew this however, because I'm porting an application from Linux to Windows. That's why I came across this annoying bug. It is true that everything works fine on linux. So what is different in scipy-linux from scipy windows ? Because I don't believe that the problem is in python (2.3 BTW), nor in Numeric ... Nils Wagner wrote: > Alan G Isaac wrote: > >> On Mon, 30 Aug 2004, christophe grimault apparently wrote: >> >> >>> import scipy >>> a=scipy.arange( N, typecode='F' ) >>> c=a*a >>> crashes with N = 258168. The same code does not crash for N = 258167. >>> Could the readers of this mail try the code on their windows box and >>> tell me if they >>> can reproduce the bug. >>> >> >> >> Confirmed: crash in Scipy, no crash in Numeric. >> >> Cheers, >> Alan Isaac >> >> >> _______________________________________________ >> SciPy-user mailing list >> SciPy-user at scipy.net >> http://www.scipy.net/mailman/listinfo/scipy-user >> >> > BTW, it works fine on Linux > > 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. > >>> import scipy > >>> scipy.__version__ > '0.3.1_283.4228' > >>> N = 258168 > >>> a=scipy.arange( N, typecode='F' ) > >>> c = a*a > >>> > > 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 Mon Aug 30 10:54:19 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Mon, 30 Aug 2004 16:54:19 +0200 Subject: [SciPy-user] IMPORTANT BUG in scipy... rescue me !! In-Reply-To: <41333E6E.60102@novagrid.com> References: <24676.1093685033@www3.gmx.net> <31830.1093697422@www13.gmx.net><41330520.3000202@novagrid.com> <4133391B.7050205@mecha.uni-stuttgart.de> <41333E6E.60102@novagrid.com> Message-ID: <41333F9B.5070803@mecha.uni-stuttgart.de> christophe grimault wrote: > Thanks for the test on Linux. I already knew this however, because I'm > porting an application > from Linux to Windows. That's why I came across this annoying bug. > > It is true that everything works fine on linux. So what is different > in scipy-linux > from scipy windows ? Because I don't believe that the problem is in > python (2.3 BTW), > nor in Numeric ... > How about your scipy version ? Nils > Nils Wagner wrote: > >> Alan G Isaac wrote: >> >>> On Mon, 30 Aug 2004, christophe grimault apparently wrote: >>> >>> >>>> import scipy >>>> a=scipy.arange( N, typecode='F' ) >>>> c=a*a >>>> crashes with N = 258168. The same code does not crash for N = 258167. >>>> Could the readers of this mail try the code on their windows box >>>> and tell me if they >>>> can reproduce the bug. >>>> >>> >>> >>> >>> Confirmed: crash in Scipy, no crash in Numeric. >>> >>> Cheers, >>> Alan Isaac >>> >>> >>> _______________________________________________ >>> SciPy-user mailing list >>> SciPy-user at scipy.net >>> http://www.scipy.net/mailman/listinfo/scipy-user >>> >>> >> BTW, it works fine on Linux >> >> 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. >> >>> import scipy >> >>> scipy.__version__ >> '0.3.1_283.4228' >> >>> N = 258168 >> >>> a=scipy.arange( N, typecode='F' ) >> >>> c = a*a >> >>> >> >> Nils >> >> _______________________________________________ >> SciPy-user mailing list >> SciPy-user at scipy.net >> http://www.scipy.net/mailman/listinfo/scipy-user >> > > > _______________________________________________ > SciPy-user mailing list > SciPy-user at scipy.net > http://www.scipy.net/mailman/listinfo/scipy-user -- 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 From aisaac at american.edu Mon Aug 30 11:05:41 2004 From: aisaac at american.edu (Alan G Isaac) Date: Mon, 30 Aug 2004 11:05:41 -0400 (Eastern Daylight Time) Subject: [SciPy-user] IMPORTANT BUG in scipy... rescue me !! In-Reply-To: <4133391B.7050205@mecha.uni-stuttgart.de> References: <24676.1093685033@www3.gmx.net> <31830.1093697422@www13.gmx.net><41330520.3000202@novagrid.com> <4133391B.7050205@mecha.uni-stuttgart.de> Message-ID: On Mon, 30 Aug 2004, Nils Wagner apparently wrote: > '0.3.1_283.4228' Could be. I've got '0.3.0_266.4242' Can I just install the update, if available for Windoes, over the previous installation? Thanks, Alan Isaac From christophe.grimault at novagrid.com Mon Aug 30 11:18:04 2004 From: christophe.grimault at novagrid.com (christophe grimault) Date: Mon, 30 Aug 2004 17:18:04 +0200 Subject: [SciPy-user] IMPORTANT BUG in scipy... rescue me !! References: <24676.1093685033@www3.gmx.net> <31830.1093697422@www13.gmx.net><41330520.3000202@novagrid.com> <4133391B.7050205@mecha.uni-stuttgart.de> <41333E6E.60102@novagrid.com> <41333F9B.5070803@mecha.uni-stuttgart.de> Message-ID: <4133452C.7000803@novagrid.com> My version number is 0.3.0_266.4242 Nils Wagner wrote: > christophe grimault wrote: > >> Thanks for the test on Linux. I already knew this however, because >> I'm porting an application >> from Linux to Windows. That's why I came across this annoying bug. >> >> It is true that everything works fine on linux. So what is different >> in scipy-linux >> from scipy windows ? Because I don't believe that the problem is in >> python (2.3 BTW), >> nor in Numeric ... >> > How about your scipy version ? > > Nils > >> Nils Wagner wrote: >> >>> Alan G Isaac wrote: >>> >>>> On Mon, 30 Aug 2004, christophe grimault apparently wrote: >>>> >>>> >>>>> import scipy >>>>> a=scipy.arange( N, typecode='F' ) >>>>> c=a*a >>>>> crashes with N = 258168. The same code does not crash for N = 258167. >>>>> Could the readers of this mail try the code on their windows box >>>>> and tell me if they >>>>> can reproduce the bug. >>>>> >>>> >>>> >>>> >>>> >>>> Confirmed: crash in Scipy, no crash in Numeric. >>>> >>>> Cheers, >>>> Alan Isaac >>>> >>>> >>>> _______________________________________________ >>>> SciPy-user mailing list >>>> SciPy-user at scipy.net >>>> http://www.scipy.net/mailman/listinfo/scipy-user >>>> >>>> >>> BTW, it works fine on Linux >>> >>> 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. >>> >>> import scipy >>> >>> scipy.__version__ >>> '0.3.1_283.4228' >>> >>> N = 258168 >>> >>> a=scipy.arange( N, typecode='F' ) >>> >>> c = a*a >>> >>> >>> >>> Nils >>> >>> _______________________________________________ >>> SciPy-user mailing list >>> SciPy-user at scipy.net >>> http://www.scipy.net/mailman/listinfo/scipy-user >>> >> >> >> _______________________________________________ >> SciPy-user mailing list >> SciPy-user at scipy.net >> http://www.scipy.net/mailman/listinfo/scipy-user > > > > From Giovanni.Samaey at cs.kuleuven.ac.be Mon Aug 30 15:27:47 2004 From: Giovanni.Samaey at cs.kuleuven.ac.be (Giovanni Samaey) Date: Mon, 30 Aug 2004 21:27:47 +0200 Subject: [SciPy-user] odeint -- segmentation fault Message-ID: <41337FB3.1050107@cs.kuleuven.ac.be> Dear scipy users and developers, I have the following problem with odeint: Suppose I would call odeint as follows y=odeint(dydt,y,t,....), where dydt is a complicated function that also calls odeint. So dydt is written as def dydt(y,t): intermed=odeint(rhs,y0,t,...) rhs is written in C and wrapped through SWIG In my case, I get segmentation faults doing this. Unfortunately, I was not able to cook up an artificial example that is simple, and behaves like this. What I can tell is that, 1) if I let dydt return a zero array (or any "direct" computation of the derivative), then the program works, while if dydt uses odeint, it crashes. 2) The return value of odeint does not have to be *used* for the crash to happen: e.g. one can use the complicated routine inside dydt, but still return zeros, and the crash would take place. 3) Using the complicated routine inside a loop that performs e.g. forward Euler, gives no problem at all. The crash really occurs when the value of dydt is passed into odeint. (This was tested by stepping with pdb.) So a segmentation fault occurs when odeint accesses the result of calling dydt if that function also uses odeint in a complicated way. Maybe the fact that inside dydt, odeint is calling a C routine for its time derivative, has something to do with it? Since I do not have access to odeint's code, I cannot tell what is going on, nor how to solve this... How could this problem be solved effectively? Best, Giovanni -- Giovanni Samaey http://www.cs.kuleuven.ac.be/~giovanni/ Katholieke Universiteit Leuven email: giovanni at cs.kuleuven.ac.be Departement Computerwetenschappen phone: +32-16-327081 Celestijnenlaan 200A, B-3001 Heverlee, Belgium fax: +32-16-327996 Office: A04.36 From rkern at ucsd.edu Mon Aug 30 16:49:04 2004 From: rkern at ucsd.edu (Robert Kern) Date: Mon, 30 Aug 2004 13:49:04 -0700 Subject: [SciPy-user] odeint -- segmentation fault In-Reply-To: <41337FB3.1050107@cs.kuleuven.ac.be> References: <41337FB3.1050107@cs.kuleuven.ac.be> Message-ID: <413392C0.7020200@ucsd.edu> Giovanni Samaey wrote: [snip] > Since I do not have access to odeint's code, I cannot tell what is going > on, nor how to solve this... > > How could this problem be solved effectively? First, try an example where rhs is not a SWIGed function. That might be the problem itself. I tried a simple example with a Python rhs (on a Powerbook with CVS SciPy) and I didn't get a segfault. If you want to see odeint's source code to help you debug, just download it: http://www.scipy.org/download/ When you have more information, also please provide your platform and SciPy version so we know where to look. Thanks. -- 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 jhmail at oobleck.astro.cornell.edu Mon Aug 30 18:11:08 2004 From: jhmail at oobleck.astro.cornell.edu (Joe Harrington) Date: Mon, 30 Aug 2004 18:11:08 -0400 Subject: [SciPy-user] SciPy '04 BoF: Making Python Attractive to General Scientists Message-ID: <200408302211.i7UMB8AI003276@oobleck.astro.cornell.edu> Making Python Attractive to General Scientists BoF session at SciPy '04 Joe Harrington, Cornell Perry Greenfield, STScI 1. Intro: Why don't more people use Python for scientific analysis? 10 min - typical new user experience - which cohort of new users is it most advantageous to attract? - what's needed before they'll try it - what they'll need to stay - impact of competitors 2. What needs to be done? 10 min - start with draft list - brief open discussion to add/change list 3. Getting people to do it. 10 min - (Note that, while we'd like people to get involved directly, we are realistic in knowing that many are already doing what they can. We're looking for ideas on getting more people in the wider community interested.) - how big are the pieces? - what kind of people should do each item: e.g., coders vs. writers - how to find and involve those people - find people to volunteer to hand-hold some doc writers through learning 4. Approaches to making it easier/faster. 15 min - focus on documenting just a core subset? - can we afford to reduce optimization to ease maintenance, early on? - broadening the community through outreach - hiring writers & packagers 5. How to proceed. 15 min - discussion of specific plans Our short-term goal is to make Python attractive enough for ordinary, non-developer scientists to try it out, particularly those on platforms not well-supported by the current distribution systems. The long-term goals are to extend the community, and to draw from the extended community more and better documentation and application software. While we do have ideas about where we think we need to go, the purpose of this BoF is to see whether the community agrees that accessibility is an important issue, and if so what is needed to achieve it. Please join us for a BoF on Thursday night. Thanks, --jh-- Joe Harrington 326 Space Sciences Building Cornell University Ithaca, NY 14853-6801 (607) 254-8960 office (607) 255-9002 fax jh at oobleck.astro.cornell.edu From christophe.grimault at novagrid.com Tue Aug 31 03:44:08 2004 From: christophe.grimault at novagrid.com (christophe grimault) Date: Tue, 31 Aug 2004 09:44:08 +0200 Subject: [SciPy-user] IMPORTANT BUG in scipy... rescue me !! References: <24676.1093685033@www3.gmx.net> <31830.1093697422@www13.gmx.net> <41330520.3000202@novagrid.com> Message-ID: <41342C48.7020100@novagrid.com> Do you think that there is change in the CVS version, from 0.3.0_266.4242 to 0.3.1_283.422, that could explain this ? If someone using the latest version (0.3.1_283.422) could try to reproduce the bug (with the 3 lines just below), and tell me about it, it would be helpfull ... Thanks in advance, christophe grimault wrote: > Hi all, > > There is a critical bug in scipy, about *very* basic operations > between arrays, > under MS Windows. Here's the facts : > > import scipy > a=scipy.arange( N, typecode='F' ) > c=a*a > > crashes with N = 258168. The same code does not crash for N = 258167. > So 258168 is a > kind of limit, because for any lower value, it is OK. This is no > memory problem (258168 is > not a big value and I have 512 Mb RAM !-). Moreover, if I change scipy > for Numeric, the problem disappears ! > > Also, the interpreter crashes with no error message at all, as if some > 'exit()' code was > encountered somewhere. > > What's going on ? How to solve this ? > > To me it is a very important bug. We can deal on this list about the > color of graphics or > about some weird special function... but here we're dealing about the > integrity of simple > computations. > > Could the readers of this mail try the code on their windows box and > tell me if they > can reproduce the bug. Any idea to overcome this problem, or just a > hint is welcome, because > I'm completely stuck !!!!! > > Thanks in advance, > > C. Grimault > >------------------------------------------------------------------------ > >_______________________________________________ >SciPy-user mailing list >SciPy-user at scipy.net >http://www.scipy.net/mailman/listinfo/scipy-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nwagner at mecha.uni-stuttgart.de Tue Aug 31 04:18:20 2004 From: nwagner at mecha.uni-stuttgart.de (Nils Wagner) Date: Tue, 31 Aug 2004 10:18:20 +0200 Subject: [SciPy-user] Iterative solvers in scipy Message-ID: <4134344C.7000706@mecha.uni-stuttgart.de> Hi all, Just now I saw the latest changes in cvs with respect to iterative solvers Do they account for special properties of the coefficient matrix (symmetrie, definiteness, ...) ? Is it possible to use the iterative solvers yet ? If so, how can I manage it ? How about preconditioners ? Regards, Nils -- From olivier.ravard at novagrid.com Tue Aug 31 04:45:29 2004 From: olivier.ravard at novagrid.com (Olivier Ravard) Date: Tue, 31 Aug 2004 10:45:29 +0200 Subject: [SciPy-user] scipy crash with fastumath Message-ID: <009f01c48f36$de341e20$3d521481@ravard> Hi everybody, As I (and others) already mentioned in this mailing list, there is a python crash (like an exit) when we use scipy under windows for a simple operation like : from scipy import * a = zeros(300000,typecode='F') c=a*a Analyzing the scipy source code, it seems to come from the fastumath module : I comment every line that import fastumath and it works !!! Is anyone have an idea to solve this problem with fastumath under windows ? Thanks. O.R. -------------- next part -------------- An HTML attachment was scrubbed... URL: From oliphant at ee.byu.edu Tue Aug 31 12:21:22 2004 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Tue, 31 Aug 2004 10:21:22 -0600 Subject: [SciPy-user] Iterative solvers in scipy In-Reply-To: <4134344C.7000706@mecha.uni-stuttgart.de> References: <4134344C.7000706@mecha.uni-stuttgart.de> Message-ID: <4134A582.7030901@ee.byu.edu> Nils Wagner wrote: > Hi all, > > Just now I saw the latest changes in cvs with respect to iterative solvers > Do they account for special properties of the coefficient matrix > (symmetrie, definiteness, ...) ? > > Is it possible to use the iterative solvers yet ? > > If so, how can I manage it ? > Not yet, hopefully by end of SciPy conference. > How about preconditioners ? Can be used, eventually. -Travis From oliphant at ee.byu.edu Tue Aug 31 12:22:26 2004 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Tue, 31 Aug 2004 10:22:26 -0600 Subject: [SciPy-user] scipy crash with fastumath In-Reply-To: <009f01c48f36$de341e20$3d521481@ravard> References: <009f01c48f36$de341e20$3d521481@ravard> Message-ID: <4134A5C2.7020601@ee.byu.edu> Olivier Ravard wrote: > Hi everybody, > > As I (and others) already mentioned in this mailing list, there > is a python crash (like an exit) when we use scipy under windows for a > simple operation like : > > from scipy import * > a = zeros(300000,typecode='F') > c=a*a > > Analyzing the scipy source code, it seems to come from the > *fastumath* module : I comment every line that import fastumath > and it works !!! Does it just happen with typecode 'F'? Does it just happen with multiplication? Does it just happen after a certain array size? It is just happening with windows, right? -Travis From olivier.ravard at novagrid.com Tue Aug 31 12:50:50 2004 From: olivier.ravard at novagrid.com (Olivier Ravard) Date: Tue, 31 Aug 2004 18:50:50 +0200 Subject: [SciPy-user] scipy crash with fastumath References: <009f01c48f36$de341e20$3d521481@ravard> <4134A5C2.7020601@ee.byu.edu> Message-ID: <005d01c48f7a$ac367a50$3d521481@ravard> ----- Original Message ----- From: "Travis E. Oliphant" To: "Olivier Ravard" ; "SciPy Users List" Sent: Tuesday, August 31, 2004 6:22 PM Subject: Re: [SciPy-user] scipy crash with fastumath > Olivier Ravard wrote: > > Hi everybody, > > > > As I (and others) already mentioned in this mailing list, there > > is a python crash (like an exit) when we use scipy under windows for a > > simple operation like : > > > > from scipy import * > > a = zeros(300000,typecode='F') > > c=a*a > > > > Analyzing the scipy source code, it seems to come from the > > *fastumath* module : I comment every line that import fastumath > > and it works !!! > > Does it just happen with typecode 'F'? > no but even with typecode 'D' > Does it just happen with multiplication? No but for every operation on an array > > Does it just happen after a certain array size? > Yes. The limit value is 258168 > It is just happening with windows, right? > yes. > > -Travis From Giovanni.Samaey at cs.kuleuven.ac.be Tue Aug 31 14:27:41 2004 From: Giovanni.Samaey at cs.kuleuven.ac.be (Giovanni Samaey) Date: Tue, 31 Aug 2004 20:27:41 +0200 Subject: [SciPy-user] odeint -- segmentation fault In-Reply-To: <413392C0.7020200@ucsd.edu> References: <41337FB3.1050107@cs.kuleuven.ac.be> <413392C0.7020200@ucsd.edu> Message-ID: <4134C31D.1070602@cs.kuleuven.ac.be> Hi, I have *much* more information now. A simple Python rhs function suffices to get the segmentation fault. A sample code that produces the segfault is attached: The function integrate calls odeint with the "equation being defined through dydt. This dydt initialized another integration, around each point x, and calls a function step, which executes odeint with "equation" rhs. The crucial point to get the segfault is that rhs has a different number of odes than dydt. The sample code added here gives print statements that should help understand execution, and a comment is added that would indicate the segfault. I am working on linux with SciPy version '0.3.0_266.4239', Numeric 23.3 and python 2.3.4 Robert Kern wrote: > Giovanni Samaey wrote: > > [snip] > >> Since I do not have access to odeint's code, I cannot tell what is >> going on, nor how to solve this... >> >> How could this problem be solved effectively? > > > First, try an example where rhs is not a SWIGed function. That might > be the problem itself. I tried a simple example with a Python rhs (on > a Powerbook with CVS SciPy) and I didn't get a segfault. > > If you want to see odeint's source code to help you debug, just > download it: http://www.scipy.org/download/ > > When you have more information, also please provide your platform and > SciPy version so we know where to look. > > Thanks. > -- Giovanni Samaey http://www.cs.kuleuven.ac.be/~giovanni/ Katholieke Universiteit Leuven email: giovanni at cs.kuleuven.ac.be Departement Computerwetenschappen phone: +32-16-327081 Celestijnenlaan 200A, B-3001 Heverlee, Belgium fax: +32-16-327996 Office: A04.36 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: odeTest.py URL: From bgoli at sun.ac.za Tue Aug 31 17:02:50 2004 From: bgoli at sun.ac.za (Brett G. Olivier) Date: Tue, 31 Aug 2004 23:02:50 +0200 (SAST) Subject: [SciPy-user] IMPORTANT BUG in scipy... rescue me !! In-Reply-To: <41342C48.7020100@novagrid.com> References: <24676.1093685033@www3.gmx.net> <31830.1093697422@www13.gmx.net><41330520.3000202@novagrid.com> <41342C48.7020100@novagrid.com> Message-ID: <1335.196.30.178.181.1093986170.squirrel@glue.jjj.sun.ac.za> Hi I get the following (PIII, Win2k, Python 2.3.2) these are the N values where the error begins. SciPy Numeric typecode='D' typecode='D' N=258144 FAIL N=258140 FAIL typecode='F' typecode='F' N=258140 FAIL N=258140 FAIL scipy.__version__ = '0.3.1_283.4226' Numeric.__version__ = '23.3' Both compiled with MinGW GCC 3.3.3 Hope this helps Brett > If someone using the latest version (0.3.1_283.422) could try to > reproduce the > bug (with the 3 lines just below), and tell me about it, it would be > helpfull ... > > Thanks in advance, > > christophe grimault wrote: > >> Hi all, >> >> There is a critical bug in scipy, about *very* basic operations >> between arrays, >> under MS Windows. Here's the facts : >> >> import scipy >> a=scipy.arange( N, typecode='F' ) >> c=a*a -- Brett G. Olivier (bgoli at sun dot ac dot za ) Triple-J Group for Molecular Cell Physiology, Stellenbosch University http://glue.jjj.sun.ac.za/~bgoli Tel +27-21-8085871 Fax +27-21-8085863 Mobile +27-82-7329306 From oliphant at ee.byu.edu Tue Aug 31 18:19:42 2004 From: oliphant at ee.byu.edu (Travis E. Oliphant) Date: Tue, 31 Aug 2004 16:19:42 -0600 Subject: ***[Possible UCE]*** Re: [SciPy-user] odeint -- segmentation fault In-Reply-To: <4134C31D.1070602@cs.kuleuven.ac.be> References: <41337FB3.1050107@cs.kuleuven.ac.be> <413392C0.7020200@ucsd.edu> <4134C31D.1070602@cs.kuleuven.ac.be> Message-ID: <4134F97E.4000203@ee.byu.edu> Giovanni Samaey wrote: > Hi, > > I have *much* more information now. > A simple Python rhs function suffices to get the segmentation fault. > A sample code that produces the segfault is attached: > The function integrate calls odeint with the "equation being defined > through > dydt. This dydt initialized another integration, around each point x, > and calls > a function step, which executes odeint with "equation" rhs. > > The crucial point to get the segfault is that rhs has a different number > of odes than dydt. > The sample code added here gives print statements that should help > understand execution, > and a comment is added that would indicate the segfault. > > I am working on linux with SciPy version '0.3.0_266.4239', Numeric 23.3 > and python 2.3.4 > > > Robert Kern wrote: > I think I've fixed this problem. The problem seems to be that lsoda (written in Fortran) made heavy use of common blocks which made it difficult to use in a re-entrant fashion (your dydt function itself calls odeint). ODEPACK provided a function to save and restore the common block which I sprinkled throughout the original fortran code so that the functions called (and jacobians) could use odeint without ruining the needed common block for the rest of the algorithm. Your test script now works on my system and the fixes are in CVS. I hope this helps -Travis From olivier.ravard at univ-rennes1.fr Tue Aug 31 04:26:12 2004 From: olivier.ravard at univ-rennes1.fr (Olivier Ravard) Date: Tue, 31 Aug 2004 10:26:12 +0200 Subject: [SciPy-user] Scipy crash with fastumath Message-ID: <008b01c48f34$2c871c60$3d521481@ravard> Hi everybody, As I (and others) already mentioned in this mailing list, there is a python crash (like an exit) when we use scipy under windows for a simple operation like : from scipy import * a = zeros(300000,typecode='F') c=a*a Analyzing the scipy source code, it seems to come from the fastumath module : I comment every line that import fastumath and it works !!! Is anyone have an idea to solve this problem with fastumath under windows ? Thanks. O.R. -------------- next part -------------- An HTML attachment was scrubbed... URL: