[Numpy-discussion] 1.1.0rc1 tagged

2008-05-17 Thread Jarrod Millman
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, which I hope they will have time to cre

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Bill Spotz
Just to make sure the original question gets answered, yes, numpy.i avoids copies as much as possible. A special case is when your C code provides you with a view of its internal data and does not require any memory to be allocated by the (python) user. This can be dangerous, but if it is y

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Brian Granger
On Sat, May 17, 2008 at 8:35 PM, Nathan Bell <[EMAIL PROTECTED]> wrote: > On Sat, May 17, 2008 at 9:30 PM, Brian Granger <[EMAIL PROTECTED]> wrote: >> >> Please correct any new errors I have introduced. >> > > Thanks Brian, I think that's a fair representation. > > Minor typo "course grained" -> "c

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Brian Granger
Jose, As you can see, people have different preferences for wrapping C/C++ code. I should also mention that one of the easiest methods if numpy arrays are involved is ctypes. numpy arrays already have more-or-less built-in support for talking to ctypes. Details are available here: http://www.s

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Nathan Bell
On Sat, May 17, 2008 at 9:30 PM, Brian Granger <[EMAIL PROTECTED]> wrote: > > Please correct any new errors I have introduced. > Thanks Brian, I think that's a fair representation. Minor typo "course grained" -> "coarse-grained" -- Nathan Bell [EMAIL PROTECTED] http://graphics.cs.uiuc.edu/~wnbe

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Brian Granger
>> Cython is a different approach from SWIG (see >> http://wiki.cython.org/WrappingCorCpp; in particular SWIG uses more layers >> of indirection). >> > > >From the link: > "[SWIG] Can wrap almost any C and C++ code, including templates etc. > Disadvantage is that it produces a C file, this compiles

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Robert Kern
On Sat, May 17, 2008 at 8:13 PM, Nathan Bell <[EMAIL PROTECTED]> wrote: > On Sat, May 17, 2008 at 7:48 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> For the purposes to which SWIG was applied in that case, the findings >> are accurate. > > IMO it's deliberately misleading. The following three laye

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Nathan Bell
On Sat, May 17, 2008 at 7:48 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > For the purposes to which SWIG was applied in that case, the findings > are accurate. IMO it's deliberately misleading. The following three layers are spurious and have no analog on the Cython stack: Python code to provi

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Robert Kern
On Sat, May 17, 2008 at 7:39 PM, Nathan Bell <[EMAIL PROTECTED]> wrote: > More disingenuous FUD here: http://www.sagemath.org/doc/html/prog/node36.html For the purposes to which SWIG was applied in that case, the findings are accurate. The wording is overly general, though; it doesn't talk about

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Nathan Bell
On Sat, May 17, 2008 at 6:42 PM, Dag Sverre Seljebotn <[EMAIL PROTECTED]> wrote: > > Cython is a different approach from SWIG (see > http://wiki.cython.org/WrappingCorCpp; in particular SWIG uses more layers > of indirection). > >From the link: "[SWIG] Can wrap almost any C and C++ code, including

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Nathan Bell
On Sat, May 17, 2008 at 5:55 PM, Jose Martin <[EMAIL PROTECTED]> wrote: > > Hi, I'd like to access a C function from python, and the function takes > input/output arrays. I'd probably use SWIG to do the interface to the C code. > I found 2 options: > -NumPtr module, to access Numeric arrays as po

Re: [Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Dag Sverre Seljebotn
Jose Martin wrote: > > Hi, I'd like to access a C function from python, and the function takes > input/output arrays. I'd probably use SWIG to do the interface to the C > code. I found 2 options: > -NumPtr module, to access Numeric arrays as pointers > http://www.penzilla.net/tutorials/python/numpt

[Numpy-discussion] NumPtr vs NumPy.i to access C

2008-05-17 Thread Jose Martin
Hi, I'd like to access a C function from python, and the function takes input/output arrays. I'd probably use SWIG to do the interface to the C code. I found 2 options: -NumPtr module, to access Numeric arrays as pointers http://www.penzilla.net/tutorials/python/numptr/ - numpy.i, a SWIG interfa

Re: [Numpy-discussion] Getting pylint to recognize numpy

2008-05-17 Thread Robert Westerfield
On 5/17/08, Pierre GM <[EMAIL PROTECTED]> wrote: > On Saturday 17 May 2008 16:57:58 Robert Kern wrote: > > On Sat, May 17, 2008 at 3:49 PM, Robert Westerfield > > > > <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > > > I am unable to get the incredibly useful pylint (0.14) to recognize > > > numpy. >

Re: [Numpy-discussion] Getting pylint to recognize numpy

2008-05-17 Thread Pierre GM
On Saturday 17 May 2008 16:57:58 Robert Kern wrote: > On Sat, May 17, 2008 at 3:49 PM, Robert Westerfield > > <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I am unable to get the incredibly useful pylint (0.14) to recognize > > numpy. mmh, works great on my machine... pylint 0.14.0, astng 0.17.2, com

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Robin
On Sat, May 17, 2008 at 7:22 PM, Brian Blais <[EMAIL PROTECTED]> wrote: > at least for me, that was the motivation. I am trying to build a simulation > framework for part of the brain, which requires connected layers of nodes. > A layer is either a 1D or 2D structure of nodes, with each node a >

Re: [Numpy-discussion] Getting pylint to recognize numpy

2008-05-17 Thread Robert Kern
On Sat, May 17, 2008 at 3:49 PM, Robert Westerfield <[EMAIL PROTECTED]> wrote: > Hi, > > I am unable to get the incredibly useful pylint (0.14) to recognize numpy. > > Could anyone help me out here please? I'm afraid I can't help you. I don't use pylint (too slow for my uses). Have you tried askin

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Anne Archibald
2008/5/17 Anne Archibald <[EMAIL PROTECTED]>: > 2008/5/17 Brian Blais <[EMAIL PROTECTED]>: > >> at least for me, that was the motivation. I am trying to build a simulation >> framework for part of the brain, which requires connected layers of nodes. >> A layer is either a 1D or 2D structure of no

[Numpy-discussion] Getting pylint to recognize numpy

2008-05-17 Thread Robert Westerfield
Hi, I am unable to get the incredibly useful pylint (0.14) to recognize numpy. Could anyone help me out here please? Thank you! -Rob 1) Confirming that python picks up numpy: D:\src>python DummyModule.py [1 2 3] 2) Running pylint: D:\src>pylint -rn -iy DummyModule No config file found, using

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Robert Kern
On Sat, May 17, 2008 at 3:33 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > On Sat, May 17, 2008 at 2:25 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> >> On Sat, May 17, 2008 at 3:18 PM, Charles R Harris >> <[EMAIL PROTECTED]> wrote: >> > Base classes also tend to have limited functionality th

Re: [Numpy-discussion] Trac mailing still broken.

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 2:20 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Sat, May 17, 2008 at 1:40 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > Trac still fails to send me mail when tickets are added or changed. Do I > > need to resubscribe? I also have to log in twice to log in. That

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 2:25 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Sat, May 17, 2008 at 3:18 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > Base classes also tend to have limited functionality that will be common > to > > all derived types. The object type in Python has only a few

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 2:25 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Sat, May 17, 2008 at 3:18 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > Base classes also tend to have limited functionality that will be common > to > > all derived types. The object type in Python has only a few

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Robert Kern
On Sat, May 17, 2008 at 3:18 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > Base classes also tend to have limited functionality that will be common to > all derived types. The object type in Python has only a few methods and > attributes: > > In [4]: dir(object) > Out[4]: > ['__class__', > '__

Re: [Numpy-discussion] Trac mailing still broken.

2008-05-17 Thread Robert Kern
On Sat, May 17, 2008 at 1:40 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > Trac still fails to send me mail when tickets are added or changed. Do I > need to resubscribe? I also have to log in twice to log in. That is an easy > work around, but still, it has been that way for a couple of months

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 1:45 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Sat, May 17, 2008 at 1:18 PM, Anne Archibald <[EMAIL PROTECTED]> > wrote: > >> 2008/5/17 Brian Blais <[EMAIL PROTECTED]>: >> >> > at least for me, that was the motivation. I am trying to build a >> simulation >>

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Bryan Cole
> > > From the response, the answer seems to be no, and that I should stick > with the python loops for clarity. But also, the words of Anne > Archibald, makes me think that I have made a bad choice by inheriting > from ndarray, although I am not sure what a convenient alternative > would be.

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 1:18 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/5/17 Brian Blais <[EMAIL PROTECTED]>: > > > at least for me, that was the motivation. I am trying to build a > simulation > > framework for part of the brain, which requires connected layers of > nodes. > > A layer

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Anne Archibald
2008/5/17 Brian Blais <[EMAIL PROTECTED]>: > at least for me, that was the motivation. I am trying to build a simulation > framework for part of the brain, which requires connected layers of nodes. > A layer is either a 1D or 2D structure of nodes, with each node a > relatively complex beast. R

Re: [Numpy-discussion] Trac mailing still broken.

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 12:40 PM, Charles R Harris < [EMAIL PROTECTED]> wrote: > Trac still fails to send me mail when tickets are added or changed. Do I > need to resubscribe? I also have to log in twice to log in. That is an easy > work around, but still, it has been that way for a couple of mon

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 1:02 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/5/17 Charles R Harris <[EMAIL PROTECTED]>: > > > > > > On Sat, May 17, 2008 at 9:52 AM, Alan G Isaac <[EMAIL PROTECTED]> > wrote: > >> > >> On Fri, 16 May 2008, Anne Archibald apparently wrote: > >> > storing actual

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Anne Archibald
2008/5/17 Charles R Harris <[EMAIL PROTECTED]>: > > > On Sat, May 17, 2008 at 9:52 AM, Alan G Isaac <[EMAIL PROTECTED]> wrote: >> >> On Fri, 16 May 2008, Anne Archibald apparently wrote: >> > storing actual python objects in an array is probably not >> > a good idea >> >> I have been wondering what

Re: [Numpy-discussion] checking element types in array

2008-05-17 Thread Anne Archibald
2008/5/17 Zoho Vignochi <[EMAIL PROTECTED]>: > hello: > > I am writing my own version of a dot product. Simple enough this way: > > def dot_r(a, b): >return sum( x*y for (x,y) in izip(a, b) ) > > However if both a and b are complex we need: > > def dot_c(a, b): >return sum( x*y for

[Numpy-discussion] Trac mailing still broken.

2008-05-17 Thread Charles R Harris
Trac still fails to send me mail when tickets are added or changed. Do I need to resubscribe? I also have to log in twice to log in. That is an easy work around, but still, it has been that way for a couple of months and it should be fixable. Chuck ___ N

Re: [Numpy-discussion] ANN: NumPy/SciPy Documentation Marathon 2008

2008-05-17 Thread Joe Harrington
> I didn't see Travis's Numpy book mentioned at all in your writeup, so > I am wondering where its role in the doc effort is. > Is it OK to copy material out of the book and into > other parts of the documentation? No worries, Travis is on board here. We included him and others on the Steering

Re: [Numpy-discussion] numpy.sign(numpy.nan)?????

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 5:55 AM, Stuart Brorson <[EMAIL PROTECTED]> wrote: > >> In [66]: numpy.sign(numpy.nan) > >> Out[66]: 0.0 > >> > >> IMO, the output should be NaN, not zero. > > > The implementation is actually in a #define macro in > > umathmodule.c.src. Look for _SIGN1 (and _SIGNC if you w

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Brian Blais
On May 17, 2008, at May 17:11:52 AM, Alan G Isaac wrote: On Fri, 16 May 2008, Anne Archibald apparently wrote: storing actual python objects in an array is probably not a good idea I have been wondering what people use object arrays for. I have been guessing that it is for indexing convenienc

Re: [Numpy-discussion] Tagging 1.1rc1 in about 12 hours

2008-05-17 Thread Pearu Peterson
On Sat, May 17, 2008 7:48 pm, Charles R Harris wrote: > On Fri, May 16, 2008 at 1:20 AM, Jarrod Millman <[EMAIL PROTECTED]> > wrote: >> Once I tag 1.1.0, I will open the trunk for 1.1.1 development. ... >> Any development for 1.2 will have to occur on a new branch. > > So open the new branch alrea

Re: [Numpy-discussion] ANN: NumPy/SciPy Documentation Marathon 2008

2008-05-17 Thread Stéfan van der Walt
Hi Andreas 2008/5/17 Andreas Klöckner <[EMAIL PROTECTED]>: > On Samstag 17 Mai 2008, Joe Harrington wrote: >> To head off another pedagogical meltdown, the University of Central >> Florida has hired Stefan van der Walt full time to coordinate a >> community documentation effort to write reference

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 9:52 AM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > On Fri, 16 May 2008, Anne Archibald apparently wrote: > > storing actual python objects in an array is probably not > > a good idea > > I have been wondering what people use object arrays for. > I have been guessing that it

Re: [Numpy-discussion] Tagging 1.1rc1 in about 12 hours

2008-05-17 Thread Charles R Harris
On Sat, May 17, 2008 at 10:48 AM, Charles R Harris < [EMAIL PROTECTED]> wrote: > > > On Fri, May 16, 2008 at 1:20 AM, Jarrod Millman <[EMAIL PROTECTED]> > wrote: > >> Hello, >> >> I believe that we have now addressed everything that was holding up >> the 1.1.0 release, so I will be tagging the 1.1

Re: [Numpy-discussion] Tagging 1.1rc1 in about 12 hours

2008-05-17 Thread Charles R Harris
On Fri, May 16, 2008 at 1:20 AM, Jarrod Millman <[EMAIL PROTECTED]> wrote: > Hello, > > I believe that we have now addressed everything that was holding up > the 1.1.0 release, so I will be tagging the 1.1.0rc1 in about 12 > hours. Please be extremely conservative and careful about any commits >

Re: [Numpy-discussion] question about optimizing

2008-05-17 Thread Alan G Isaac
On Fri, 16 May 2008, Anne Archibald apparently wrote: > storing actual python objects in an array is probably not > a good idea I have been wondering what people use object arrays for. I have been guessing that it is for indexing convenience? Are there other core motivations? Alan Isaac __

[Numpy-discussion] checking element types in array

2008-05-17 Thread Zoho Vignochi
hello: I am writing my own version of a dot product. Simple enough this way: def dot_r(a, b): return sum( x*y for (x,y) in izip(a, b) ) However if both a and b are complex we need: def dot_c(a, b): return sum( x*y for (x,y) in izip(a.conjugate(), b) ).real I would like to combi

Re: [Numpy-discussion] ANN: NumPy/SciPy Documentation Marathon 2008

2008-05-17 Thread Andreas Klöckner
On Samstag 17 Mai 2008, Joe Harrington wrote: > To head off another pedagogical meltdown, the University of Central > Florida has hired Stefan van der Walt full time to coordinate a > community documentation effort to write reference documentation and > tools. This is truly excellent news. One qu

Re: [Numpy-discussion] numpy.arccos(numpy.inf)????

2008-05-17 Thread Christian Heimes
Stuart Brorson schrieb: > Hi -- > > Sorry to be a pest with corner cases, but I found another one. [...] Mark and I spent a *lot* of time in fixing those edge cases in Python 2.6 and 3.0. We used the C99 standard as template. I recommend that you look at our code. Christian ___

Re: [Numpy-discussion] [SciPy-user] ANN: NumPy/SciPy Documentation Marathon 2008

2008-05-17 Thread Joe Harrington
Ryan writes: > This is very good news. I will find some way to get involved. Great! Please dive right in, and sign up on the Developer_Zone page so we can keep track of who's involved. One thing I forgot to mention in my too-wordy announcement was that discussion of documentation is on the scip

Re: [Numpy-discussion] numpy.sign(numpy.nan)?????

2008-05-17 Thread Stuart Brorson
>> In [66]: numpy.sign(numpy.nan) >> Out[66]: 0.0 >> >> IMO, the output should be NaN, not zero. > The implementation is actually in a #define macro in > umathmodule.c.src. Look for _SIGN1 (and _SIGNC if you want to clean up > the complex versions, too). OK, I submitted a patch. #794 in the trac

Re: [Numpy-discussion] svd in numpy

2008-05-17 Thread David Cournapeau
Nripun Sredar wrote: > I have a sparse matrix 416x52. I tried to factorize this matrix using > svd from numpy. But it didn't produce a result and looked like it is > in an infinite loop. > I tried a similar operation using random numbers in the matrix. Even > this is in an infinite loop. > Did a