Re: [Numpy-discussion] [Numpy-svn] r5198 - trunk/numpy/f2py

2008-05-19 Thread Pearu Peterson
CC: numpy-discussion because of other reactions on the subject. On Tue, May 20, 2008 1:26 am, Robert Kern wrote: > Is this an important bugfix? If not, can you hold off until 1.1.0 is > released? The patch fixes a long existing and unreported bug in f2py - I think the bug was introduced when Pyth

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread James Snyder
I've done a little profiling with cProfile as well as with dtrace since the bindings exist in mac os x, and you can use a lot of the d scripts that apply to python, so previously I've found that the np.random call and the where (in the original code) were heavy hitters as far as amount of time cons

Re: [Numpy-discussion] Is it ok to create a tool directory in numpy svn (for building tools, etc...)

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 8:54 PM, David Cournapeau <[EMAIL PROTECTED]> wrote: > Hi, > >To build numpy binaries, I have some pretty boring python scripts, > and I think it would be useful to have them somewhere in numpy trunk > (for example in tools). Does anyone have something against it ? Nope

Re: [Numpy-discussion] Is it ok to create a tool directory in numpy svn (for building tools, etc...)

2008-05-19 Thread David Cournapeau
Charles R Harris wrote: > > > On Mon, May 19, 2008 at 7:54 PM, David Cournapeau > <[EMAIL PROTECTED] > > wrote: > > Hi, > >To build numpy binaries, I have some pretty boring python scripts, > and I think it would be useful to have them somewhere in numpy

Re: [Numpy-discussion] Is it ok to create a tool directory in numpy svn (for building tools, etc...)

2008-05-19 Thread Charles R Harris
On Mon, May 19, 2008 at 7:54 PM, David Cournapeau < [EMAIL PROTECTED]> wrote: > Hi, > >To build numpy binaries, I have some pretty boring python scripts, > and I think it would be useful to have them somewhere in numpy trunk > (for example in tools). Does anyone have something against it ? >

[Numpy-discussion] 1.1.0rc1, Win32 Installer: please test it

2008-05-19 Thread David Cournapeau
Hi, Sorry for the delay, but it is now ready: numpy "superpack" installers for numpy 1.1.0rc1: http://www.ar.media.kyoto-u.ac.jp/members/david/archives/numpy-1.1.0rc1-win32-superpack-python2.5.exe http://www.ar.media.kyoto-u.ac.jp/members/david/archives/numpy-1.1.0rc1-win32-superpack-python2

[Numpy-discussion] Is it ok to create a tool directory in numpy svn (for building tools, etc...)

2008-05-19 Thread David Cournapeau
Hi, To build numpy binaries, I have some pretty boring python scripts, and I think it would be useful to have them somewhere in numpy trunk (for example in tools). Does anyone have something against it ? cheers, David ___ Numpy-discussion mailing

Re: [Numpy-discussion] svd in numpy

2008-05-19 Thread David Cournapeau
Bruce Southey wrote: > Nripun Sredar wrote: > >> I am running on Windows Xp, Intel Xeon CPU. I'd like to fill in a few >> more things here. If I send 0 in the second and third argument of svd >> then I get the singular_values, but if its 1 then the problem >> persists. I've tried this on spar

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Eric Firing
Robert Kern wrote: > On Mon, May 19, 2008 at 6:55 PM, James Snyder <[EMAIL PROTECTED]> wrote: >> Also note, I'm not asking to match MATLAB performance. It'd be nice, >> but again I'm just trying to put together decent, fairly efficient >> numpy code. > > I can cut the time by about a quarter by j

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 7:30 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > On Mon, May 19, 2008 at 5:52 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> >> On Mon, May 19, 2008 at 6:39 PM, Charles R Harris >> <[EMAIL PROTECTED]> wrote: >> > >> > On Mon, May 19, 2008 at 4:36 PM, Robert Kern <[EMA

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 6:55 PM, James Snyder <[EMAIL PROTECTED]> wrote: > Also note, I'm not asking to match MATLAB performance. It'd be nice, > but again I'm just trying to put together decent, fairly efficient > numpy code. I can cut the time by about a quarter by just using the boolean mask d

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Charles R Harris
On Mon, May 19, 2008 at 5:52 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Mon, May 19, 2008 at 6:39 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > > > On Mon, May 19, 2008 at 4:36 PM, Robert Kern <[EMAIL PROTECTED]> > wrote: > >> > >> On Mon, May 19, 2008 at 5:27 PM, Charles R Harris > >

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread James Snyder
On to the code, here's a current implementation, attached. I make no claims about it being great code, I've modified it so that there is a weave version and a sans-weave version. Many of the suggestions make things a bit faster. The weave version bombs out with a rather long log, which can be fo

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 6:39 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > On Mon, May 19, 2008 at 4:36 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> >> On Mon, May 19, 2008 at 5:27 PM, Charles R Harris >> <[EMAIL PROTECTED]> wrote: >> > The latest versions of Matlab use the ziggurat method t

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Charles R Harris
On Mon, May 19, 2008 at 4:36 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Mon, May 19, 2008 at 5:27 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > The latest versions of Matlab use the ziggurat method to generate random > > normals and it is faster than the method used in numpy. I have z

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread James Snyder
Separating the response into 2 emails, here's the aspect that comes from implementations of random: In short, that's part of the difference. I ran these a few times to check for consistency. MATLAB (R2008a: tic for i = 1:2000 a = randn(1,13857); end toc Runtime: ~0.733489 s NumPy (1.1.0rc1)

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 5:27 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > The latest versions of Matlab use the ziggurat method to generate random > normals and it is faster than the method used in numpy. I have ziggurat code > at hand, but IIRC, Robert doesn't trust the method ;) Well, I out

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Charles R Harris
On Mon, May 19, 2008 at 2:53 PM, Christopher Barker <[EMAIL PROTECTED]> wrote: > Anne Archibald wrote: > > 2008/5/19 James Snyder <[EMAIL PROTECTED]>: > >> I can provide the rest of the code if needed, but it's basically just > >> filling some vectors with random and empty data and initializing a

Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test

2008-05-19 Thread Christopher Burns
Thanks Tommy! Robert has already committed a fix. On Mon, May 19, 2008 at 1:42 PM, Tommy Grav <[EMAIL PROTECTED]> wrote: > > On May 19, 2008, at 4:38 PM, Robert Kern wrote: > >> On Mon, May 19, 2008 at 3:35 PM, Robert Kern <[EMAIL PROTECTED]> >> wrote: >>> Endianness issues. Probably bugs in the

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Christopher Barker
Anne Archibald wrote: > 2008/5/19 James Snyder <[EMAIL PROTECTED]>: >> I can provide the rest of the code if needed, but it's basically just >> filling some vectors with random and empty data and initializing a few >> things. > > It would kind of help, since it would make it clearer what's a scala

Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test

2008-05-19 Thread Tommy Grav
On May 19, 2008, at 4:38 PM, Robert Kern wrote: > On Mon, May 19, 2008 at 3:35 PM, Robert Kern <[EMAIL PROTECTED]> > wrote: >> Endianness issues. Probably bugs in the code. > > By which I meant "test code". numpy itself is fine and is working > correctly. The tests themselves incorrectly assume

Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 3:38 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Mon, May 19, 2008 at 3:35 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> Endianness issues. Probably bugs in the code. > > By which I meant "test code". numpy itself is fine and is working > correctly. The tests themselves

Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 3:35 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > Endianness issues. Probably bugs in the code. By which I meant "test code". numpy itself is fine and is working correctly. The tests themselves incorrectly assume little-endianness. -- Robert Kern "I have come to believe

Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 3:20 PM, Tommy Grav <[EMAIL PROTECTED]> wrote: > == > FAIL: test_basic (numpy.core.tests.test_multiarray.TestView) > -- > Traceback (most r

Re: [Numpy-discussion] 1.1.0rc1 OSX Installer - please test

2008-05-19 Thread Tommy Grav
On May 19, 2008, at 3:39 PM, Christopher Burns wrote: > I've built a Mac binary for the 1.1 release candidate. Mac users, > please test it from: > > https://cirl.berkeley.edu/numpy/numpy-1.1.0rc1-py2.5-macosx10.5.dmg > > This is for the MacPython installed from python.org. > > Thanks, > Chris I

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Hoyt Koepke
On Mon, May 19, 2008 at 12:53 PM, Robin <[EMAIL PROTECTED]> wrote: > Hi, > > I think my understanding is somehow incomplete... It's not clear to me > why (simplified case) > > a[curidx,:] = scalar * a[2-curidx,:] > should be faster than > a = scalar * b > > In both cases I thought the scalar multip

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Eric Firing
Robin wrote: > Also you could use xrange instead of range... > > Again, not sure of the size of the effect but it seems to be > recommended by the docstring. No, it is going away in Python 3.0, and its only real benefit is a memory saving in extreme cases. From the Python library docs: "The ad

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Anne Archibald
2008/5/19 James Snyder <[EMAIL PROTECTED]>: > First off, I know that optimization is evil, and I should make sure > that everything works as expected prior to bothering with squeezing > out extra performance, but the situation is that this particular block > of code works, but it is about half as

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Robin
Hi, I think my understanding is somehow incomplete... It's not clear to me why (simplified case) a[curidx,:] = scalar * a[2-curidx,:] should be faster than a = scalar * b In both cases I thought the scalar multiplication results in a new array (new memory allocated) and then the difference betwe

[Numpy-discussion] 1.1.0rc1 OSX Installer - please test

2008-05-19 Thread Christopher Burns
I've built a Mac binary for the 1.1 release candidate. Mac users, please test it from: https://cirl.berkeley.edu/numpy/numpy-1.1.0rc1-py2.5-macosx10.5.dmg This is for the MacPython installed from python.org. Thanks, Chris On Sat, May 17, 2008 at 9:01 PM, Jarrod Millman <[EMAIL PROTECTED]> wrot

Re: [Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Anne Archibald
2008/5/19 Orest Kozyar <[EMAIL PROTECTED]>: >> If you don't mind fancy indexing, you can convert your index arrays >> into boolean form: >> complement = A==A >> complement[idx] = False > > This actually would work perfectly for my purposes. I don't really > need super-fancy indexing. Heh. Actuall

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Hoyt Koepke
>for n in range(0,time_milliseconds): >self.u = self.expfac_m * self.prev_u + > (1-self.expfac_m) * self.aff_input[n,:] >self.v = self.u + self.sigma * > np.random.standard_normal(size=(1,self.naff)) >self.theta = self.expfac_theta * self.prev_theta -

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Robin
Also you could use xrange instead of range... Again, not sure of the size of the effect but it seems to be recommended by the docstring. Robin ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-

Re: [Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread Robin
On Mon, May 19, 2008 at 7:08 PM, James Snyder <[EMAIL PROTECTED]> wrote: > >for n in range(0,time_milliseconds): >self.u = self.expfac_m * self.prev_u + > (1-self.expfac_m) * self.aff_input[n,:] >self.v = self.u + self.sigma * > np.random.standard_normal(size=(1,

Re: [Numpy-discussion] 1.1.0rc1 tagged

2008-05-19 Thread David Huard
Ticket 793 has a patch, submitted by Alan McIntyre, waiting for review from someone C-API-wise. Cheers, David 2008/5/19 Neal Becker <[EMAIL PROTECTED]>: > Jarrod Millman wrote: > > > Please test the release candidate: > > svn co http://svn.scipy.org/svn/numpy/tags/1.1.0rc1 1.1.0rc1 > > > > Al

Re: [Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Orest Kozyar
> If you don't mind fancy indexing, you can convert your index arrays > into boolean form: > complement = A==A > complement[idx] = False This actually would work perfectly for my purposes. I don't really need super-fancy indexing. >> Given a slice, such as s_[..., :-2:], is it possible to take t

[Numpy-discussion] Quick Question about Optimization

2008-05-19 Thread James Snyder
Hi - First off, I know that optimization is evil, and I should make sure that everything works as expected prior to bothering with squeezing out extra performance, but the situation is that this particular block of code works, but it is about half as fast with numpy as in matlab, and I'm wondering

Re: [Numpy-discussion] 1.1.0rc1 tagged

2008-05-19 Thread Neal Becker
Jarrod Millman wrote: > Please test the release candidate: > svn co http://svn.scipy.org/svn/numpy/tags/1.1.0rc1 1.1.0rc1 > > Also please review the release notes: > http://projects.scipy.org/scipy/numpy/milestone/1.1.0 > > I am going to ask Chris and David to create Windows and Mac binaries, >

Re: [Numpy-discussion] Cookbook/Documentation

2008-05-19 Thread Stéfan van der Walt
Hi Pierre 2008/5/19 Pierre GM <[EMAIL PROTECTED]>: > * I've just noticed that the page describing RecordArrays > (http://www.scipy.org/RecordArrays) is not listed under the Cookbook: should > this be changed ? Shouldn't there be at least a link in the documentation > page ? How about we add those

Re: [Numpy-discussion] Noncentral chi square

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 11:33 AM, Peck, Jon <[EMAIL PROTECTED]> wrote: > Message: 1 > Date: Mon, 19 May 2008 09:20:21 -0400 > From: Neal Becker <[EMAIL PROTECTED]> > Subject: [Numpy-discussion] noncentral_chisquare buglet? > To: numpy-discussion@scipy.org > Message-ID: <[EMAIL PROTECTED]> > Content

Re: [Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Robert Kern
On Mon, May 19, 2008 at 9:34 AM, Orest Kozyar <[EMAIL PROTECTED]> wrote: > Given a slice, such as s_[..., :-2:], is it possible to take the > complement of this slice? Specifically, s_[..., ::-2]. Hmm, that doesn't look like the complement. Did you mean s_[..., -2:] and s_[..., :-2]? > I have a

[Numpy-discussion] Cookbook/Documentation

2008-05-19 Thread Pierre GM
All, * I've just noticed that the page describing RecordArrays (http://www.scipy.org/RecordArrays) is not listed under the Cookbook: should this be changed ? Shouldn't there be at least a link in the documentation page ? * Same problem with Subclasses (http://www.scipy.org/Subclasses) * I was ev

[Numpy-discussion] Noncentral chi square

2008-05-19 Thread Peck, Jon
Message: 1 Date: Mon, 19 May 2008 09:20:21 -0400 From: Neal Becker <[EMAIL PROTECTED]> Subject: [Numpy-discussion] noncentral_chisquare buglet? To: numpy-discussion@scipy.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=us-ascii def noncentral_chisquare(self, df, nonc, siz

Re: [Numpy-discussion] numpy with icc/MKL

2008-05-19 Thread Erik Nugent
I'm here... i am rolling back now and will post my results... e On Mon, May 19, 2008 at 9:22 AM, rex <[EMAIL PROTECTED]> wrote: >> Next step is to try icc instead of gcc, and if that works, try >> the latest MKL (10.0.3.020). > > OK, either I've got a corrupted copy of MKL 10.0.3.020, or it has >

Re: [Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Anne Archibald
2008/5/19 Orest Kozyar <[EMAIL PROTECTED]>: > Given a slice, such as s_[..., :-2:], is it possible to take the > complement of this slice? Specifically, s_[..., ::-2]. I have a > series of 2D arrays that I need to split into two subarrays via > slicing where the members of the second array are al

Re: [Numpy-discussion] svd in numpy

2008-05-19 Thread Nripun Sredar
Thank You.. The problem is resolved On Mon, May 19, 2008 at 10:31 AM, Bruce Southey <[EMAIL PROTECTED]> wrote: > Nripun Sredar wrote: > > I am running on Windows Xp, Intel Xeon CPU. I'd like to fill in a few > > more things here. If I send 0 in the second and third argument of svd > > then I get

Re: [Numpy-discussion] svd in numpy

2008-05-19 Thread Bruce Southey
Nripun Sredar wrote: > I am running on Windows Xp, Intel Xeon CPU. I'd like to fill in a few > more things here. If I send 0 in the second and third argument of svd > then I get the singular_values, but if its 1 then the problem > persists. I've tried this on sparse and non-sparse matrices. This

Re: [Numpy-discussion] numpy with icc/MKL

2008-05-19 Thread rex
> Next step is to try icc instead of gcc, and if that works, try > the latest MKL (10.0.3.020). OK, either I've got a corrupted copy of MKL 10.0.3.020, or it has a problem. Building with icc & MKL 10.0.1.014 works. Erik, are you reading this? If so, roll back to MKL 10.0.014 and it should work,

Re: [Numpy-discussion] svd in numpy

2008-05-19 Thread Nripun Sredar
I am running on Windows Xp, Intel Xeon CPU. I'd like to fill in a few more things here. If I send 0 in the second and third argument of svd then I get the singular_values, but if its 1 then the problem persists. I've tried this on sparse and non-sparse matrices. This is with the latest windows bina

Re: [Numpy-discussion] numpy with icc/MKL

2008-05-19 Thread rex
> Please follow exactly my instruction, otherwise, we cannot compare what > we are doing: use exactly the same site.cfg as me. OK, I used the same MKL version you did (10.0.1.014), the same site.cfg, and set .bashrc to do: source /opt/intel/mkl/10.0.1.014/tools/environment/mklvars32.sh and comp

[Numpy-discussion] Slicing a numpy array and getting the "complement"

2008-05-19 Thread Orest Kozyar
Given a slice, such as s_[..., :-2:], is it possible to take the complement of this slice? Specifically, s_[..., ::-2]. I have a series of 2D arrays that I need to split into two subarrays via slicing where the members of the second array are all the members leftover from the slice. The problem

Re: [Numpy-discussion] Generalised inner product

2008-05-19 Thread Peter Creasey
> > c[i,j,k,l,m] = sum (over x) of a[i,j,x] * b[k,x,l,m] > > > > Try tensordot. > > Chuck That was exactly what I needed. Thanks! Peter ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discus

[Numpy-discussion] noncentral_chisquare buglet?

2008-05-19 Thread Neal Becker
def noncentral_chisquare(self, df, nonc, size=None): """Noncentral Chi^2 distribution. noncentral_chisquare(df, nonc, size=None) -> random values """ cdef ndarray odf, ononc cdef double fdf, fnonc fdf = PyFloat_AsDouble(df) fnonc = PyFloa

Re: [Numpy-discussion] numpy with icc/MKL

2008-05-19 Thread David Cournapeau
rex wrote: > > I always remove the build directory (if I forget the much faster > compilation reminds me). Do you mean remove the installed numpy? > Yes. > Did that, built numpy again, and it fails numpy.test() exactly as before. > > I changed site.cfg to: > > [mkl] > library_dirs = /opt/intel

Re: [Numpy-discussion] Generalised inner product

2008-05-19 Thread Charles R Harris
On Mon, May 19, 2008 at 4:23 AM, Peter Creasey < [EMAIL PROTECTED]> wrote: > Hi, > > Does numpy have some sort of generalised inner product? For example I have > arrays > > a.shape = (5,6,7) > b.shape = (8,7,9,10) > > and I want to perform a product over the 3rd axis of a and the 2nd of b, > i.e.

Re: [Numpy-discussion] Which to test: 1.1.x or 1.1.0rc1?

2008-05-19 Thread James Snyder
I've been using git-svn, so I suppose I'm pulling the last rev that was in 1.1.x. Checked out the RC, looks like there are more unit tests, but they all still pass for me: In [2]: numpy.test() Numpy is installed in /Library/Python/2.5/site-packages/numpy Numpy version 1.1.0.dev5142 Python version

[Numpy-discussion] Generalised inner product

2008-05-19 Thread Peter Creasey
Hi, Does numpy have some sort of generalised inner product? For example I have arrays a.shape = (5,6,7) b.shape = (8,7,9,10) and I want to perform a product over the 3rd axis of a and the 2nd of b, i.e. c[i,j,k,l,m] = sum (over x) of a[i,j,x] * b[k,x,l,m] I guess I could do it with swapaxes an

Re: [Numpy-discussion] numpy with icc/MKL

2008-05-19 Thread rex
> No, they heavily changed how to link against mkl in 10. There is a whole > chapter about it in the releases notes. Yes, I read it, but it appears to me that the new layer libraries are an option, and that the legacy link format still works. From chapter 3: "Pure layered libraries give more fle