Re: [Numpy-discussion] rant against from numpy import * / from pylab import *

2007-08-02 Thread Sebastian Haase
at this: # 20070802 # len(dir(pylab)) # 441 # len(dir(P)) # 346 # P.nx.numpy.__version__ # '1.0.1' # N.__version__ # '1.0.1' # N.alltrue # function alltrue at 0x01471B70 # P.alltrue # function alltrue at 0x019142F0 # N.alltrue.__doc__

Re: [Numpy-discussion] fourier with single precision

2007-08-02 Thread Lars Friedrich
Hello, David Cournapeau wrote: As far as I can read from the fft code in numpy, only double is supported at the moment, unfortunately. Note that you can get some speed by using scipy.fftpack methods instead, if scipy is an option for you. What I understood is that numpy uses FFTPACK's

[Numpy-discussion] 16bit Integer Array/Scalar Inconsistency

2007-08-02 Thread Ryan May
Hi, I ran into this while debugging a script today: In [1]: import numpy as N In [2]: N.__version__ Out[2]: '1.0.3' In [3]: d = N.array([32767], dtype=N.int16) In [4]: d + 32767 Out[4]: array([-2], dtype=int16) In [5]: d[0] + 32767 Out[5]: 65534 In [6]: type(d[0] + 32767) Out[6]: type

[Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Lisandro Dalcin
using numpy-1.0.3, I believe there are a reference leak somewhere. Using a debug build of Python 2.5.1 (--with-pydebug), I get the following import sys, gc import numpy def testleaks(func, args=(), kargs={}, repeats=5): for i in xrange(repeats): r1 = sys.gettotalrefcount()

Re: [Numpy-discussion] 16bit Integer Array/Scalar Inconsistency

2007-08-02 Thread Robert Kern
Ryan May wrote: Hi, I ran into this while debugging a script today: In [1]: import numpy as N In [2]: N.__version__ Out[2]: '1.0.3' In [3]: d = N.array([32767], dtype=N.int16) In [4]: d + 32767 Out[4]: array([-2], dtype=int16) In [5]: d[0] + 32767 Out[5]: 65534 In [6]:

Re: [Numpy-discussion] fourier with single precision

2007-08-02 Thread Warren Focke
On Thu, 2 Aug 2007, Lars Friedrich wrote: What I understood is that numpy uses FFTPACK's algorithms. Sort of. It appears to be a hand translation from F77 to C. From www.netlib.org/fftpack (is this the right address?) I took that there is a single-precision and double-precision-version

Re: [Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Timothy Hochberg
On 8/2/07, Lisandro Dalcin [EMAIL PROTECTED] wrote: using numpy-1.0.3, I believe there are a reference leak somewhere. Using a debug build of Python 2.5.1 (--with-pydebug), I get the following import sys, gc import numpy def testleaks(func, args=(), kargs={}, repeats=5): for i in

Re: [Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Lisandro Dalcin
Ups, I forgot to mention I was using gc.collect(), I accidentally cleaned it my mail Anyway, the following import sys, gc import numpy def test(): a = numpy.zeros(5, dtype=float) while 1: gc.collect() b = numpy.asarray(a, dtype=float); del b gc.collect()

Re: [Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Lisandro Dalcin
I think the problem is in _array_fromobject (seen as numpy.array in Python) This function parses its arguments by using the convertor PyArray_DescrConverter2. which RETURNS A NEW REFERENCE!!! This reference is never DECREF'ed. BTW, A lesson I've learned of the pattern if

Re: [Numpy-discussion] fourier with single precision

2007-08-02 Thread Charles R Harris
On 8/2/07, Warren Focke [EMAIL PROTECTED] wrote: On Thu, 2 Aug 2007, Lars Friedrich wrote: What I understood is that numpy uses FFTPACK's algorithms. Sort of. It appears to be a hand translation from F77 to C. From www.netlib.org/fftpack (is this the right address?) I took that

Re: [Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Lisandro Dalcin
This patch corrected the problem for me, numpy test pass... On 8/2/07, Lisandro Dalcin [EMAIL PROTECTED] wrote: I think the problem is in _array_fromobject (seen as numpy.array in Python) -- Lisandro Dalcín --- Centro Internacional de Métodos Computacionales en Ingeniería

Re: [Numpy-discussion] fourier with single precision

2007-08-02 Thread Warren Focke
On Thu, 2 Aug 2007, Charles R Harris wrote: On X86 machines the main virtue would be smaller and more cache friendly arrays because double precision arithmetic is about the same speed as single precision, sometimes even a bit faster. The PPC architecture does have faster single than double