Re: [Numpy-discussion] Distutils: using different linker options for c++ and c code

2008-04-18 Thread Robert Kern
On Fri, Apr 18, 2008 at 12:57 AM, Matthieu Brucher [EMAIL PROTECTED] wrote: I can help with packaging at least numpy with Visual Studio 2003 (well, I have to check the EULA if I'm allowed to do that !). For scipy, it is a matter of Fortran compiler :| That probably won't work. I believe that

Re: [Numpy-discussion] Distutils: using different linker options for c++ and c code

2008-04-18 Thread Matthieu Brucher
2008/4/18, Robert Kern [EMAIL PROTECTED]: On Fri, Apr 18, 2008 at 12:57 AM, Matthieu Brucher [EMAIL PROTECTED] wrote: I can help with packaging at least numpy with Visual Studio 2003 (well, I have to check the EULA if I'm allowed to do that !). For scipy, it is a matter of Fortran

Re: [Numpy-discussion] Distutils: using different linker options for c++ and c code

2008-04-18 Thread David Cournapeau
Matthieu Brucher wrote: 2008/4/18, Robert Kern [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: On Fri, Apr 18, 2008 at 12:57 AM, Matthieu Brucher [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I can help with packaging at least numpy with Visual Studio 2003 (well, I

Re: [Numpy-discussion] Distutils: using different linker options for c++ and c code

2008-04-18 Thread David Cournapeau
Robert Kern wrote: Quite possibly. Can you run the segfaulting code in a debugger so we can try to isolate the actual cause? It is possible that we can patch it up to work with msvcr71. I finally managed to do something, for reference: - I hacked distutils to put -g everywhere (using the

Re: [Numpy-discussion] Distutils: using different linker options for c++ and c code

2008-04-18 Thread Robert Kern
On Fri, Apr 18, 2008 at 1:43 AM, David Cournapeau [EMAIL PROTECTED] wrote: David Cournapeau wrote: So it *may* be unrelated to msvc runtime; maybe it just caused a problem which has always been there. I will try to see if valgrind says anything useful for sparsetools under linux. Ok,

[Numpy-discussion] fast take patch

2008-04-18 Thread Eric Firing
Stefan, (or anyone else who might be interested) Since you committed my fast putmask patch many months ago, I thought you might like to deal with my fast take patch. Attached is the diff relative to 5043, ignoring whitespace. (Yes, those pesky whitespace anomalies are still cropping up.)

Re: [Numpy-discussion] Truth value of an array

2008-04-18 Thread David Douard
On Fri, Apr 18, 2008 at 01:11:37PM +0200, Olivier Verdier wrote: In mathematics, if I compare two function, it means that I compare on all its coordinates. If I say f g I mean f(x) g(x) for all x. The same holds for a vector, if I write v == w I mean v[i] == w[i] for all i. How come

Re: [Numpy-discussion] Truth value of an array

2008-04-18 Thread Olivier Verdier
I certainly didn't mean that A==B should return a boolean!! A==B should return an array of boolean as it does now. This is all right. *However* bool(A==B) should return a boolean, *not* raise an exception. Why raise an exception? What is ambiguous about bool(A==B)?? This is what happens when

Re: [Numpy-discussion] Truth value of an array

2008-04-18 Thread Matthieu Brucher
2008/4/18, Olivier Verdier [EMAIL PROTECTED]: I certainly didn't mean that A==B should return a boolean!! A==B should return an array of boolean as it does now. This is all right. *However* bool(A==B) should return a boolean, *not* raise an exception. Why raise an exception? What is

Re: [Numpy-discussion] Truth value of an array

2008-04-18 Thread Alan G Isaac
On Fri, 18 Apr 2008, Olivier Verdier apparently wrote: What is ambiguous about bool(A==B)? A==B is an array. Compare: bool([]) False bool([0]) True Even if you decide the second should be false, what about [0,1]? (I.e., all or any?) Cheers, Alan Isaac

Re: [Numpy-discussion] Truth value of an array

2008-04-18 Thread Olivier
Let's restrict the discussion the case to boolean arrays (dtype bool), since all the comparisons (A==B, A!=B, AB etc. return boolean arrays). So I have an array filled with booleans. Is there a reason not to map bool(A) to A.all() but instead raise an exception? As far as I can see, if A==B is

Re: [Numpy-discussion] Truth value of an array

2008-04-18 Thread Matthew Brett
Hi, I must say, I agree with the other posters here, that it is not completely obvious to me that: a = np.array([True, False]) bool(a) should return False. Especially given: L = [True, False] bool(L) returns True. Given that it's not completely obvious, and a.all() is completely

Re: [Numpy-discussion] Truth value of an array

2008-04-18 Thread Joe Harrington
For that matter, is there a reason logical operations don't work on arrays other than booleans? What about: import numpy x = numpy.ones((10), dtype='Bool') y = numpy.ones((10), dtype='Bool') y[6] = False z = x and y # logical AND: this one fails with an error about arrays

Re: [Numpy-discussion] Truth value of an array

2008-04-18 Thread Alan G Isaac
On Fri, 18 Apr 2008, Joe Harrington apparently wrote: For that matter, is there a reason logical operations don't work on arrays other than booleans? What about: import numpy x = numpy.ones((10), dtype='Bool') y = numpy.ones((10), dtype='Bool') y[6] = False z = x and y # logical AND:

Re: [Numpy-discussion] Truth value of an array

2008-04-18 Thread Anne Archibald
On 18/04/2008, Robert Kern [EMAIL PROTECTED] wrote: On Fri, Apr 18, 2008 at 3:33 PM, Joe Harrington [EMAIL PROTECTED] wrote: For that matter, is there a reason logical operations don't work on arrays other than booleans? What about: The keywords and, or, and not only work on bool

[Numpy-discussion] [OT - IPython] Old 'broken terminal' bug finally fixed

2008-04-18 Thread Fernando Perez
[ Sorry for the cross-post, but I know this is something that has hit quite a few people on this list. If you have any questions on it, please ask on the ipython list, this is just an FYI ] Hi all, there's a very old, *extremely* annoying bug that multiple people have asked about (on list and

[Numpy-discussion] powerpc yellow dog linux port of numpy

2008-04-18 Thread Vincent Broman
I reported back on August 30 to this list, with some discussion following on September 4 and 5, about my attempt to build numpy on an ancient powerpc setup. I'm running yellow dog linux 2.1, gcc 2.95.3.20010111, on processors from Curtiss-Wright Controls. Don't tell me to just upgrade; this

Re: [Numpy-discussion] powerpc yellow dog linux port of numpy

2008-04-18 Thread Robert Kern
On Fri, Apr 18, 2008 at 8:19 PM, Vincent Broman [EMAIL PROTECTED] wrote: I reported back on August 30 to this list, with some discussion following on September 4 and 5, about my attempt to build numpy on an ancient powerpc setup. I'm running yellow dog linux 2.1, gcc 2.95.3.20010111, on

[Numpy-discussion] numpy1.2 : make sorts unary ufuncs

2008-04-18 Thread Charles R Harris
The signature for a ufunc is something like @[EMAIL PROTECTED]@kind@(char **args, intp *dimensions, intp *steps, void *func) Which contains all the info necessary to do a sort. Means and other such functions could also be implemented that way. Chuck

Re: [Numpy-discussion] numpy1.2 : make sorts unary ufuncs

2008-04-18 Thread Charles R Harris
On Fri, Apr 18, 2008 at 10:53 PM, Robert Kern [EMAIL PROTECTED] wrote: On Fri, Apr 18, 2008 at 11:47 PM, Charles R Harris [EMAIL PROTECTED] wrote: The signature for a ufunc is something like @[EMAIL PROTECTED]@kind@(char **args, intp *dimensions, intp *steps, void *func) Which

Re: [Numpy-discussion] numpy1.2 : make sorts unary ufuncs

2008-04-18 Thread Robert Kern
On Fri, Apr 18, 2008 at 11:58 PM, Charles R Harris [EMAIL PROTECTED] wrote: On Fri, Apr 18, 2008 at 10:53 PM, Robert Kern [EMAIL PROTECTED] wrote: On Fri, Apr 18, 2008 at 11:47 PM, Charles R Harris [EMAIL PROTECTED] wrote: The signature for a ufunc is something like @[EMAIL

Re: [Numpy-discussion] numpy1.2 : make sorts unary ufuncs

2008-04-18 Thread Charles R Harris
On Fri, Apr 18, 2008 at 11:02 PM, Robert Kern [EMAIL PROTECTED] wrote: On Fri, Apr 18, 2008 at 11:58 PM, Charles R Harris [EMAIL PROTECTED] wrote: On Fri, Apr 18, 2008 at 10:53 PM, Robert Kern [EMAIL PROTECTED] wrote: On Fri, Apr 18, 2008 at 11:47 PM, Charles R Harris [EMAIL