From neyhmor at gmail.com Fri Apr 1 16:42:11 2011 From: neyhmor at gmail.com (N H) Date: Fri, 1 Apr 2011 22:42:11 +0200 Subject: [SciPy-Dev] Noob on board :) Message-ID: Hallo Friends My Name is Ney Henrique, Brazilian based in Germany, Chemist and I`m about to conclude my PhD in Computational Physics. First of all I would like to thank Mr. Ed Schofield for his nice reply on my original contact. As most of you might guess, I?m writing you today to introduce my self and let you know about my interest in contributing to the Scipy project. Honestly I?m not an experienced programmer, but I guess that helping you would be a great chance for both learning and getting into a collaborative project. Please let me know how can I help the Project ( Testing, Debugging, Developping some small tools ... etc ). I?m eager to contribute! Best Regards NH -------------- next part -------------- An HTML attachment was scrubbed... URL: From ralf.gommers at googlemail.com Sat Apr 2 06:46:58 2011 From: ralf.gommers at googlemail.com (Ralf Gommers) Date: Sat, 2 Apr 2011 12:46:58 +0200 Subject: [SciPy-Dev] Noob on board :) In-Reply-To: References: Message-ID: Hi Ney, welcome! On Fri, Apr 1, 2011 at 10:42 PM, N H wrote: > Hallo Friends > My Name is Ney Henrique, Brazilian based in Germany, Chemist and I`m about > to conclude my PhD in Computational Physics. > First of all I would like to thank Mr. Ed Schofield for his nice reply on my > original contact. > As most of you might guess, I?m writing you today to introduce my self and > let you know about my interest in contributing to the Scipy project. > Honestly I?m not an experienced programmer, but I guess that helping you > would be a great chance for both learning and getting into a collaborative > project. > Please let me know how can I help the Project ( Testing, Debugging, > Developping some small tools ... etc ). I?m eager to contribute! There are many things you could help out with: tests, documentation, new functionality, addressing reported bugs, reviewing patches on the bug tracker, .... Before you start it would be good to read through http://docs.scipy.org/doc/numpy/dev/index.html, it's the same workflow for numpy and scipy. You'll probably want to start with just one of the sub-packages of scipy, just browse the docs and see what interests you. You can also look at http://projects.scipy.org/scipy/report/1, sort by "Component", and look at open tickets. If you want to work on bug fixes, test and doc improvements, you can just start and then ask for review. For new functionality or backwards-incompatible changes it's usually better to first discuss on this mailing list. Cheers, Ralf From cournape at gmail.com Sun Apr 3 05:20:49 2011 From: cournape at gmail.com (David Cournapeau) Date: Sun, 3 Apr 2011 18:20:49 +0900 Subject: [SciPy-Dev] Harwell Boeing support In-Reply-To: References: Message-ID: On Thu, Mar 31, 2011 at 9:02 PM, Nils Wagner wrote: > Hi David, > > Is there a chance, that the Harwell Boeing format will be > available in the trunk ? > I saw that you have started a branch. I cleaned up the code a bit and put it on top of the new scipy repository: https://github.com/scipy/scipy/pull/11 cheers, David From nwagner at iam.uni-stuttgart.de Mon Apr 4 06:18:22 2011 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Mon, 04 Apr 2011 12:18:22 +0200 Subject: [SciPy-Dev] Fwd: Harwell Boeing support Message-ID: An embedded message was scrubbed... From: "Nils Wagner" Subject: Re: [SciPy-Dev] Harwell Boeing support Date: Mon, 04 Apr 2011 12:16:18 +0200 Size: 1474 URL: From cournape at gmail.com Tue Apr 5 04:04:15 2011 From: cournape at gmail.com (David Cournapeau) Date: Tue, 5 Apr 2011 17:04:15 +0900 Subject: [SciPy-Dev] Fwd: Harwell Boeing support In-Reply-To: References: Message-ID: On Mon, Apr 4, 2011 at 7:18 PM, Nils Wagner wrote: > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > > > ---------- Forwarded message ---------- > From:?"Nils Wagner" > To:?David Cournapeau > Date:?Mon, 04 Apr 2011 12:16:18 +0200 > Subject:?Re: [SciPy-Dev] Harwell Boeing support > On Sun, 3 Apr 2011 18:20:49 +0900 > ?David Cournapeau wrote: >> >> On Thu, Mar 31, 2011 at 9:02 PM, Nils Wagner >> wrote: >>> >>> Hi David, >>> >>> Is there a chance, that the Harwell Boeing format will be >>> available in the trunk ? >>> I saw that you have started a branch. >> >> I cleaned up the code a bit and put it on top of the new scipy repository: >> >> https://github.com/scipy/scipy/pull/11 >> >> cheers, >> >> David > > Hi David, > > Thank you. What do you mean by new repository ? > I have used > > git clone https://github.com/scipy/scipy.git I have done all my scipy developement with git for a long time, using a git-svn imported repository. Now that scipy itself is on git, I need to convert all my branches to the new scipy repo. The HB branch is already there (on http://github.com/cournape/scipy.git). Note that it does not support all possible formats (most likely a significant portions of them) - the format is unfortunately not well documented, and I don't understand a lot of information I found about it. I am sure it would be relatively simple to add support for people familiar with the concerned fields (fluid mechanics or ODE problems for example). cheers, David From nwagner at iam.uni-stuttgart.de Tue Apr 5 09:04:18 2011 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Tue, 05 Apr 2011 15:04:18 +0200 Subject: [SciPy-Dev] Fwd: Harwell Boeing support In-Reply-To: References: Message-ID: > The HB branch is already there (on > http://github.com/cournape/scipy.git). Note that it does >not support > all possible formats (most likely a significant portions >of them) - > the format is unfortunately not well documented, and I >don't > understand a lot of information I found about it. I am >sure it would > be relatively simple to add support for people familiar >with the > concerned fields (fluid mechanics or ODE problems for >example). > > cheers, > > David David, a detailed description of the HB format can be found here http://people.sc.fsu.edu/~jburkardt/data/hb/hb.html Cheers, Nils From nwagner at iam.uni-stuttgart.de Fri Apr 8 04:46:54 2011 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Fri, 08 Apr 2011 10:46:54 +0200 Subject: [SciPy-Dev] Sparse generalized eigenvalue problems Message-ID: Hi all, what is recommended to tackle sparse generalized eigenvalue problems in scipy ? http://docs.scipy.org/doc/scipy/reference/sparse.linalg.html?highlight=sparse#scipy.sparse.linalg AFAIK, eigs doesn't support generalized eigenvalue problems A x = \lambda B x lobpcg is a way out but it is restricted to real symmetric matrices. Nils From pav at iki.fi Fri Apr 8 07:34:58 2011 From: pav at iki.fi (Pauli Virtanen) Date: Fri, 8 Apr 2011 11:34:58 +0000 (UTC) Subject: [SciPy-Dev] Sparse generalized eigenvalue problems References: Message-ID: Fri, 08 Apr 2011 10:46:54 +0200, Nils Wagner wrote: > what is recommended to tackle sparse generalized eigenvalue problems in > scipy? Writing a patch that adds support for generalized eigenvalue problems to eigs :) The necessary low-level ARPACK routines can be found in scipy.sparse.linalg.eigen.arpack._arpack -- in principle you can use those directly, although they shouldn't be treated as public. -- Pauli Virtanen From nwagner at iam.uni-stuttgart.de Fri Apr 8 08:06:10 2011 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Fri, 08 Apr 2011 14:06:10 +0200 Subject: [SciPy-Dev] Sparse generalized eigenvalue problems In-Reply-To: References: Message-ID: On Fri, 8 Apr 2011 11:34:58 +0000 (UTC) Pauli Virtanen wrote: >Fri, 08 Apr 2011 10:46:54 +0200, Nils Wagner wrote: >> what is recommended to tackle sparse generalized >>eigenvalue problems in >> scipy? > > Writing a patch that adds support for generalized >eigenvalue problems to > eigs :) > > The necessary low-level ARPACK routines can be found in > scipy.sparse.linalg.eigen.arpack._arpack -- in principle >you can use > those directly, although they shouldn't be treated as >public. > > -- > Pauli Virtanen > BTW, which version of Arpack is used by scipy ? I found an interesting comment by Andreas Kl?ckner. See http://mathema.tician.de/node/373 for details. http://mathema.tician.de/software/arpack Nils From nwagner at iam.uni-stuttgart.de Fri Apr 8 08:17:58 2011 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Fri, 08 Apr 2011 14:17:58 +0200 Subject: [SciPy-Dev] scipy.io.savemat and sparse matrices Message-ID: Hi all, I tried to save a sparse matrix savemat('mass.mat',dict(M_sparse)) File "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/sparse/base.py", line 109, in __iter__ yield self[r,:] TypeError: 'coo_matrix' object is unsubscriptable >>> type(M_sparse) How can I resolve the problem ? Nils From aric.hagberg at gmail.com Fri Apr 8 10:27:00 2011 From: aric.hagberg at gmail.com (Aric Hagberg) Date: Fri, 8 Apr 2011 08:27:00 -0600 Subject: [SciPy-Dev] Sparse generalized eigenvalue problems In-Reply-To: References: Message-ID: On Fri, Apr 8, 2011 at 6:06 AM, Nils Wagner wrote: > On Fri, 8 Apr 2011 11:34:58 +0000 (UTC) > ?Pauli Virtanen wrote: >>Fri, 08 Apr 2011 10:46:54 +0200, Nils Wagner wrote: >>> what is recommended to tackle sparse generalized >>>eigenvalue problems in >>> scipy? >> >> Writing a patch that adds support for generalized >>eigenvalue problems to >> eigs :) >> >> The necessary low-level ARPACK routines can be found in >> scipy.sparse.linalg.eigen.arpack._arpack -- in principle >>you can use >> those directly, although they shouldn't be treated as >>public. >> >> -- >> Pauli Virtanen >> > > BTW, which version of Arpack is used by scipy ? > > I found an interesting comment by Andreas Kl?ckner. See > > http://mathema.tician.de/node/373 > > for details. > > http://mathema.tician.de/software/arpack > From https://github.com/scipy/scipy/blob/master/scipy/sparse/linalg/eigen/arpack/README --- This is the ARPACK package from http://www.caam.rice.edu/software/ARPACK/ Specifically the files are from http://www.caam.rice.edu/software/ARPACK/SRC/arpack96.tar.gz with the patch http://www.caam.rice.edu/software/ARPACK/SRC/patch.tar.gz --- So it doesn't include those patches regarding the "second()" function/subroutine signatures being different in ARPACK v LAPACK. But I think we avoid that problem since we explicitly include and build the ARPACK second() subroutine. Aric From jsseabold at gmail.com Fri Apr 8 11:20:30 2011 From: jsseabold at gmail.com (Skipper Seabold) Date: Fri, 8 Apr 2011 11:20:30 -0400 Subject: [SciPy-Dev] warnings in quadpack.py are printed, patch linked Message-ID: The warnings in quadpack are printed. Does this change look ok? https://github.com/jseabold/scipy/compare/master...quadpack-warn-fix Skipper From matthew.brett at gmail.com Fri Apr 8 14:05:50 2011 From: matthew.brett at gmail.com (Matthew Brett) Date: Fri, 8 Apr 2011 11:05:50 -0700 Subject: [SciPy-Dev] scipy.io.savemat and sparse matrices In-Reply-To: References: Message-ID: Hi, On Fri, Apr 8, 2011 at 5:17 AM, Nils Wagner wrote: > Hi all, > > I tried to save a sparse matrix > > > ? ? savemat('mass.mat',dict(M_sparse)) > ? File > "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/sparse/base.py", > line 109, in __iter__ > ? ? yield self[r,:] > TypeError: 'coo_matrix' object is unsubscriptable I think you'll get the same error from: dict(M_sparse) that is - you need to give the input dict a key, with the sparse matrix as a value, as in savemat('mass.mat', dict(aname=M_sparse)) Best, Matthew From josef.pktd at gmail.com Sun Apr 10 08:38:50 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Sun, 10 Apr 2011 08:38:50 -0400 Subject: [SciPy-Dev] OT: bug in matplotlib for py32 Message-ID: I'm going through py23 conversion for statsmodels, using Goehlke's matplotlib we have a function that uses squeeze=False, and get an exception in pyplot.py def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True, subplot_kw=None, **fig_kw): doesn't have a ret defined, no return value (Sorry for OT, I'm not setup for reporting matplotlib bugs) Josef From josef.pktd at gmail.com Sun Apr 10 13:18:42 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Sun, 10 Apr 2011 13:18:42 -0400 Subject: [SciPy-Dev] OT: bug in matplotlib for py32 In-Reply-To: References: Message-ID: On Sun, Apr 10, 2011 at 8:38 AM, wrote: > I'm going through py23 conversion for statsmodels, using Goehlke's matplotlib > > we have a function that uses squeeze=False, and get an exception > > in pyplot.py > > def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True, > ? ? ? ? ? ? ? ?subplot_kw=None, **fig_kw): > > doesn't have a ret defined, > no return value > > (Sorry for OT, I'm not setup for reporting matplotlib bugs) adding the else part in if squeeze: # Reshape the array to have the final desired dimension (nrow,ncol), # though discarding unneeded dimensions that equal 1. If we only have # one subplot, just return it instead of a 1-element array. if nplots==1: ret = fig, axarr[0,0] else: ret = fig, axarr.squeeze() else: ret = fig, axarr fixes it for our test suite, but I don't know whether it is correct Josef > > Josef > From josef.pktd at gmail.com Sun Apr 10 13:22:33 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Sun, 10 Apr 2011 13:22:33 -0400 Subject: [SciPy-Dev] scipy.factorial in python 3.2 Message-ID: python 3.2 (64 bit version) doesn't have scipy.factorial anymore, with python 2.7 it's there. Is this intentional? It's easy to work around, I just import it from scipy.misc Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. ==== No Subprocess ==== >>> import scipy >>> scipy.factorial Traceback (most recent call last): File "", line 1, in scipy.factorial AttributeError: 'module' object has no attribute 'factorial' >>> import scipy.misc >>> scipy.misc.factorial Josef From robert.kern at gmail.com Sun Apr 10 16:14:18 2011 From: robert.kern at gmail.com (Robert Kern) Date: Sun, 10 Apr 2011 15:14:18 -0500 Subject: [SciPy-Dev] scipy.factorial in python 3.2 In-Reply-To: References: Message-ID: On Sun, Apr 10, 2011 at 12:22, wrote: > python 3.2 (64 bit version) doesn't have scipy.factorial anymore, with > python 2.7 it's there. > > Is this intentional? Yes. We stopped using the pkgload() mechanism (the key difference is numpy/scipy versions, not Python versions). We have been trying to discourage the use of the scipy.* namespace for some time now. Use the subpackages. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." ? -- Umberto Eco From josef.pktd at gmail.com Sun Apr 10 16:26:55 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Sun, 10 Apr 2011 16:26:55 -0400 Subject: [SciPy-Dev] scipy.factorial in python 3.2 In-Reply-To: References: Message-ID: On Sun, Apr 10, 2011 at 4:14 PM, Robert Kern wrote: > On Sun, Apr 10, 2011 at 12:22, ? wrote: >> python 3.2 (64 bit version) doesn't have scipy.factorial anymore, with >> python 2.7 it's there. >> >> Is this intentional? > > Yes. We stopped using the pkgload() mechanism (the key difference is > numpy/scipy versions, not Python versions). We have been trying to > discourage the use of the scipy.* namespace for some time now. Use the > subpackages. I have scipy 0.9.0 on python 2.6, 2.7 and on 3.2 >>> import scipy >>> scipy.__version__ '0.9.0' On 2.6 and 2.7 factorial is still in the scipy. namespace, but not in 3.2 I thought some scipy.misc function where still an exception to the load the subpackage rule >>> import sys >>> sys.version '2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]' >>> import scipy >>> scipy.__version__ '0.9.0' >>> set(dir(scipy)) & set(dir(scipy.misc)) set(['info', 'lena', 'comb', 'pade', '__all__', 'Tester', 'factorial', 'factorialk', '__file__', 'who', '__builtins__', 'central_diff_weights', '__package__', '__path__', 'source', '__name__', 'test', 'derivative', 'factorial2', '__doc__']) >>> >>> import sys >>> sys.version '3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)]' >>> import scipy >>> scipy.__version__ '0.9.0' >>> set(dir(scipy)) & set(dir(scipy.misc)) {'__cached__', 'info', '__all__', 'Tester', '__builtins__', '__file__', 'who', '__package__', '__path__', 'source', 'test', '__name__', '__doc__'} I'm fine loading from misc, I was just surprised Josef > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma that is made terrible by our own mad attempt to interpret it as > though it had an underlying truth." > ? -- Umberto Eco > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > From sturla at molden.no Sun Apr 10 21:36:11 2011 From: sturla at molden.no (Sturla Molden) Date: Mon, 11 Apr 2011 03:36:11 +0200 Subject: [SciPy-Dev] [SciPy-User] What "Array" means In-Reply-To: References: Message-ID: <4DA25B0B.40901@molden.no> Den 08.04.2011 12:14, skrev Timothy Wu: > > File "/usr/lib/python2.6/dist-packages/scipy/stats/mstats_basic.py", > line 1546, in kurtosistest > n = a.count(axis=axis).astype(float) > AttributeError: 'int' object has no attribute 'astype' > > I'm not familiar with numpy nor scipy. What exactly should I put in there? I find multiple cases of code like this: a, axis = _chk_asarray(a, axis) n = a.count(axis) a, axis = _chk_asarray(a, axis) n = a.count(axis=axis) a, axis = _chk_asarray(a, axis) n = a.count(axis) a, axis = _chk_asarray(a, axis) n = a.count(axis=axis).astype(float) All of them are bugs: _chk_asarray sometimes returns an ndarray (due to np.ma.ravel), which does not have a count attribute. Sometimes count returns an int, which does not have an asfloat attribute. Sturla From nwagner at iam.uni-stuttgart.de Tue Apr 12 03:32:57 2011 From: nwagner at iam.uni-stuttgart.de (Nils Wagner) Date: Tue, 12 Apr 2011 09:32:57 +0200 Subject: [SciPy-Dev] Possibly bug in fmin_ncg Message-ID: Hi all, fmin_cg works fine x_opt, f_opt, func_calls, grad_calls, warnflag, allvecs = fmin_cg(func, x0, fprime=fprime, args=(), gtol=1.0000000000000001e-05, norm=inf, epsilon=1.4901161193847656e-08, maxiter=None, full_output=1, disp=1, retall=1, callback=None) while fmin_ncg fails with x_opt, f_opt, fcalls, gcalls,hcalls,warnflag =fmin_ncg(func, x0, fprime=fprime, fhess_p=None, fhess=None, args=(), avextol=1.0000000000000001e-05, epsilon=1.4901161193847656e-08, maxiter=None, full_output=1, disp=1, retall=1, callback=None) File "/data/home/nwagner/local/lib/python2.5/site-packages/scipy/optimize/optimize.py", line 811, in fmin_ncg maggrad = numpy.add.reduce(abs(b)) TypeError: cannot reduce on a scalar Is it possible to replace numpy.add.reduce by numpy.sum ? >>> numpy.add.reduce(abs(numpy.array(([1.,2.])))) 3.0 >>> numpy.sum(abs(numpy.array(([1.,2.])))) 3.0 >>> numpy.add.reduce(abs(1.)) Traceback (most recent call last): File "", line 1, in TypeError: cannot reduce on a scalar >>> numpy.sum(abs(1.)) 1.0 Nils From unclejamil at gmail.com Tue Apr 12 14:39:59 2011 From: unclejamil at gmail.com (jamil egdemir) Date: Tue, 12 Apr 2011 14:39:59 -0400 Subject: [SciPy-Dev] tzinfo and scikits.timeseries In-Reply-To: References: Message-ID: Hi, When using scikits.timeseries I'm running into an issue with timezone information. ?When using a datetime.datetime in the constructor for a scikits.timeseries.Date, the tzinfo is getting dropped. ?Here's the output I'm getting when working from inside ipython (on windows): In [2]: import datetime In [3]: from pytz import timezone In [4]: eastern = timezone('US/Eastern') In [5]: eastern Out[5]: In [6]: testing = eastern.localize(datetime.datetime(year = 2010, month = 1, day = 1)) In [7]: testing Out[7]: datetime.datetime(2010, 1, 1, 0, 0, tzinfo=) In [8]: type(testing) Out[8]: In [9]: import scikits.timeseries as TS In [10]: aDate = TS.Date('D', datetime = testing) In [11]: aDate Out[11]: In [13]: after = aDate.datetime In [14]: after Out[14]: datetime.datetime(2010, 1, 1, 0, 0) In [15]: after.tzinfo In [16]: type(after.tzinfo) Out[16]: What's the best way to deal with this situation? ?Is there a way to keep hold of the tzinfo while still using scikits.timeseries.Date? -- -j ------------------------------------------------------------- Jamil Egdemir unclejamil at gmail.com AIM: unclejamil YahooMessenger: uncle_jamil http://grad.physics.sunysb.edu/~jamil (631) 338-3170?(cell) ------------------------------------------------------------- From pgmdevlist at gmail.com Wed Apr 13 06:46:55 2011 From: pgmdevlist at gmail.com (Pierre GM) Date: Wed, 13 Apr 2011 12:46:55 +0200 Subject: [SciPy-Dev] tzinfo and scikits.timeseries In-Reply-To: References: Message-ID: <4AD584A4-C578-48EC-8B68-839CF6C3FFAF@gmail.com> On Apr 12, 2011, at 8:39 PM, jamil egdemir wrote: > > What's the best way to deal with this situation? Is there a way to > keep hold of the tzinfo while still using scikits.timeseries.Date? Currently, no. We never had to use this kind of info, so nothing is coded about it. But that's an excellent idea. The best would be to open a ticket and we'll try to address it as soon as we can (but that's probably be later than you think). If you really need the tzinfo and your series has the same TZ, you could try to save it as attribute. From lists at onerussian.com Wed Apr 13 10:34:35 2011 From: lists at onerussian.com (Yaroslav Halchenko) Date: Wed, 13 Apr 2011 10:34:35 -0400 Subject: [SciPy-Dev] distributions.ncf.fit -- never converges? Message-ID: <20110413143435.GD7764@onerussian.com> Since 0.9.0 (not present in 0.7.2), distributions.ncf.fit seems to never converge. could anyone check in development tree if the below call ever returns (I was waiting for minutes... with 0.7.2 it was taking just a moment): python -c 'import scipy.stats.distributions as ssd, numpy as np; d=ssd.ncf; d.fit(np.array([-0.03756533, 0.18115522, 0.06605958, -0.09195276, 0.06162608, 0.07139736, -0.1570828 , -0.11967677, -0.19186652, 0.29411319]));' Thanks in advance! -- =------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic From josef.pktd at gmail.com Wed Apr 13 12:53:54 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Wed, 13 Apr 2011 12:53:54 -0400 Subject: [SciPy-Dev] distributions.ncf.fit -- never converges? In-Reply-To: <20110413143435.GD7764@onerussian.com> References: <20110413143435.GD7764@onerussian.com> Message-ID: On Wed, Apr 13, 2011 at 10:34 AM, Yaroslav Halchenko wrote: > Since 0.9.0 (not present in 0.7.2), distributions.ncf.fit seems to never > converge. ?could anyone check in development tree if the below call ever > returns (I was waiting for minutes... with 0.7.2 it was taking just a moment): > > ?python -c 'import scipy.stats.distributions as ssd, numpy as np; d=ssd.ncf; d.fit(np.array([-0.03756533, ?0.18115522, ?0.06605958, -0.09195276, ?0.06162608, 0.07139736, -0.1570828 , -0.11967677, -0.19186652, ?0.29411319]));' I only have 0.9.0, I forgot to kill the process and 1 hour 22 minutes of cpu time later it still hadn't returned. At least a maximum iteration or maximum function evaluation should have stopped it. Josef > > Thanks in advance! > > -- > =------------------------------------------------------------------= > Keep in touch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? www.onerussian.com > Yaroslav Halchenko ? ? ? ? ? ? ? ? www.ohloh.net/accounts/yarikoptic > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > From lists at onerussian.com Wed Apr 13 13:08:45 2011 From: lists at onerussian.com (Yaroslav Halchenko) Date: Wed, 13 Apr 2011 13:08:45 -0400 Subject: [SciPy-Dev] distributions.ncf.fit -- never converges? In-Reply-To: References: <20110413143435.GD7764@onerussian.com> Message-ID: <20110413170845.GE7764@onerussian.com> Thanks Josef for the confirmation and making your computer sweat ;) I have built current master *In [3]: scipy.__version__ Out[3]: '0.10.0.dev' the same story. apparently it is known to some degree -- ncf is skipped the unittesting: $> git grep -A 10 'TestFitMethod' scipy/stats/tests/test_distributions.py:class TestFitMethod(TestCase): scipy/stats/tests/test_distributions.py- skip = ['ncf'] scipy/stats/tests/test_distributions.py- scipy/stats/tests/test_distributions.py- @dec.slow scipy/stats/tests/test_distributions.py- def test_fit(self): scipy/stats/tests/test_distributions.py- for func, dist, args, alpha in test_all_distributions(): scipy/stats/tests/test_distributions.py- if dist in self.skip: scipy/stats/tests/test_distributions.py- continue $> git show ba349771 commit ba349771afebb1473a961139570da770ada59032 Author: Travis Oliphant Date: Tue Jun 1 07:59:20 2010 +0000 Add tests for fit method including fixing input parameters. ;-) :-/ On Wed, 13 Apr 2011, josef.pktd at gmail.com wrote: > > ?python -c 'import scipy.stats.distributions as ssd, numpy as np; d=ssd.ncf; d.fit(np.array([-0.03756533, ?0.18115522, ?0.06605958, -0.09195276, ?0.06162608, 0.07139736, -0.1570828 , -0.11967677, -0.19186652, ?0.29411319]));' > I only have 0.9.0, I forgot to kill the process and 1 hour 22 minutes > of cpu time later it still hadn't returned. > At least a maximum iteration or maximum function evaluation should > have stopped it. > Josef -- =------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic From lists at onerussian.com Wed Apr 13 13:25:00 2011 From: lists at onerussian.com (Yaroslav Halchenko) Date: Wed, 13 Apr 2011 13:25:00 -0400 Subject: [SciPy-Dev] distributions.ncf.fit -- never converges? In-Reply-To: <20110413170845.GE7764@onerussian.com> References: <20110413143435.GD7764@onerussian.com> <20110413170845.GE7764@onerussian.com> Message-ID: <20110413172500.GF7764@onerussian.com> just in case it would come useful in troubleshooting -- gets stuck in cumfnc_ (not modified since 2007) and blunt guess could be that reason is could be related to cdffnc1_wrap (dfn=-nan(0x8000000000000), dfd=-nan(0x8000000000000), ... ? *(gdb) bt full 10 #0 0x00007f69103a44eb in cumfnc_ () from /home/yoh/proj/scipy/install/lib/python2.6/site-packages/scipy/special/_cephes.so No symbol table info available. #1 0x00007f691039fab0 in cdffnc_ () from /home/yoh/proj/scipy/install/lib/python2.6/site-packages/scipy/special/_cephes.so No symbol table info available. #2 0x00007f6910363b84 in cdffnc1_wrap (dfn=-nan(0x8000000000000), dfd=-nan(0x8000000000000), nc=1, f=0.5) at scipy/special/cdf_wrappers.c:254 which = 1 q = 8.4886169591766247e-317 p = bound = status = 6 #3 0x00007f69103668fe in PyUFunc_dddd_d (args=0x7f691067a750, dimensions=, steps=0x7ff80000, func=) at scipy/special/ufunc_extras.c:510 i = 1 ip1 = 0xf6e2c0 "" ip2 = 0x19df1e0 "" ip3 = 0x19ee0c0 "" ip4 = 0x190c7b0 "" op = 0x17dedf0 "\b\357\374\023i\177" n = 10 #4 0x00007f6913257209 in ?? () from /usr/lib/pymodules/python2.6/numpy/core/umath.so No symbol table info available. #5 0x00007f6913257d13 in ?? () from /usr/lib/pymodules/python2.6/numpy/core/umath.so No symbol table info available. #6 0x000000000041ef47 in PyObject_Call (func=, arg=, kw=) at ../Objects/abstract.c:2492 result = < at remote 0xedd180> call = 0x7f6913257cb0 #7 0x00000000004a72b8 in do_call (f= Frame 0x19e4b60, for file /home/yoh/proj/scipy/install/lib/python2.6/site-packages/scipy/stats/distributions.py, line 4241, in _cdf (self=, moment_type=1, b=, vecfunc=, otypes='d', lastcallargs=0, ufunc=None, __doc__=None, nout=None) at remote 0x1891f50>, name='ncf', xb=, xa=, m=, vecentropy=, otypes='d', lastcallargs=0, ufunc=None, __doc__=None, nout=None) at remote 0x1891fd0>, numargs=3, generic_moment=, otypes='d', lastcallargs=0, ufunc=None, __doc__=None, nout=None) at remote 0x1893090>, veccdf=, otypes='d', lastcallargs=0, ufunc=None, __doc_...(truncated), throwflag=) at ../Python/ceval.c:3968 callargs = (, , , ) kwdict = 0x0 #8 call_function (f= Frame 0x19e4b60, for file /home/yoh/proj/scipy/install/lib/python2.6/site-packages/scipy/stats/distributions.py, line 4241, in _cdf (self=, moment_type=1, b=, vecfunc=, otypes='d', lastcallargs=0, ufunc=None, __doc__=None, nout=None) at remote 0x1891f50>, name='ncf', xb=, xa=, m=, vecentropy=, otypes='d', lastcallargs=0, ufunc=None, __doc__=None, nout=None) at remote 0x1891fd0>, numargs=3, generic_moment=, otypes='d', lastcallargs=0, ufunc=None, __doc__=None, nout=None) at remote 0x1893090>, veccdf=, otypes='d', lastcallargs=0, ufunc=None, __doc_...(truncated), throwflag=) at ../Python/ceval.c:3773 func = w = nk = n = pfunc = 0x19e4d00 #9 PyEval_EvalFrameEx (f= Frame 0x19e4b60, for file /home/yoh/proj/scipy/install/lib/python2.6/site-packages/scipy/stats/distributions.py, line 4241, in _cdf (self=, moment_type=1, b=, vecfunc=, otypes='d', lastcallargs=0, ufunc=None, __doc__=None, nout=None) at remote 0x1891f50>, name='ncf', xb=, xa=, m=, vecentropy=, otypes='d', lastcallargs=0, ufunc=None, __doc__=None, nout=None) at remote 0x1891fd0>, numargs=3, generic_moment=, otypes='d', lastcallargs=0, ufunc=None, __doc__=None, nout=None) at remote 0x1893090>, veccdf=, otypes='d', lastcallargs=0, ufunc=None, __doc_...(truncated), throwflag=) at ../Python/ceval.c:2412 sp = 0x19e4d08 stack_pointer = next_instr = 0x1615229 "S" opcode = oparg = why = err = x = v = w = u = t = stream = freevars = 0x19e4d00 retval = 0x0 tstate = 0xedd180 co = 0x1614828 instr_ub = -1 instr_lb = 0 instr_prev = -1 first_instr = 0x1615214 "t" names = ('special', 'ncfdtr') consts = (None,) (More stack frames follow...) -- =------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic From josef.pktd at gmail.com Wed Apr 13 13:33:56 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Wed, 13 Apr 2011 13:33:56 -0400 Subject: [SciPy-Dev] distributions.ncf.fit -- never converges? In-Reply-To: <20110413170845.GE7764@onerussian.com> References: <20110413143435.GD7764@onerussian.com> <20110413170845.GE7764@onerussian.com> Message-ID: 2011/4/13 Yaroslav Halchenko : > Thanks Josef for the confirmation and making your computer sweat ;) > > I have built current master > > *In [3]: scipy.__version__ > Out[3]: '0.10.0.dev' > > the same story. The default starting parameters have changed. If your example worked before, then it's possible that it works with explicit starting parameters. (I haven't figured out yet how to make my new computer sweat.) Josef > > apparently it is known to some degree -- ncf is skipped the unittesting: > > $> git grep -A 10 'TestFitMethod' > scipy/stats/tests/test_distributions.py:class TestFitMethod(TestCase): > scipy/stats/tests/test_distributions.py- ? ?skip = ['ncf'] > scipy/stats/tests/test_distributions.py- > scipy/stats/tests/test_distributions.py- ? ?@dec.slow > scipy/stats/tests/test_distributions.py- ? ?def test_fit(self): > scipy/stats/tests/test_distributions.py- ? ? ? ?for func, dist, args, alpha in test_all_distributions(): > scipy/stats/tests/test_distributions.py- ? ? ? ? ? ?if dist in self.skip: > scipy/stats/tests/test_distributions.py- ? ? ? ? ? ? ? ?continue > > $> git show ba349771 > commit ba349771afebb1473a961139570da770ada59032 > Author: Travis Oliphant > Date: ? Tue Jun 1 07:59:20 2010 +0000 > > ? ?Add tests for fit method including fixing input parameters. > > > ;-) :-/ > > On Wed, 13 Apr 2011, josef.pktd at gmail.com wrote: > >> > ?python -c 'import scipy.stats.distributions as ssd, numpy as np; d=ssd.ncf; d.fit(np.array([-0.03756533, ?0.18115522, ?0.06605958, -0.09195276, ?0.06162608, 0.07139736, -0.1570828 , -0.11967677, -0.19186652, ?0.29411319]));' > >> I only have 0.9.0, I forgot to kill the process and 1 hour 22 minutes >> of cpu time later it still hadn't returned. >> At least a maximum iteration or maximum function evaluation should >> have stopped it. > >> Josef > -- > =------------------------------------------------------------------= > Keep in touch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? www.onerussian.com > Yaroslav Halchenko ? ? ? ? ? ? ? ? www.ohloh.net/accounts/yarikoptic > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > From bsouthey at gmail.com Wed Apr 13 13:58:24 2011 From: bsouthey at gmail.com (Bruce Southey) Date: Wed, 13 Apr 2011 12:58:24 -0500 Subject: [SciPy-Dev] distributions.ncf.fit -- never converges? In-Reply-To: References: <20110413143435.GD7764@onerussian.com> <20110413170845.GE7764@onerussian.com> Message-ID: <4DA5E440.2060803@gmail.com> On 04/13/2011 12:33 PM, josef.pktd at gmail.com wrote: > 2011/4/13 Yaroslav Halchenko: >> Thanks Josef for the confirmation and making your computer sweat ;) >> >> I have built current master >> >> *In [3]: scipy.__version__ >> Out[3]: '0.10.0.dev' >> >> the same story. > The default starting parameters have changed. If your example worked > before, then it's possible that it works with explicit starting > parameters. > > (I haven't figured out yet how to make my new computer sweat.) > > Josef > > >> apparently it is known to some degree -- ncf is skipped the unittesting: >> >> $> git grep -A 10 'TestFitMethod' >> scipy/stats/tests/test_distributions.py:class TestFitMethod(TestCase): >> scipy/stats/tests/test_distributions.py- skip = ['ncf'] >> scipy/stats/tests/test_distributions.py- >> scipy/stats/tests/test_distributions.py- @dec.slow >> scipy/stats/tests/test_distributions.py- def test_fit(self): >> scipy/stats/tests/test_distributions.py- for func, dist, args, alpha in test_all_distributions(): >> scipy/stats/tests/test_distributions.py- if dist in self.skip: >> scipy/stats/tests/test_distributions.py- continue >> >> $> git show ba349771 >> commit ba349771afebb1473a961139570da770ada59032 >> Author: Travis Oliphant >> Date: Tue Jun 1 07:59:20 2010 +0000 >> >> Add tests for fit method including fixing input parameters. >> >> >> ;-) :-/ >> >> On Wed, 13 Apr 2011, josef.pktd at gmail.com wrote: >> >>>> python -c 'import scipy.stats.distributions as ssd, numpy as np; d=ssd.ncf; d.fit(np.array([-0.03756533, 0.18115522, 0.06605958, -0.09195276, 0.06162608, 0.07139736, -0.1570828 , -0.11967677, -0.19186652, 0.29411319]));' >>> I only have 0.9.0, I forgot to kill the process and 1 hour 22 minutes >>> of cpu time later it still hadn't returned. >>> At least a maximum iteration or maximum function evaluation should >>> have stopped it. >>> Josef >> -- >> =------------------------------------------------------------------= >> Keep in touch www.onerussian.com >> Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic >> _______________________________________________ >> SciPy-Dev mailing list >> SciPy-Dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/scipy-dev >> > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev I did not run it very long because I saw this message: /usr/lib64/python2.7/site-packages/scipy/stats/distributions.py:1882: RuntimeWarning: invalid value encountered in double_scalars Lhat = muhat - Shat*mu It seems that line 1874 (mu, mu2 = self.stats(*args,**{'moments':'mv'})) give mu and mu2 as inf's. So Lhat is nan and there are better uses for that cpu power than spinning around infinities ... Bruce From lists at onerussian.com Wed Apr 13 15:02:26 2011 From: lists at onerussian.com (Yaroslav Halchenko) Date: Wed, 13 Apr 2011 15:02:26 -0400 Subject: [SciPy-Dev] distributions.ncf.fit -- never converges? In-Reply-To: <4DA5E440.2060803@gmail.com> References: <20110413143435.GD7764@onerussian.com> <20110413170845.GE7764@onerussian.com> <4DA5E440.2060803@gmail.com> Message-ID: <20110413190226.GG7764@onerussian.com> On Wed, 13 Apr 2011, Bruce Southey wrote: > I did not run it very long because I saw this message: > /usr/lib64/python2.7/site-packages/scipy/stats/distributions.py:1882: > RuntimeWarning: invalid value encountered in double_scalars > Lhat = muhat - Shat*mu > It seems that line 1874 (mu, mu2 = > self.stats(*args,**{'moments':'mv'})) give mu and mu2 as inf's. So Lhat > is nan and there are better uses for that cpu power than spinning around > infinities ... lucky you -- I got none of that warning. Although I must confess, scipy 0.9.0 is really "talkative" without any way to shut it really up: $> dpkg -L python-scipy | grep '\.py' | xargs grep -i "print.*warn" | head /usr/share/pyshared/scipy/signal/signaltools.py: print "Warning: imaginary part of x ignored." /usr/share/pyshared/scipy/signal/signaltools.py: print "Warning: imaginary part of x ignored." ... $> dpkg -L python-scipy | grep '\.py' | xargs grep -i "print.*warn" | wc -l 132 great to see that future 0.9.1 will be saner: $> git describe --tags v0.4.3-4868-g9b5db2c $> git grep -i 'print[^f].*war' | wc -l 47 -- =------------------------------------------------------------------= Keep in touch www.onerussian.com Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic From josh.k.lawrence at gmail.com Wed Apr 13 15:10:59 2011 From: josh.k.lawrence at gmail.com (Josh Lawrence) Date: Wed, 13 Apr 2011 15:10:59 -0400 Subject: [SciPy-Dev] calc_lwork.f different from Lapack? Message-ID: <4DA5F543.8020104@gmail.com> Hello, After receiving an error in using linalg.lstsq, I started some investigating. I found that scipy/linalg/src/calc_lwork.f is essentially a stripped down version of the appropriate functions in Lapack (for linalg.lstsq using double precision complex numbers, it is ZGELSS). It seems that the portions for gelss in calc_lwork.f do not match the current version of lapack. I believe this is the source of my error (it doesn't occur if I use linalg.pinv2 for least squares instead). Is there a particular rationale for these being different or perhaps an incorrect copy and paste? The relevant portions are shown below (a line of % characters are prepended before the codes from the two locations). For example, the first calculation of MAXWRK under Path 1 uses 3*N in calc_lwork and 2*N in lapack. If things were just being over-estimated, I wouldn't really care, but I was able to isolate down that the variable LWORK (calculated from MINWRK) is too small, which if I read the rest of the code right means that some work arrays are not long enough. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% calc_lwork.f (from scipy trunk on github, lines 191-261): IF( M.GE.N .AND. M.GE.MNTHR ) THEN * * Path 1a - overdetermined, with many more rows than columns * MM = N MAXWRK = MAX( MAXWRK, N+N*ILAENV( 1, prefix // 'GEQRF', ' ', $ M, N, -1, -1 ) ) MAXWRK = MAX( MAXWRK, N+NRHS* $ ILAENV( 1, prefix // 'ORMQR', 'LT', M, NRHS, N, -1 ) ) END IF IF( M.GE.N ) THEN * * Path 1 - overdetermined or exactly determined * * Compute workspace neede for BDSQR * BDSPAC = MAX( 1, 5*N ) MAXWRK = MAX( MAXWRK, 3*N+( MM+N )* $ ILAENV( 1, prefix // 'GEBRD', ' ', MM, N, -1, -1 ) ) MAXWRK = MAX( MAXWRK, 3*N+NRHS* $ ILAENV( 1, prefix // 'ORMBR', 'QLT', MM, NRHS, N, -1 ) ) MAXWRK = MAX( MAXWRK, 3*N+( N-1 )* $ ILAENV( 1, prefix // 'ORGBR', 'P', N, N, N, -1 ) ) MAXWRK = MAX( MAXWRK, BDSPAC ) MAXWRK = MAX( MAXWRK, N*NRHS ) MINWRK = MAX( 3*N+MM, 3*N+NRHS, BDSPAC ) MAXWRK = MAX( MINWRK, MAXWRK ) END IF IF( N.GT.M ) THEN * * Compute workspace neede for DBDSQR * BDSPAC = MAX( 1, 5*M ) MINWRK = MAX( 3*M+NRHS, 3*M+N, BDSPAC ) IF( N.GE.MNTHR ) THEN * * Path 2a - underdetermined, with many more columns * than rows * MAXWRK = M + M*ILAENV( 1, prefix // 'GELQF', ' ', $ M, N, -1, -1 ) MAXWRK = MAX( MAXWRK, M*M+4*M+2*M* $ ILAENV( 1, prefix // 'GEBRD', ' ', M, M, -1, -1 ) ) MAXWRK = MAX( MAXWRK, M*M+4*M+NRHS* $ ILAENV( 1, prefix // 'ORMBR', 'QLT', M, NRHS, M, -1 )) MAXWRK = MAX( MAXWRK, M*M+4*M+( M-1 )* $ ILAENV( 1, prefix // 'ORGBR', 'P', M, M, M, -1 ) ) MAXWRK = MAX( MAXWRK, M*M+M+BDSPAC ) IF( NRHS.GT.1 ) THEN MAXWRK = MAX( MAXWRK, M*M+M+M*NRHS ) ELSE MAXWRK = MAX( MAXWRK, M*M+2*M ) END IF MAXWRK = MAX( MAXWRK, M+NRHS* $ ILAENV( 1, prefix // 'ORMLQ', 'LT', N, NRHS, M, -1 ) ) ELSE * * Path 2 - underdetermined * MAXWRK = 3*M + ( N+M )*ILAENV( 1, prefix // 'GEBRD', ' ', $ M, N, -1, -1 ) MAXWRK = MAX( MAXWRK, 3*M+NRHS* $ ILAENV( 1, prefix // 'ORMBR', 'QLT', M, NRHS, M, -1 ) ) MAXWRK = MAX( MAXWRK, 3*M+M* $ ILAENV( 1, prefix // 'ORGBR', 'P', M, N, M, -1 ) ) MAXWRK = MAX( MAXWRK, BDSPAC ) MAXWRK = MAX( MAXWRK, N*NRHS ) END IF END IF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ZGELSS.F (from LAPACK on netlib, lines 165-236): IF( INFO.EQ.0 ) THEN MINWRK = 1 MAXWRK = 1 IF( MINMN.GT.0 ) THEN MM = M MNTHR = ILAENV( 6, 'ZGELSS', ' ', M, N, NRHS, -1 ) IF( M.GE.N .AND. M.GE.MNTHR ) THEN * * Path 1a - overdetermined, with many more rows than * columns * MM = N MAXWRK = MAX( MAXWRK, N + N*ILAENV( 1, 'ZGEQRF', ' ', M, $ N, -1, -1 ) ) MAXWRK = MAX( MAXWRK, N + NRHS*ILAENV( 1, 'ZUNMQR', 'LC', $ M, NRHS, N, -1 ) ) END IF IF( M.GE.N ) THEN * * Path 1 - overdetermined or exactly determined * MAXWRK = MAX( MAXWRK, 2*N + ( MM + N )*ILAENV( 1, $ 'ZGEBRD', ' ', MM, N, -1, -1 ) ) MAXWRK = MAX( MAXWRK, 2*N + NRHS*ILAENV( 1, 'ZUNMBR', $ 'QLC', MM, NRHS, N, -1 ) ) MAXWRK = MAX( MAXWRK, 2*N + ( N - 1 )*ILAENV( 1, $ 'ZUNGBR', 'P', N, N, N, -1 ) ) MAXWRK = MAX( MAXWRK, N*NRHS ) MINWRK = 2*N + MAX( NRHS, M ) END IF IF( N.GT.M ) THEN MINWRK = 2*M + MAX( NRHS, N ) IF( N.GE.MNTHR ) THEN * * Path 2a - underdetermined, with many more columns * than rows * MAXWRK = M + M*ILAENV( 1, 'ZGELQF', ' ', M, N, -1, $ -1 ) MAXWRK = MAX( MAXWRK, 3*M + M*M + 2*M*ILAENV( 1, $ 'ZGEBRD', ' ', M, M, -1, -1 ) ) MAXWRK = MAX( MAXWRK, 3*M + M*M + NRHS*ILAENV( 1, $ 'ZUNMBR', 'QLC', M, NRHS, M, -1 ) ) MAXWRK = MAX( MAXWRK, 3*M + M*M + ( M - 1 )*ILAENV( 1, $ 'ZUNGBR', 'P', M, M, M, -1 ) ) IF( NRHS.GT.1 ) THEN MAXWRK = MAX( MAXWRK, M*M + M + M*NRHS ) ELSE MAXWRK = MAX( MAXWRK, M*M + 2*M ) END IF MAXWRK = MAX( MAXWRK, M + NRHS*ILAENV( 1, 'ZUNMLQ', $ 'LC', N, NRHS, M, -1 ) ) ELSE * * Path 2 - underdetermined * MAXWRK = 2*M + ( N + M )*ILAENV( 1, 'ZGEBRD', ' ', M, $ N, -1, -1 ) MAXWRK = MAX( MAXWRK, 2*M + NRHS*ILAENV( 1, 'ZUNMBR', $ 'QLC', M, NRHS, M, -1 ) ) MAXWRK = MAX( MAXWRK, 2*M + M*ILAENV( 1, 'ZUNGBR', $ 'P', M, N, M, -1 ) ) MAXWRK = MAX( MAXWRK, N*NRHS ) END IF END IF MAXWRK = MAX( MINWRK, MAXWRK ) END IF WORK( 1 ) = MAXWRK * IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) $ INFO = -12 END IF From josef.pktd at gmail.com Fri Apr 15 10:42:36 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Fri, 15 Apr 2011 10:42:36 -0400 Subject: [SciPy-Dev] distributions.ncf.fit -- never converges? In-Reply-To: <4DA5E440.2060803@gmail.com> References: <20110413143435.GD7764@onerussian.com> <20110413170845.GE7764@onerussian.com> <4DA5E440.2060803@gmail.com> Message-ID: On Wed, Apr 13, 2011 at 1:58 PM, Bruce Southey wrote: > On 04/13/2011 12:33 PM, josef.pktd at gmail.com wrote: >> 2011/4/13 Yaroslav Halchenko: >>> Thanks Josef for the confirmation and making your computer sweat ;) >>> >>> I have built current master >>> >>> *In [3]: scipy.__version__ >>> Out[3]: '0.10.0.dev' >>> >>> the same story. >> The default starting parameters have changed. If your example worked >> before, then it's possible that it works with explicit starting >> parameters. >> >> (I haven't figured out yet how to make my new computer sweat.) >> >> Josef >> >> >>> apparently it is known to some degree -- ncf is skipped the unittesting: >>> >>> $> ?git grep -A 10 'TestFitMethod' >>> scipy/stats/tests/test_distributions.py:class TestFitMethod(TestCase): >>> scipy/stats/tests/test_distributions.py- ? ?skip = ['ncf'] >>> scipy/stats/tests/test_distributions.py- >>> scipy/stats/tests/test_distributions.py- ? ?@dec.slow >>> scipy/stats/tests/test_distributions.py- ? ?def test_fit(self): >>> scipy/stats/tests/test_distributions.py- ? ? ? ?for func, dist, args, alpha in test_all_distributions(): >>> scipy/stats/tests/test_distributions.py- ? ? ? ? ? ?if dist in self.skip: >>> scipy/stats/tests/test_distributions.py- ? ? ? ? ? ? ? ?continue >>> >>> $> ?git show ba349771 >>> commit ba349771afebb1473a961139570da770ada59032 >>> Author: Travis Oliphant >>> Date: ? Tue Jun 1 07:59:20 2010 +0000 >>> >>> ? ? Add tests for fit method including fixing input parameters. >>> >>> >>> ;-) :-/ >>> >>> On Wed, 13 Apr 2011, josef.pktd at gmail.com wrote: >>> >>>>> ? python -c 'import scipy.stats.distributions as ssd, numpy as np; d=ssd.ncf; d.fit(np.array([-0.03756533, ?0.18115522, ?0.06605958, -0.09195276, ?0.06162608, 0.07139736, -0.1570828 , -0.11967677, -0.19186652, ?0.29411319]));' >>>> I only have 0.9.0, I forgot to kill the process and 1 hour 22 minutes >>>> of cpu time later it still hadn't returned. >>>> At least a maximum iteration or maximum function evaluation should >>>> have stopped it. >>>> Josef >>> -- >>> =------------------------------------------------------------------= >>> Keep in touch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? www.onerussian.com >>> Yaroslav Halchenko ? ? ? ? ? ? ? ? www.ohloh.net/accounts/yarikoptic >>> _______________________________________________ >>> SciPy-Dev mailing list >>> SciPy-Dev at scipy.org >>> http://mail.scipy.org/mailman/listinfo/scipy-dev >>> >> _______________________________________________ >> SciPy-Dev mailing list >> SciPy-Dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/scipy-dev > I did not run it very long because I saw this message: > /usr/lib64/python2.7/site-packages/scipy/stats/distributions.py:1882: > RuntimeWarning: invalid value encountered in double_scalars > ? Lhat = muhat - Shat*mu > > It seems that ?line 1874 (mu, mu2 = > self.stats(*args,**{'moments':'mv'})) give mu and mu2 as inf's. So Lhat > is nan and there are better uses for that cpu power than spinning around > infinities ... "To infinity and the nans beyond." It looks like mean and variance are only finite if the degrees of freedom for the ncf, dfn, dfd, are large enough, so I guess the starting values should be large. I think _fitstart could default back to loc=0, scale=1 if np.any(~np.isfinite(self.fit_loc_scale(data, *args))) This would remove at least one source of infs and nans. Yaroslav, Did you ever get a good estimate in your example with older versions? With numpy 1.3, scipy 0.72 and with fully specified starting values in scipy 0.9, the estimation results are the same as the starting values. So the estimation doesn't move and does not produce any useful results. (I don't have scipy 0.8 right now.) Also as a note: ncf doesn't have the pdf defined. I removed it a long time ago because it was buggy, and didn't figure out how to fix it. So any maximum likelihood estimation has to work with the generic pdf. Josef > > Bruce > > > > > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > From xperroni at gmail.com Sun Apr 17 09:37:19 2011 From: xperroni at gmail.com (Helio Perroni Filho) Date: Sun, 17 Apr 2011 10:37:19 -0300 Subject: [SciPy-Dev] The state of weave.accelerate? Message-ID: Dera all, I have been looking for ways to speed up some portions of Python code in my current scipy project. The ideal solution would allow me to keep writing all my code in Python 2.7 ? even if the "accelerated" parts had to written in a subset of the language, as in PyPy's Restricted Python ? and be easily turned off for debugging. When I learned of scipy.weave.inline, my first thought was "now if only there was a Python-to-C++ translator I could hook up to this!" I was intrigued when I found that cryptic reference about sicpy.weave.accelerate providing "automatic acceleration of Python code"; all the more after searching for more information on it, and finding none. So I decided to take a look at the code. The API seemed simple enough (just a decorator for top-level functions), so I tried it on some toy scripts I keep around. After hacking around a couple simple bugs (two incorrect assertions in bytecodecompiler, a typo defining the one-argument form of the range function and the need to add weave's directory to the compiler include-path in accelerate_tools) I got stuck on the many not-yet-implemented instructions in bytecodecompiler: it seems even basic arithmetic is still to be included. I find this frustrating. From the tests I've run it seems accelerate() already does an adequate work of generating the necessary C++ boilerplate code, compiling it to an extension and then wiring the result back to the executing script. The only thing missing is getting the C++ translation to work ? not trivial, I know, but not very hard either, considering what's already in place. Is a lack of manpower holding accelerate() back? If that's the case, I volunteer to work on bytecodecompiler, and get it to at least an RPython-level of functionality. I have read the documentation on the Developer Zone, but didn't find how do I create a Trac account. And besides that, is there anything else not on that page that I should know? -- Ja ne, Helio Perroni Filho http://machineawakening.blogspot.com/ From ralf.gommers at googlemail.com Sun Apr 17 16:30:02 2011 From: ralf.gommers at googlemail.com (Ralf Gommers) Date: Sun, 17 Apr 2011 22:30:02 +0200 Subject: [SciPy-Dev] The state of weave.accelerate? In-Reply-To: References: Message-ID: On Sun, Apr 17, 2011 at 3:37 PM, Helio Perroni Filho wrote: > Dera all, > > I have been looking for ways to speed up some portions of Python code > in my current scipy project. The ideal solution would allow me to keep > writing all my code in Python 2.7 ? even if the "accelerated" parts > had to written in a subset of the language, as in PyPy's Restricted > Python ? and be easily turned off for debugging. > > When I learned of scipy.weave.inline, my first thought was "now if > only there was a Python-to-C++ translator I could hook up to this!" I > was intrigued when I found that cryptic reference about > sicpy.weave.accelerate providing "automatic acceleration of Python > code"; all the more after searching for more information on it, and > finding none. > > So I decided to take a look at the code. The API seemed simple enough > (just a decorator for top-level functions), so I tried it on some toy > scripts I keep around. After hacking around a couple simple bugs (two > incorrect assertions in bytecodecompiler, a typo defining the > one-argument form of the range function and the need to add weave's > directory to the compiler include-path in accelerate_tools) I got > stuck on the many not-yet-implemented instructions in > bytecodecompiler: it seems even basic arithmetic is still to be > included. > > I find this frustrating. From the tests I've run it seems accelerate() > already does an adequate work of generating the necessary C++ > boilerplate code, compiling it to an extension and then wiring the > result back to the executing script. The only thing missing is getting > the C++ translation to work ? not trivial, I know, but not very hard > either, considering what's already in place. > > Is a lack of manpower holding accelerate() back? If that's the case, I > volunteer to work on bytecodecompiler, and get it to at least an > RPython-level of functionality. Unfortunately all of scipy.weave is not actively developed (only some basic maintenance the last few years). It is also the only scipy module that does not (yet?) work with Python 3. It's my impression that it does its job for legacy code, but for new development people tend to prefer Cython. Maybe someone who knows more about the weave history and current state will answer you in more detail. If you would be willing to work on it that would be great. As you have already experienced already though, it may be quite some work to fix the small bugs and modernize the code a bit. I also don't know how the functionality compares to what's in Shedskin and Nuitka, which are both (not inline I think) Python to C++ compilers. > I have read the documentation on the > Developer Zone, but didn't find how do I create a Trac account. And > besides that, is there anything else not on that page that I should > know? You can create a Trac account at http://projects.scipy.org/scipy/register Development has moved to git and github, and sending a pull request there is generally more effective than adding patches in Trac. The process is described here: http://docs.scipy.org/doc/numpy/dev/ Cheers, Ralf From millman at berkeley.edu Mon Apr 18 21:16:23 2011 From: millman at berkeley.edu (Jarrod Millman) Date: Mon, 18 Apr 2011 18:16:23 -0700 Subject: [SciPy-Dev] The state of weave.accelerate? In-Reply-To: References: Message-ID: Hi, As Ralf already mentioned, you should probably take a look at Cython: http://cython.org/ Cython is very widely used and is improving rapidly. The Cython developers added functionality similar to weave.inline last December: http://wiki.cython.org/enhancements/inline There is a nice tutorial for using Cython with NumPy here: http://wiki.cython.org/tutorials/numpy Native support for C++ was added in 0.13: http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html Currently, support for Fortran is provided by fwrap: http://fwrap.github.com You may also be interested in the Cython article in the recent special issue of CiSE on scientific computing with Python: http://www.computer.org/portal/web/csdl/abs/mags/cs/2011/02/mcs201102toc.htm Best, Jarrod From zw4131 at gmail.com Fri Apr 22 13:32:08 2011 From: zw4131 at gmail.com (=?GB2312?B?va20886w?=) Date: Sat, 23 Apr 2011 01:32:08 +0800 Subject: [SciPy-Dev] I want to do some traslation about the SciPy Reference Guide Message-ID: Hi guys I am a Chinese postgraduate student in the Australian National University. And I am using SciPy to develop some machine learning algorithms. But I found I could not use classes and functions smoothly, because I often encountered many technical and mathematical words which I could understand in Chinese but couldn?t in English. So I was often interrupted when I was thinking, which was quite annoying. So I guess it is absolutely a major stumbling block for other Chinese students to use SciPy. You can?t expect them to learn English well as well as mathematics. So I want to translate the SciPy Reference Guide into Chinese. Is it ok? Can you give me some advice or some help? -------------- next part -------------- An HTML attachment was scrubbed... URL: From zw4131 at gmail.com Fri Apr 22 13:38:04 2011 From: zw4131 at gmail.com (=?GB2312?B?va20886w?=) Date: Sat, 23 Apr 2011 01:38:04 +0800 Subject: [SciPy-Dev] I want to do some translation about the SciPy Reference Guide Message-ID: Hi guys I am a Chinese postgraduate student in the Australian National University. And I am using SciPy to develop some machine learning algorithms. But I found I could not use classes and functions smoothly, because I often encountered many technical and mathematical words which I could understand in Chinese but couldn?t in English. So I was often interrupted when I was thinking, which was quite annoying. So I guess it is absolutely a major stumbling block for other Chinese students to use SciPy. You can?t expect them to learn English well as well as mathematics. So I want to translate the SciPy Reference Guide into Chinese. Is it ok? Can you give me some advice or some help? -------------- next part -------------- An HTML attachment was scrubbed... URL: From zw4131 at gmail.com Fri Apr 22 17:39:25 2011 From: zw4131 at gmail.com (=?GB2312?B?va20886w?=) Date: Sat, 23 Apr 2011 05:39:25 +0800 Subject: [SciPy-Dev] possible bug in register Message-ID: Dear all When I tried to registered an new account in the SciPy dev wiki( http://projects.scipy.org/scipy/register), the webpage always said incorrect captcha input but I could not find where the captcha was. What happened? cheers David -------------- next part -------------- An HTML attachment was scrubbed... URL: From josef.pktd at gmail.com Fri Apr 22 18:43:53 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Fri, 22 Apr 2011 18:43:53 -0400 Subject: [SciPy-Dev] possible bug in register In-Reply-To: References: Message-ID: 2011/4/22 ??? : > Dear all > > > When I tried to registered an new account in the SciPy dev > wiki(http://projects.scipy.org/scipy/register), the webpage always said > incorrect captcha input but I could not find where the captcha was. > > What happened? I see the (re)captcha insert just above the "Create account" button. Maybe your browser filters it out ? Josef > > > > cheers > > David > > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > > From fabian.pedregosa at inria.fr Sat Apr 23 03:56:44 2011 From: fabian.pedregosa at inria.fr (Fabian Pedregosa) Date: Sat, 23 Apr 2011 09:56:44 +0200 Subject: [SciPy-Dev] calc_lwork.f different from Lapack? In-Reply-To: <1198903824.2028545.1302721868001.JavaMail.root@zmbs3.inria.fr> References: <1198903824.2028545.1302721868001.JavaMail.root@zmbs3.inria.fr> Message-ID: On Wed, Apr 13, 2011 at 9:11 PM, Josh Lawrence wrote: > Hello, > > After receiving an error in using linalg.lstsq, I started some > investigating. I found that scipy/linalg/src/calc_lwork.f is essentially > a stripped down version of the appropriate functions in Lapack (for > linalg.lstsq using double precision complex numbers, it is ZGELSS). It > seems that the portions for gelss in calc_lwork.f do not match the > current version of lapack. I believe this is the source of my error (it > doesn't occur if I use linalg.pinv2 for least squares instead). Is there > a particular rationale for these being different or perhaps an incorrect > copy and paste? The relevant portions are shown below (a line of % > characters are prepended before the codes from the two locations). Hi Josh! I think we could avoid some of these problems by using the LAPACK workspace query mechanism instead of calc_lwork. I submitted a patch for this: https://github.com/scipy/scipy/pull/13 It would be great if you could comment on it and confirm that it solves the problem. Best, Fabian From ralf.gommers at googlemail.com Sat Apr 23 06:04:14 2011 From: ralf.gommers at googlemail.com (Ralf Gommers) Date: Sat, 23 Apr 2011 12:04:14 +0200 Subject: [SciPy-Dev] I want to do some translation about the SciPy Reference Guide In-Reply-To: References: Message-ID: Hi, On Fri, Apr 22, 2011 at 7:38 PM, ??? wrote: > Hi guys > I am a Chinese postgraduate student in the Australian National University. > And I am using SciPy to develop some machine learning algorithms. But I > found I could not use classes and functions smoothly, because I often > encountered many technical and mathematical words which I could understand > in Chinese but couldn?t in English. So I was often interrupted when I was > thinking, which was quite annoying. > So I guess it is absolutely a major stumbling block for other Chinese > students to use SciPy. You can?t expect them to learn English well as well > as mathematics. > So I want to translate the SciPy Reference Guide into Chinese. > Is it ok? Can you give me some advice or some help? It would be great to have more accessible documentation for Chinese speakers. I would suggest a translation of the first part of the Scipy Reference Guide, the tutorial (http://docs.scipy.org/doc/scipy/reference/tutorial/index.html). The rest of the Reference Guide is autogenerated from docstrings, which I don't think is feasible to translate for several reasons (no toolchain support, not maintainable, too much work). We could distribute the tutorial separately from the rest of the reference guide, this is done for Numpy too. You can find the sources for the tutorial under doc/source/tutorial/. If you think this is the right way to go, it should be easy to jump in. Cheers, Ralf From charlesr.harris at gmail.com Sat Apr 23 10:26:02 2011 From: charlesr.harris at gmail.com (Charles R Harris) Date: Sat, 23 Apr 2011 08:26:02 -0600 Subject: [SciPy-Dev] I want to do some translation about the SciPy Reference Guide In-Reply-To: References: Message-ID: On Sat, Apr 23, 2011 at 4:04 AM, Ralf Gommers wrote: > Hi, > > On Fri, Apr 22, 2011 at 7:38 PM, ??? wrote: > > Hi guys > > I am a Chinese postgraduate student in the Australian National > University. > > And I am using SciPy to develop some machine learning algorithms. But I > > found I could not use classes and functions smoothly, because I often > > encountered many technical and mathematical words which I could > understand > > in Chinese but couldn?t in English. So I was often interrupted when I was > > thinking, which was quite annoying. > > So I guess it is absolutely a major stumbling block for other Chinese > > students to use SciPy. You can?t expect them to learn English well as > well > > as mathematics. > > So I want to translate the SciPy Reference Guide into Chinese. > > Is it ok? Can you give me some advice or some help? > > It would be great to have more accessible documentation for Chinese > speakers. I would suggest a translation of the first part of the Scipy > Reference Guide, the tutorial > (http://docs.scipy.org/doc/scipy/reference/tutorial/index.html). The > rest of the Reference Guide is autogenerated from docstrings, which I > don't think is feasible to translate for several reasons (no toolchain > support, not maintainable, too much work). We could distribute the > tutorial separately from the rest of the reference guide, this is done > for Numpy too. > > You can find the sources for the tutorial under doc/source/tutorial/. > If you think this is the right way to go, it should be easy to jump > in. > > Is the documentation copyrighted? If not, should it be? Chuck -------------- next part -------------- An HTML attachment was scrubbed... URL: From ralf.gommers at googlemail.com Sat Apr 23 14:39:50 2011 From: ralf.gommers at googlemail.com (Ralf Gommers) Date: Sat, 23 Apr 2011 20:39:50 +0200 Subject: [SciPy-Dev] I want to do some translation about the SciPy Reference Guide In-Reply-To: References: Message-ID: On Sat, Apr 23, 2011 at 4:26 PM, Charles R Harris wrote: > > > On Sat, Apr 23, 2011 at 4:04 AM, Ralf Gommers > wrote: >> >> Hi, >> >> On Fri, Apr 22, 2011 at 7:38 PM, ??? wrote: >> > Hi guys >> > I am a Chinese postgraduate student in the Australian National >> > University. >> > And I am using SciPy to develop some machine learning algorithms. But I >> > found I could not use classes and functions smoothly, because I often >> > encountered many technical and mathematical words which I could >> > understand >> > in Chinese but couldn?t in English. So I was often interrupted when I >> > was >> > thinking, which was quite annoying. >> > So I guess it is absolutely a major stumbling block for other Chinese >> > students to use SciPy. You can?t expect them to learn English well as >> > well >> > as mathematics. >> > So I want to translate the SciPy Reference Guide into Chinese. >> > Is it ok? Can you give me some advice or some help? >> >> It would be great to have more accessible documentation for Chinese >> speakers. I would suggest a translation of the first part of the Scipy >> Reference Guide, the tutorial >> (http://docs.scipy.org/doc/scipy/reference/tutorial/index.html). The >> rest of the Reference Guide is autogenerated from docstrings, which I >> don't think is feasible to translate for several reasons (no toolchain >> support, not maintainable, too much work). We could distribute the >> tutorial separately from the rest of the reference guide, this is done >> for Numpy too. >> >> You can find the sources for the tutorial under doc/source/tutorial/. >> If you think this is the right way to go, it should be easy to jump >> in. >> > > Is the documentation copyrighted? If not, should it be? For the BSD license that's not very clear, at least I can't find a clear explanation anywhere. Several other license include documentation explicitly, for example the MIT license starts: "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software")". I'd guess the docs in the source tree are covered by the BSD license, but IANAL. Ralf From robert.kern at gmail.com Sat Apr 23 15:27:24 2011 From: robert.kern at gmail.com (Robert Kern) Date: Sat, 23 Apr 2011 14:27:24 -0500 Subject: [SciPy-Dev] I want to do some translation about the SciPy Reference Guide In-Reply-To: References: Message-ID: On Sat, Apr 23, 2011 at 09:26, Charles R Harris wrote: > > On Sat, Apr 23, 2011 at 4:04 AM, Ralf Gommers > wrote: >> >> Hi, >> >> On Fri, Apr 22, 2011 at 7:38 PM, ??? wrote: >> > Hi guys >> > I am a Chinese postgraduate student in the Australian National >> > University. >> > And I am using SciPy to develop some machine learning algorithms. But I >> > found I could not use classes and functions smoothly, because I often >> > encountered many technical and mathematical words which I could >> > understand >> > in Chinese but couldn?t in English. So I was often interrupted when I >> > was >> > thinking, which was quite annoying. >> > So I guess it is absolutely a major stumbling block for other Chinese >> > students to use SciPy. You can?t expect them to learn English well as >> > well >> > as mathematics. >> > So I want to translate the SciPy Reference Guide into Chinese. >> > Is it ok? Can you give me some advice or some help? >> >> It would be great to have more accessible documentation for Chinese >> speakers. I would suggest a translation of the first part of the Scipy >> Reference Guide, the tutorial >> (http://docs.scipy.org/doc/scipy/reference/tutorial/index.html). The >> rest of the Reference Guide is autogenerated from docstrings, which I >> don't think is feasible to translate for several reasons (no toolchain >> support, not maintainable, too much work). We could distribute the >> tutorial separately from the rest of the reference guide, this is done >> for Numpy too. >> >> You can find the sources for the tutorial under doc/source/tutorial/. >> If you think this is the right way to go, it should be easy to jump >> in. > > Is the documentation copyrighted? If not, should it be? Everything is copyrighted, by the Berne Convention. Everything in the numpy distribution, source code and documentation alike (not least because most of it is *in* the code), is under the BSD license except for certain exceptions noted in individual files. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." ? -- Umberto Eco From josef.pktd at gmail.com Sat Apr 23 15:41:24 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Sat, 23 Apr 2011 15:41:24 -0400 Subject: [SciPy-Dev] I want to do some translation about the SciPy Reference Guide In-Reply-To: References: Message-ID: On Sat, Apr 23, 2011 at 3:27 PM, Robert Kern wrote: > On Sat, Apr 23, 2011 at 09:26, Charles R Harris > wrote: >> >> On Sat, Apr 23, 2011 at 4:04 AM, Ralf Gommers >> wrote: >>> >>> Hi, >>> >>> On Fri, Apr 22, 2011 at 7:38 PM, ??? wrote: >>> > Hi guys >>> > I am a Chinese postgraduate student in the Australian National >>> > University. >>> > And I am using SciPy to develop some machine learning algorithms. But I >>> > found I could not use classes and functions smoothly, because I often >>> > encountered many technical and mathematical words which I could >>> > understand >>> > in Chinese but couldn?t in English. So I was often interrupted when I >>> > was >>> > thinking, which was quite annoying. >>> > So I guess it is absolutely a major stumbling block for other Chinese >>> > students to use SciPy. You can?t expect them to learn English well as >>> > well >>> > as mathematics. >>> > So I want to translate the SciPy Reference Guide into Chinese. >>> > Is it ok? Can you give me some advice or some help? >>> >>> It would be great to have more accessible documentation for Chinese >>> speakers. I would suggest a translation of the first part of the Scipy >>> Reference Guide, the tutorial >>> (http://docs.scipy.org/doc/scipy/reference/tutorial/index.html). The >>> rest of the Reference Guide is autogenerated from docstrings, which I >>> don't think is feasible to translate for several reasons (no toolchain >>> support, not maintainable, too much work). We could distribute the >>> tutorial separately from the rest of the reference guide, this is done >>> for Numpy too. >>> >>> You can find the sources for the tutorial under doc/source/tutorial/. >>> If you think this is the right way to go, it should be easy to jump >>> in. >> >> Is the documentation copyrighted? If not, should it be? > > Everything is copyrighted, by the Berne Convention. Everything in the > numpy distribution, source code and documentation alike (not least > because most of it is *in* the code), is under the BSD license except > for certain exceptions noted in individual files. To follow Ralf's look at the details of BSD "Redistribution and use in source and binary forms" does not include printed form, nor other processed sphinx docs (html, pdf, ...) So it's not clear (to me) what usage the BSD license allows for the documentation, i.e. processed rst files and sphinx docs. Josef > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma that is made terrible by our own mad attempt to interpret it as > though it had an underlying truth." > ? -- Umberto Eco > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > From robert.kern at gmail.com Sat Apr 23 15:49:19 2011 From: robert.kern at gmail.com (Robert Kern) Date: Sat, 23 Apr 2011 14:49:19 -0500 Subject: [SciPy-Dev] I want to do some translation about the SciPy Reference Guide In-Reply-To: References: Message-ID: On Sat, Apr 23, 2011 at 14:41, wrote: > On Sat, Apr 23, 2011 at 3:27 PM, Robert Kern wrote: >> On Sat, Apr 23, 2011 at 09:26, Charles R Harris >> wrote: >>> >>> On Sat, Apr 23, 2011 at 4:04 AM, Ralf Gommers >>> wrote: >>>> >>>> Hi, >>>> >>>> On Fri, Apr 22, 2011 at 7:38 PM, ??? wrote: >>>> > Hi guys >>>> > I am a Chinese postgraduate student in the Australian National >>>> > University. >>>> > And I am using SciPy to develop some machine learning algorithms. But I >>>> > found I could not use classes and functions smoothly, because I often >>>> > encountered many technical and mathematical words which I could >>>> > understand >>>> > in Chinese but couldn?t in English. So I was often interrupted when I >>>> > was >>>> > thinking, which was quite annoying. >>>> > So I guess it is absolutely a major stumbling block for other Chinese >>>> > students to use SciPy. You can?t expect them to learn English well as >>>> > well >>>> > as mathematics. >>>> > So I want to translate the SciPy Reference Guide into Chinese. >>>> > Is it ok? Can you give me some advice or some help? >>>> >>>> It would be great to have more accessible documentation for Chinese >>>> speakers. I would suggest a translation of the first part of the Scipy >>>> Reference Guide, the tutorial >>>> (http://docs.scipy.org/doc/scipy/reference/tutorial/index.html). The >>>> rest of the Reference Guide is autogenerated from docstrings, which I >>>> don't think is feasible to translate for several reasons (no toolchain >>>> support, not maintainable, too much work). We could distribute the >>>> tutorial separately from the rest of the reference guide, this is done >>>> for Numpy too. >>>> >>>> You can find the sources for the tutorial under doc/source/tutorial/. >>>> If you think this is the right way to go, it should be easy to jump >>>> in. >>> >>> Is the documentation copyrighted? If not, should it be? >> >> Everything is copyrighted, by the Berne Convention. Everything in the >> numpy distribution, source code and documentation alike (not least >> because most of it is *in* the code), is under the BSD license except >> for certain exceptions noted in individual files. > > To follow Ralf's look at the details of BSD > > "Redistribution and use in source and binary forms" ?does not include > printed form, nor other processed sphinx docs (html, pdf, ...) Yes, it does. No, it's not as explicit as it could be, but it does. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." ? -- Umberto Eco From jba at SDF.LONESTAR.ORG Tue Apr 26 08:40:06 2011 From: jba at SDF.LONESTAR.ORG (Jeffrey Armstrong) Date: Tue, 26 Apr 2011 12:40:06 +0000 (UTC) Subject: [SciPy-Dev] Discrete-time additions to scipy.signal Message-ID: Hi folks, I've been working on some additions to the scipy.signal module. A significant portion of my work involves dealing with linear systems in the discrete-time domain, but I found that most of the functionality I would need in scipy is implemented only in the continuous domain. I've therefore added some code to handle the discrete time cases. My fork is visible at: https://github.com/ArmstrongJ/scipy Additionally, I presented at PyCon 2011, and I briefly discussed a discrete algebraic Riccati equation solver I had implemented in Python. I've included that code into scipy.signal along with a continuous implementation. I'd appreciate some comments and review of the code. Everything seems to be working for me at this point, but any constructive criticism is greatly appreciated. -Jeff Jeff Armstrong - jba at sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org From ralf.gommers at googlemail.com Tue Apr 26 16:28:54 2011 From: ralf.gommers at googlemail.com (Ralf Gommers) Date: Tue, 26 Apr 2011 22:28:54 +0200 Subject: [SciPy-Dev] Discrete-time additions to scipy.signal In-Reply-To: References: Message-ID: Hi Jeffrey, On Tue, Apr 26, 2011 at 2:40 PM, Jeffrey Armstrong wrote: > Hi folks, I've been working on some additions to the scipy.signal module. > A significant portion of my work involves dealing with linear systems in > the discrete-time domain, but I found that most of the functionality I > would need in scipy is implemented only in the continuous domain. ?I've > therefore added some code to handle the discrete time cases. ?My fork is > visible at: > > https://github.com/ArmstrongJ/scipy > > Additionally, I presented at PyCon 2011, and I briefly discussed a > discrete algebraic Riccati equation solver I had implemented in Python. > I've included that code into scipy.signal along with a continuous > implementation. > > I'd appreciate some comments and review of the code. ?Everything seems to > be working for me at this point, but any constructive criticism is greatly > appreciated. I looked through your changes and at first glance it looks pretty good to me. It's not so easy to review however, because it's all in your master branch, it's a lot of code, and there is quite some code added that is later deleted again. It would be easier if you would create separate branches for separate features (not your master branch, keep that a clean mirror of the numpy master branch). There are at least two, the discrete versions of features already present for the continuous domain, and your additions of Riccati, Lyapunov and Sylvester solvers. Perhaps the sort kw for decomp_schur is a third. The current names of modules are not very descriptive. They could be changed to something like: c2d -> cont2discrete care+dare -> riccati lyap+dlyap -> lyapunov Or maybe put it in a "control" module. Can you explain the relation to pydare a bit? Is this code all from pydare and are you relicensing it as BSD and proposing it for inclusion, or is part of this new code? Cheers, Ralf From jba at SDF.LONESTAR.ORG Wed Apr 27 07:28:21 2011 From: jba at SDF.LONESTAR.ORG (Jeffrey Armstrong) Date: Wed, 27 Apr 2011 11:28:21 +0000 (UTC) Subject: [SciPy-Dev] Discrete-time additions to scipy.signal In-Reply-To: References: Message-ID: On Tue, 26 Apr 2011, Ralf Gommers wrote: > Hi Jeffrey, > > I looked through your changes and at first glance it looks pretty good > to me. It's not so easy to review however, because it's all in your > master branch, it's a lot of code, and there is quite some code added > that is later deleted again. It would be easier if you would create > separate branches for separate features (not your master branch, keep > that a clean mirror of the numpy master branch). There are at least > two, the discrete versions of features already present for the > continuous domain, and your additions of Riccati, Lyapunov and > Sylvester solvers. Perhaps the sort kw for decomp_schur is a third. Ralf, I apologize for the lack of branches. I must confess that this is my first large-scale experience in a git environment so I'm still getting the hang of it. You've summarized the changes pretty well: 1. Duplicating most of the continuous functionality in the discrete domain (dltisys.py, c2d.py) 2. Adding Lyapunov and algebraic Riccati equation solvers (lyap.py, dlyap.py, dare.py, care.py, decomp_schur.py, trsyl flapack wrapper). The sort kw in decomp_schur is necessary to properly solve the algebraic Riccati equation. > > The current names of modules are not very descriptive. They could be > changed to something like: > c2d -> cont2discrete > care+dare -> riccati > lyap+dlyap -> lyapunov > Or maybe put it in a "control" module. The module names could be more descriptive, I agree. While I think the addition of a "control" module in scipy would perhaps be a good idea, I didn't have the audacity to make such a suggestion from the start. > > Can you explain the relation to pydare a bit? Is this code all from > pydare and are you relicensing it as BSD and proposing it for > inclusion, or is part of this new code? > The pydare package (http://code.google.com/p/pydare/) is a small package providing discrete algebraic Riccati and Lyapunov equation solvers, and I am the sole author. The code was originally licensed under GPLv3 because the discrete Lyapunov equation solver utilized code that had been directly translated from some Octave code into Python, which was also GPL. The pydare package can also exploit SLICOT, another GPL'd package. To contribute the code to SciPy, I do indeed relicense the entirety of my code as BSD-licensed, and I'll assign copyright or whatever as necessary. The GPL-based code in the discrete Lyapunov equation solver has been redacted in its entirety, replaced by original code that relies on the solution of a Sylvester equation instead (requiring an inversion, which is less than ideal). All references to SLICOT have also been removed, and there is not any code present any longer that is not original. Jeff Armstrong - jba at sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org From josef.pktd at gmail.com Wed Apr 27 10:56:43 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Wed, 27 Apr 2011 10:56:43 -0400 Subject: [SciPy-Dev] replace print by custom Warnings Message-ID: should scipy get additional custom warnings instead of print statements ? eg. InterpolationWarning, OptimizationWarning, .... Josef ---------- Forwarded message ---------- From: Yaroslav Halchenko Date: Wed, Apr 27, 2011 at 10:45 AM Subject: Re: [pymvpa] minor bug ? To: pkg-exppsy-pymvpa at lists.alioth.debian.org On Wed, 27 Apr 2011, josef.pktd at gmail.com wrote: > You can just temporarily turn off the warnings in the test, if you add > test for corner cases. > That's how Ralf silenced the scipy test suite. and we silence our tests ;-) but apparently not externals checks > If there are print statements, then it would be a bug in scipy, but > these look like "Warnings" where you have control over what happens to > them. Ha -- poking in my eyes works at times! ?Thanks Josef! Apparently it is indeed numpy warnings so np.seterr(all="ignore") was effective! BUT scipy does use straight printouts of warnings, and that is what made me believe that it was one of them: $> dpkg -L python-scipy | grep '\.py' | xargs grep -i "print.*warn" | head /usr/share/pyshared/scipy/signal/signaltools.py: ? ? ? ?print "Warning: imaginary part of x ignored." /usr/share/pyshared/scipy/signal/signaltools.py: ? ? ? ?print "Warning: imaginary part of x ignored." /usr/share/pyshared/scipy/signal/filter_design.py: ? ? ? ?print "Warning, order is zero...check input parametegstop." /usr/share/pyshared/scipy/interpolate/fitpack.py: ? ? ? ? ? ? ? ?if quiet<2:print 'Warning: Setting x[%d][%d]=x[%d][0]'%(i,m,i) /usr/share/pyshared/scipy/interpolate/fitpack.py: ? ? ? ? ? ?print "Warning: "+_iermess[ier][0] /usr/share/pyshared/scipy/interpolate/fitpack.py: ? ? ? ? ? ?print "Warning: "+_iermess[ier][0] /usr/share/pyshared/scipy/interpolate/fitpack.py: ? ? ? ? ? ?print "Warning: the number of zeros exceeds mest" /usr/share/pyshared/scipy/interpolate/fitpack.py: ? ? ? ? ? ?print "Warning: "+_iermess2[ierm][0] /usr/share/pyshared/scipy/integrate/quadpack.py: ? ? ? ? ? ?print "Warning: " + msg /usr/share/pyshared/scipy/maxentropy/maxentutils.py:# ? ?print "Warning: could not load the fast FORTRAN library for logsumexp()." (git)novo:~/proj/scipy[tags/v0.9.0]git $> git grep -i 'print .*Warning:' scipy/integrate/quadpack.py: ? ? ? ? ? ?print "Warning: " + msg scipy/interpolate/fitpack.py: ? ? ? ? ? ? ? ?if quiet<2:print 'Warning: Setting x[%d][%d]=x[%d][0]'%(i,m,i) scipy/interpolate/fitpack.py: ? ? ? ? ? ?print "Warning: "+_iermess[ier][0] scipy/interpolate/fitpack.py: ? ? ? ? ? ?print "Warning: "+_iermess[ier][0] scipy/interpolate/fitpack.py: ? ? ? ? ? ?print "Warning: the number of zeros exceeds mest" scipy/interpolate/fitpack.py: ? ? ? ? ? ?print "Warning: "+_iermess2[ierm][0] scipy/maxentropy/maxentutils.py:# ? ?print "Warning: could not load the fast FORTRAN library for logsumexp()." scipy/maxentropy/maxentutils.py: ? ? ? ?print "Warning: OverflowError using numpy.exp(). Using slower Python"\ scipy/optimize/anneal.py: ? ? ? ? ? ? ? ?print "Warning: Cooled to %f at %s but this is not" \ scipy/optimize/anneal.py: ? ? ? ? ? ?print "Warning: Maximum number of iterations exceeded." scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Maximum number of function evaluations has "\ scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Maximum number of iterations has been exceeded" scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Desired error not necessarily achieved" \ scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Maximum number of iterations has been exceeded" scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Desired error not necessarily achieved due to precision loss" scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Maximum number of iterations has been exceeded" scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Maximum number of iterations has been exceeded" scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Maximum number of function evaluations has "\ scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Maximum number of iterations has been exceeded" scipy/optimize/optimize.py: ? ? ? ? ? ?print "Warning: Final optimization did not succeed" scipy/signal/signaltools.py: ? ? ? ?print "Warning: imaginary part of x ignored." scipy/signal/signaltools.py: ? ? ? ?print "Warning: imaginary part of x ignored." scipy/sparse/linalg/dsolve/umfpack/umfpack.py: print 'warning: singular matrix' scipy/sparse/linalg/dsolve/umfpack/umfpack.py: print 'warning: recomputing symbolic' scipy/sparse/linalg/dsolve/umfpack/umfpack.py: ? ? ? ? ? ?print 'warning: (almost) singular matrix! '\ scipy/weave/blitz_tools.py: ? ? ? ? ? ?print 'warning: compilation failed. Executing as python code' scipy/weave/build_tools.py: ? ? ? ?#print "warning: build directory was not part of python path."\ scipy/weave/build_tools.py: ? ? ? ?print "warning: specified temp_dir '%s' does not exist " \ scipy/weave/build_tools.py: ? ? ? ? ? ?print "warning:, neither the module's directory nor the "\ scipy/weave/build_tools.py: ? ? ? ? ? ?print 'WARNING: failed to build import library for gcc. Linking will fail.' scipy/weave/catalog.py: ? ? ? ?print 'warning: default directory is not write accessible.' scipy/weave/catalog.py: ? ? ? ?print 'warning: default directory is not write accessible.' scipy/weave/catalog.py: ? ? ? ? ? ?print 'warning: unable to repair catalog entry\n %s\n in\n %s' % \ scipy/weave/swig2_spec.py: ? ? ? ? ? ?print "WARNING: Multiple SWIG versions detected. ?No version was" -- =------------------------------------------------------------------= Keep in touch ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? www.onerussian.com Yaroslav Halchenko ? ? ? ? ? ? ? ? www.ohloh.net/accounts/yarikoptic _______________________________________________ Pkg-ExpPsy-PyMVPA mailing list Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/pkg-exppsy-pymvpa From robert.kern at gmail.com Wed Apr 27 14:05:18 2011 From: robert.kern at gmail.com (Robert Kern) Date: Wed, 27 Apr 2011 13:05:18 -0500 Subject: [SciPy-Dev] replace print by custom Warnings In-Reply-To: References: Message-ID: On Wed, Apr 27, 2011 at 09:56, wrote: > should scipy get additional custom warnings instead of print statements ? > > eg. InterpolationWarning, OptimizationWarning, .... Is that a volunteer I smell? :-) Yes, these print statements should become warnings wherever possible. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." ? -- Umberto Eco From gaston.fiore at gmail.com Wed Apr 27 15:37:38 2011 From: gaston.fiore at gmail.com (Gaston Fiore) Date: Wed, 27 Apr 2011 15:37:38 -0400 Subject: [SciPy-Dev] Editing NumPy User Guide Message-ID: Hello, I've just started learning NumPy and I'm reading the Numpy User Guide. While reading, I've noticed a few minor typos that I'd be happy to fix. As such, I was wondering whether I could get edit permissions so I can start slowly contributing to the project. Thanks, -Gaston From pav at iki.fi Wed Apr 27 16:02:28 2011 From: pav at iki.fi (Pauli Virtanen) Date: Wed, 27 Apr 2011 20:02:28 +0000 (UTC) Subject: [SciPy-Dev] Editing NumPy User Guide References: Message-ID: Hi, On Wed, 27 Apr 2011 15:37:38 -0400, Gaston Fiore wrote: > I've just started learning NumPy and I'm reading the Numpy User Guide. > While reading, I've noticed a few minor typos that I'd be happy to fix. > As such, I was wondering whether I could get edit permissions so I can > start slowly contributing to the project. Sure, granted. -- Pauli Virtanen From josef.pktd at gmail.com Thu Apr 28 14:52:27 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Thu, 28 Apr 2011 14:52:27 -0400 Subject: [SciPy-Dev] replace print by custom Warnings In-Reply-To: References: Message-ID: On Wed, Apr 27, 2011 at 2:05 PM, Robert Kern wrote: > On Wed, Apr 27, 2011 at 09:56, ? wrote: >> should scipy get additional custom warnings instead of print statements ? >> >> eg. InterpolationWarning, OptimizationWarning, .... > > Is that a volunteer I smell? ?:-) I'm currently not smelly enough :), but I created http://projects.scipy.org/scipy/ticket/1428 ( However, after trying for a few hours yesterday, I managed to authenticate with github so I can push something there. git(gui) is kind of fun, at least for bugfixes. ) Josef > > Yes, these print statements should become warnings wherever possible. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma that is made terrible by our own mad attempt to interpret it as > though it had an underlying truth." > ? -- Umberto Eco > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > From ralf.gommers at googlemail.com Thu Apr 28 17:24:50 2011 From: ralf.gommers at googlemail.com (Ralf Gommers) Date: Thu, 28 Apr 2011 23:24:50 +0200 Subject: [SciPy-Dev] Discrete-time additions to scipy.signal In-Reply-To: References: Message-ID: On Wed, Apr 27, 2011 at 1:28 PM, Jeffrey Armstrong wrote: > On Tue, 26 Apr 2011, Ralf Gommers wrote: > >> Hi Jeffrey, >> >> I looked through your changes and at first glance it looks pretty good >> to me. It's not so easy to review however, because it's all in your >> master branch, it's a lot of code, and there is quite some code added >> that is later deleted again. It would be easier if you would create >> separate branches for separate features (not your master branch, keep >> that a clean mirror of the numpy master branch). There are at least >> two, the discrete versions of features already present for the >> continuous domain, and your additions of Riccati, Lyapunov and >> Sylvester solvers. Perhaps the sort kw for decomp_schur is a third. > > Ralf, > > I apologize for the lack of branches. ?I must confess that this is my > first large-scale experience in a git environment so I'm still getting the > hang of it. Are you trying to do this? If you need any help let me know (offline perhaps). >?You've summarized the changes pretty well: > > 1. Duplicating most of the continuous functionality in the discrete domain > (dltisys.py, c2d.py) > 2. Adding Lyapunov and algebraic Riccati equation solvers (lyap.py, > dlyap.py, dare.py, care.py, decomp_schur.py, trsyl flapack wrapper). > > The sort kw in decomp_schur is necessary to properly solve the algebraic > Riccati equation. (1) looks like a good addition, and fits in well in scipy.signal. (2) could use some discussion, if and where it belongs in scipy. It looks like these equations are fairly widely used in control theory (which I don't know all that much about), but they're a bit more exotic/inaccessible than your average scipy function. Cheers, Ralf >> >> The current names of modules are not very descriptive. They could be >> changed to something like: >> c2d -> cont2discrete >> care+dare -> riccati >> lyap+dlyap -> lyapunov >> Or maybe put it in a "control" module. > > The module names could be more descriptive, I agree. ?While I think the > addition of a "control" module in scipy would perhaps be a good idea, I > didn't have the audacity to make such a suggestion from the start. > >> >> Can you explain the relation to pydare a bit? Is this code all from >> pydare and are you relicensing it as BSD and proposing it for >> inclusion, or is part of this new code? >> > > The pydare package (http://code.google.com/p/pydare/) is a small package > providing discrete algebraic Riccati and Lyapunov equation solvers, and I > am the sole author. ?The code was originally licensed under GPLv3 because > the discrete Lyapunov equation solver utilized code that had been directly > translated from some Octave code into Python, which was also GPL. ?The > pydare package can also exploit SLICOT, another GPL'd package. > > To contribute the code to SciPy, I do indeed relicense the entirety of my > code as BSD-licensed, and I'll assign copyright or whatever as necessary. > The GPL-based code in the discrete Lyapunov equation solver has been > redacted in its entirety, replaced by original code that relies on the > solution of a Sylvester equation instead (requiring an inversion, which is > less than ideal). ?All references to SLICOT have also been removed, and > there is not any code present any longer that is not original. > > Jeff Armstrong - jba at sdf.lonestar.org > SDF Public Access UNIX System - http://sdf.lonestar.org > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > From jba at SDF.LONESTAR.ORG Fri Apr 29 08:39:19 2011 From: jba at SDF.LONESTAR.ORG (Jeffrey Armstrong) Date: Fri, 29 Apr 2011 12:39:19 +0000 (UTC) Subject: [SciPy-Dev] Discrete-time additions to scipy.signal In-Reply-To: References: Message-ID: On Thu, 28 Apr 2011, Ralf Gommers wrote: > Are you trying to do this? If you need any help let me know (offline perhaps). I think I've successfully split the changes into two branches: discrete time additions: https://github.com/ArmstrongJ/scipy/tree/discrete-time-signal Lyapunov and algebraic Riccati solvers: https://github.com/ArmstrongJ/scipy/tree/riccati-lyapunov There could possibly be some minor mess with re-committing __init__.py in scipy.signal, but the final product is ok. Git has taken a bit of time to understand. > (1) looks like a good addition, and fits in well in scipy.signal. Great! I'm glad to hear it. > (2) could use some discussion, if and where it belongs in scipy. It > looks like these equations are fairly widely used in control theory > (which I don't know all that much about), but they're a bit more > exotic/inaccessible than your average scipy function. A controls module might indeed be a good place for these to live. Octave (and MATLAB for that matter) keeps them in a controls toolbox, but the linear system functionality in scipy.signal is also present in these toolboxes. Maybe these solvers along with the scipy.signal functionality could provide an interesting place to start on a controls module (scipy.control). I do, however, think that my change introducing the 'sort' keyword to scipy.linalg.schur is a valuable addition. Being able to sort the eigenvalues in some manner is quite useful in a number of situations. This change is present in my riccati-lyapunov branch. -Jeff Jeff Armstrong - jba at sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org From josef.pktd at gmail.com Fri Apr 29 09:10:42 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Fri, 29 Apr 2011 09:10:42 -0400 Subject: [SciPy-Dev] Discrete-time additions to scipy.signal In-Reply-To: References: Message-ID: On Fri, Apr 29, 2011 at 8:39 AM, Jeffrey Armstrong wrote: > On Thu, 28 Apr 2011, Ralf Gommers wrote: > >> Are you trying to do this? If you need any help let me know (offline perhaps). > > I think I've successfully split the changes into two branches: > > discrete time additions: > https://github.com/ArmstrongJ/scipy/tree/discrete-time-signal > > Lyapunov and algebraic Riccati solvers: > https://github.com/ArmstrongJ/scipy/tree/riccati-lyapunov > > There could possibly be some minor mess with re-committing __init__.py in > scipy.signal, but the final product is ok. ?Git has taken a bit of time > to understand. > >> (1) looks like a good addition, and fits in well in scipy.signal. > > Great! ?I'm glad to hear it. > >> (2) could use some discussion, if and where it belongs in scipy. It >> looks like these equations are fairly widely used in control theory >> (which I don't know all that much about), but they're a bit more >> exotic/inaccessible than your average scipy function. > > A controls module might indeed be a good place for these to live. ?Octave > (and MATLAB for that matter) keeps them in a controls toolbox, but the > linear system functionality in scipy.signal is also present in these > toolboxes. ?Maybe these solvers along with the scipy.signal functionality > could provide an interesting place to start on a controls module > (scipy.control). > > I do, however, think that my change introducing the 'sort' keyword to > scipy.linalg.schur is a valuable addition. ?Being able to sort the > eigenvalues in some manner is quite useful in a number of situations. > This change is present in my riccati-lyapunov branch. I browsed the source a bit but haven't tried it. a few comments: pep8 : space after comma in function arguments, class CareSolver: should subclass object for python 2.4, 2.5 compatibility Is mixing arrays and matrices a good idea? In general it's confusing. >From reading the code CareSolver uses matrices, but I didn't see whether it also uses arrays. The continuous and discrete system should use the same matrix/array pattern, and as far as I remember ltisys uses arrays only. Since this has been a wished for feature on the mailing list for a long time, it is nice to see a concrete proposal to enhance scipy. Josef > > -Jeff > > Jeff Armstrong - jba at sdf.lonestar.org > SDF Public Access UNIX System - http://sdf.lonestar.org > _______________________________________________ > SciPy-Dev mailing list > SciPy-Dev at scipy.org > http://mail.scipy.org/mailman/listinfo/scipy-dev > From thouis at gmail.com Fri Apr 29 09:45:19 2011 From: thouis at gmail.com (Thouis (Ray) Jones) Date: Fri, 29 Apr 2011 15:45:19 +0200 Subject: [SciPy-Dev] Possible funding opportunity for numpy and scipy development Message-ID: (Posted for a friend) This NSF opportunity just renewed last week and might interest the NumPy/SciPy community: NSF Software Infrastructure for Sustained Innovation (SI2) http://www.nsf.gov/funding/pgm_summ.jsp?pims_id=503489 It sounds like it's not suited for end-user software in a particular domain but is intended to be more software infrastructure oriented. From josef.pktd at gmail.com Sat Apr 30 10:15:45 2011 From: josef.pktd at gmail.com (josef.pktd at gmail.com) Date: Sat, 30 Apr 2011 10:15:45 -0400 Subject: [SciPy-Dev] replace print by custom Warnings In-Reply-To: References: Message-ID: On Thu, Apr 28, 2011 at 2:52 PM, wrote: > On Wed, Apr 27, 2011 at 2:05 PM, Robert Kern wrote: >> On Wed, Apr 27, 2011 at 09:56, ? wrote: >>> should scipy get additional custom warnings instead of print statements ? >>> >>> eg. InterpolationWarning, OptimizationWarning, .... >> >> Is that a volunteer I smell? ?:-) > > I'm currently not smelly enough :), but I created > http://projects.scipy.org/scipy/ticket/1428 > > ( > However, after trying for a few hours yesterday, I managed to > authenticate with github so I can push something there. > git(gui) is kind of fun, at least for bugfixes. > ) > > Josef > >> >> Yes, these print statements should become warnings wherever possible. A first attempt, just to get started https://github.com/josef-pkt/scipy/commit/548a8925c36c2627f0acb8102a835393deeefe26 in optimization, do we drop the disp option for warnings and the associated prints ? there still remains the final print for success. Is there a way to set the default warning level for the UserWarning to "always" ? Still needs tests, examples that raise the warnings. (I'm only partially familiar with the internal details of scipy.optimize, interpolate, ... ) Josef >> >> -- >> Robert Kern >> >> "I have come to believe that the whole world is an enigma, a harmless >> enigma that is made terrible by our own mad attempt to interpret it as >> though it had an underlying truth." >> ? -- Umberto Eco >> _______________________________________________ >> SciPy-Dev mailing list >> SciPy-Dev at scipy.org >> http://mail.scipy.org/mailman/listinfo/scipy-dev >> > From ralf.gommers at googlemail.com Sat Apr 30 12:13:25 2011 From: ralf.gommers at googlemail.com (Ralf Gommers) Date: Sat, 30 Apr 2011 18:13:25 +0200 Subject: [SciPy-Dev] Discrete-time additions to scipy.signal In-Reply-To: References: Message-ID: On Fri, Apr 29, 2011 at 2:39 PM, Jeffrey Armstrong wrote: > On Thu, 28 Apr 2011, Ralf Gommers wrote: > >> Are you trying to do this? If you need any help let me know (offline perhaps). > > I think I've successfully split the changes into two branches: > > discrete time additions: > https://github.com/ArmstrongJ/scipy/tree/discrete-time-signal > > Lyapunov and algebraic Riccati solvers: > https://github.com/ArmstrongJ/scipy/tree/riccati-lyapunov > > There could possibly be some minor mess with re-committing __init__.py in > scipy.signal, but the final product is ok. ?Git has taken a bit of time > to understand. That was a good start. I've taken your discrete-time-signal branch, and did some more reorganizing to only have a few commits with no renames and deletions: https://github.com/rgommers/scipy/tree/armstrong-discrete. I then did some cleanups of cont2discrete in the last commit, to make the code cleaner. Some comments on your code: - function signatures with *args and **kwargs are usually a bad idea, it is better to have separate functions or some other way to make clear what the expected inputs are. (this is why I split up your cont2discrete function). - like Josef said, it should conform to PEP8. - I also agree with him that it's better to not mix arrays and matrices, and preferably avoid matrices completely. - the standard numpy/scipy conventions for imports, docstrings etc. should be followed, like "import numpy as np". See also https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt - the permissions of your test files was wrong, they were executable. Nose will ignore such files, so your tests were never executed. - the caps in the test files are a little jarring to read. They can be lowercase, and moved into the test class. Only the continuous constants are reused, the discrete ones can be in the actual test functions where they are used. In the cont2discrete file, it would also be helpful if you added some comments (or references) to the least transparent parts. For example, I can't tell what the like with all the multiple vstack/hstack's is doing. I propose you pull my branch of your work and make changes to that. Later the commits can be rewritten again to keep it easy to review. Cheers, Ralf