Re: [Numpy-discussion] David, please check.

2008-05-25 Thread Charles R Harris
On Sun, May 25, 2008 at 7:44 PM, David Cournapeau <[EMAIL PROTECTED]> wrote: > On Sun, May 25, 2008 at 9:04 AM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > > > > > I've since renamed generate_array_api to generate_numpy_api which led to > > some mods in scons_support.py, so you might want to

Re: [Numpy-discussion] build outside C code with scons within numpy distutils

2008-05-25 Thread Zachary Pincus
Thanks for the tips! This is very helpful. >> Specifically, I have a package that uses numpy and numpy.distutils to >> built itself. Unfortunately, there are some pure-C libraries that I >> call using ctypes, and as these libraries are are not python >> extensions, it is hard to get distutils to

Re: [Numpy-discussion] David, please check.

2008-05-25 Thread David Cournapeau
On Sun, May 25, 2008 at 9:04 AM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > I've since renamed generate_array_api to generate_numpy_api which led to > some mods in scons_support.py, so you might want to check that also. > Looks OK to me, thanks, David _

Re: [Numpy-discussion] build outside C code with scons within numpy distutils

2008-05-25 Thread David Cournapeau
On Sun, 2008-05-25 at 11:25 -0400, Zachary Pincus wrote: > Specifically, I have a package that uses numpy and numpy.distutils to > built itself. Unfortunately, there are some pure-C libraries that I > call using ctypes, and as these libraries are are not python > extensions, it is hard to ge

Re: [Numpy-discussion] Multiple Boolean Operations

2008-05-25 Thread Andrea Gavana
Hi Stefan & All, On Sun, May 25, 2008 at 8:59 PM, Stéfan van der Walt wrote: > Hi Andrea > > 2008/5/25 Andrea Gavana <[EMAIL PROTECTED]>: >>> When you bench the Cython code, you'll have to take out the Python >>> calls (for checking dtype etc.), otherwise you're comparing apples and >>> oranges.

Re: [Numpy-discussion] numpy.test error: test_hdquantiles

2008-05-25 Thread Charles R Harris
On Sun, May 25, 2008 at 3:35 PM, Joshua Lippai <[EMAIL PROTECTED]> wrote: > I seem to be getting a few errors and failures with the current numpy > SVN (1.2.0.dev5236). I get this output with numpy.test(1,10): > > ERROR: Ticket #396 > ---

[Numpy-discussion] numpy.test error: test_hdquantiles

2008-05-25 Thread Joshua Lippai
I seem to be getting a few errors and failures with the current numpy SVN (1.2.0.dev5236). I get this output with numpy.test(1,10): ERROR: Ticket #396 -- Traceback (most recent call last): File "/Library/Frameworks/Python.frame

Re: [Numpy-discussion] Current ufunc signatures for review

2008-05-25 Thread Charles R Harris
On Sun, May 25, 2008 at 2:29 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Sun, May 25, 2008 at 1:12 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > Here is the current behavior of the ufuncs and some comments. They don't > yet > > cover mixed types for binary functions, >

Re: [Numpy-discussion] Current ufunc signatures for review

2008-05-25 Thread Charles R Harris
On Sun, May 25, 2008 at 2:29 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Sun, May 25, 2008 at 1:12 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > Hi All, > > > > Here is the current behavior of the ufuncs and some comments. They don't > yet > > cover mixed types for binary functions, >

Re: [Numpy-discussion] Current ufunc signatures for review

2008-05-25 Thread Robert Kern
On Sun, May 25, 2008 at 1:12 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > Hi All, > > Here is the current behavior of the ufuncs and some comments. They don't yet > cover mixed types for binary functions, > but when they do we will see things like: > > In [7]: power(True,10) > Out[7]: > array(

Re: [Numpy-discussion] isnan surprise

2008-05-25 Thread Robert Kern
On Sun, May 25, 2008 at 1:17 PM, Keith Goodman <[EMAIL PROTECTED]> wrote: > On Sun, May 25, 2008 at 11:13 AM, Keith Goodman <[EMAIL PROTECTED]> wrote: x = np.array([1.0]) np.isnan(x) >> array([False], dtype=bool) # <- Expected np.isnan(x,x) >> array([ 0.]) # <- Surprise

Re: [Numpy-discussion] ufunc oddities

2008-05-25 Thread Stéfan van der Walt
2008/5/25 Anne Archibald <[EMAIL PROTECTED]>: > 2008/5/25 Charles R Harris <[EMAIL PROTECTED]>: > >> So, please tell me how numpy is supposed to work. Write as much as you >> please. If you are so moved, why not write the tests for all 64 ufuncs for >> all types and combinations and verify that the

Re: [Numpy-discussion] Current ufunc signatures for review

2008-05-25 Thread Charles R Harris
On Sun, May 25, 2008 at 12:55 PM, Charles R Harris < [EMAIL PROTECTED]> wrote: > > > On Sun, May 25, 2008 at 12:42 PM, Pauli Virtanen <[EMAIL PROTECTED]> wrote: > >> su, 2008-05-25 kello 12:12 -0600, Charles R Harris kirjoitti: >> [clip] >> > 1) Help strings on ufuncs don't work. This seems to be

Re: [Numpy-discussion] Multiple Boolean Operations

2008-05-25 Thread Stéfan van der Walt
Hi Andrea 2008/5/25 Andrea Gavana <[EMAIL PROTECTED]>: >> When you bench the Cython code, you'll have to take out the Python >> calls (for checking dtype etc.), otherwise you're comparing apples and >> oranges. After I tweaked it, it ran roughly the same time as >> Francesc's version. But like I

Re: [Numpy-discussion] Current ufunc signatures for review

2008-05-25 Thread Charles R Harris
On Sun, May 25, 2008 at 12:42 PM, Pauli Virtanen <[EMAIL PROTECTED]> wrote: > su, 2008-05-25 kello 12:12 -0600, Charles R Harris kirjoitti: > [clip] > > 1) Help strings on ufuncs don't work. This seems to be a problem with the > help function, as > >printing the relevant __doc__ works fine. Th

Re: [Numpy-discussion] Current ufunc signatures for review

2008-05-25 Thread Charles R Harris
On Sun, May 25, 2008 at 12:12 PM, Charles R Harris < [EMAIL PROTECTED]> wrote: > Hi All, > > Here is the current behavior of the ufuncs and some comments. They don't > yet cover mixed types for binary functions, > but when they do we will see things like: > > In [7]: power(True,10) > Out[7]: > arr

Re: [Numpy-discussion] Current ufunc signatures for review

2008-05-25 Thread Pauli Virtanen
su, 2008-05-25 kello 12:12 -0600, Charles R Harris kirjoitti: [clip] > 1) Help strings on ufuncs don't work. This seems to be a problem with the > help function, as >printing the relevant __doc__ works fine. The docstrings are currently > defined in >code_generators/generate_umath.py and

Re: [Numpy-discussion] ufunc oddities

2008-05-25 Thread Charles R Harris
On Sun, May 25, 2008 at 11:30 AM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/5/25 Charles R Harris <[EMAIL PROTECTED]>: > > > So, please tell me how numpy is supposed to work. Write as much as you > > please. If you are so moved, why not write the tests for all 64 ufuncs > for > > all types

Re: [Numpy-discussion] should abs gives negative at end of integer range?

2008-05-25 Thread Charles R Harris
On Sun, May 25, 2008 at 11:38 AM, Jonathan Wright <[EMAIL PROTECTED]> wrote: > This one comes up in a Java puzzler, but applies equally to numpy. > > http://www.youtube.com/watch?v=wDN_EYUvUq0 > > >>> import numpy, sys > >>> abs(numpy.array([-sys.maxint-1],numpy.int)) > 0 > array([False], dtype=

Re: [Numpy-discussion] isnan surprise

2008-05-25 Thread Keith Goodman
On Sun, May 25, 2008 at 11:13 AM, Keith Goodman <[EMAIL PROTECTED]> wrote: >>> x = np.array([1.0]) >>> np.isnan(x) > array([False], dtype=bool) # <- Expected >>> np.isnan(x,x) > array([ 0.]) # <- Surprise (to me) I guess this is not surprising since I'm asking isnan to put the answer

[Numpy-discussion] isnan surprise

2008-05-25 Thread Keith Goodman
>> x = np.array([1.0]) >> np.isnan(x) array([False], dtype=bool) # <- Expected >> np.isnan(x,x) array([ 0.]) # <- Surprise (to me) The same happens with isfinite, isinf, etc. My use case (self.x is an array): def isnan(self): y = self.copy() np.isnan(y.x, y.x)

[Numpy-discussion] Current ufunc signatures for review

2008-05-25 Thread Charles R Harris
Hi All, Here is the current behavior of the ufuncs and some comments. They don't yet cover mixed types for binary functions, but when they do we will see things like: In [7]: power(True,10) Out[7]: array([ 0.5822807 , 0.66568381, 0.11748811, 0.97047323, 0.60095205, 0.81218886, 0.0167

[Numpy-discussion] should abs gives negative at end of integer range?

2008-05-25 Thread Jonathan Wright
This one comes up in a Java puzzler, but applies equally to numpy. http://www.youtube.com/watch?v=wDN_EYUvUq0 >>> import numpy, sys >>> abs(numpy.array([-sys.maxint-1],numpy.int)) > 0 array([False], dtype=bool) >>> abs(numpy.array([-129,-128,-127],numpy.int8)) > 0 array([ True, False, True],

Re: [Numpy-discussion] ufunc oddities

2008-05-25 Thread Anne Archibald
2008/5/25 Charles R Harris <[EMAIL PROTECTED]>: > So, please tell me how numpy is supposed to work. Write as much as you > please. If you are so moved, why not write the tests for all 64 ufuncs for > all types and combinations and verify that they are all correct as specified > and raise errors wh

[Numpy-discussion] build outside C code with scons within numpy distutils

2008-05-25 Thread Zachary Pincus
Hello all, I've been following David's work making numpy build with scons with some interest. I have a quick question about how one might use scons/ numpy distutils from an outside project. Specifically, I have a package that uses numpy and numpy.distutils to built itself. Unfortunately, the

Re: [Numpy-discussion] Controlling the way a module is imported

2008-05-25 Thread David Cournapeau
Robert Kern wrote: > > Can you be more specific? Sure: in my branch to refactor fftpack, every non default backend (that is everything but fftpack) is a separate python module, which implements some fft functions, and is 'importable'. So in scipy.fftpack, I have a function which: - tries t

Re: [Numpy-discussion] Controlling the way a module is imported

2008-05-25 Thread Robert Kern
On Sun, May 25, 2008 at 4:28 AM, David Cournapeau <[EMAIL PROTECTED]> wrote: > Hi, > >This is not numpy specific, but I need it for numpy/scipy. More > specifically, I would like to be able to have one module interface which > load imp1, imp2, imp3, etc... depending on some options. Can you be

[Numpy-discussion] Controlling the way a module is imported

2008-05-25 Thread David Cournapeau
Hi, This is not numpy specific, but I need it for numpy/scipy. More specifically, I would like to be able to have one module interface which load imp1, imp2, imp3, etc... depending on some options. I see two obvious solutions: monkey patching, and file configuration, but I try to avoid

Re: [Numpy-discussion] Multiple Boolean Operations

2008-05-25 Thread Andrea Gavana
Hi Stefan & All, On Sat, May 24, 2008 at 8:11 PM, Stéfan van der Walt wrote: > Hi Andrea > > 2008/5/24 Andrea Gavana <[EMAIL PROTECTED]>: >> Number Of Cells: 5 >> - >> | Rank | Method Name | Exe

Re: [Numpy-discussion] Not all typecodes have names

2008-05-25 Thread Robert Kern
On Sun, May 25, 2008 at 12:56 AM, Charles R Harris <[EMAIL PROTECTED]> wrote: > ? bool > b signed char > h short > i integer > l long integer > q long long integer > p p > B unsigned char > H unsigned short > I unsigned integer > L unsigned long integer > Q unsigned long long integer > P P ---

Re: [Numpy-discussion] ufunc oddities

2008-05-25 Thread Robert Kern
On Sat, May 24, 2008 at 11:14 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > It used to be stay in type and has been changed, and I don't disagree with > that, it was discussed on the list. Nevertheless, booleans are different, > both their own kind and integers. But my problem is not convenien