[Numpy-discussion] numpy's future (1.1 and beyond): which direction(s) ?

2008-03-20 Thread David Cournapeau
Hi, numpy 1.0.5 is on the way, and I was wondering about numpy's future. I myself have some ideas about what could be done; has there been any discussion behind what is on 1.1 trac's roadmap ? Some of the things I would like to see myself: - a framework for plug-in architecture, th

Re: [Numpy-discussion] dimensions too large error

2008-03-20 Thread David Cournapeau
On Fri, 2008-03-14 at 18:00 -0700, Dinesh B Vadhia wrote: > For the following code: > > I = 18000 > J = 33000 > filename = 'ij.txt' > A = scipy.asmatrix(numpy.empty((I,J), dtype=numpy.int)) You are asking to create a matrix of more than 2 Gb, which is unlikely to work on a 32 bits OS (by default

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-20 Thread Pierre GM
On Thursday 20 March 2008 19:06:32 Chris Withers wrote: > > the second element in the array iteration here is actually the > > numpy.ma.masked constant, which always has the same fill value (which I > > guess is 99). > > This sucks to the point of feeling like a bug :-( It is not. > Why is i

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-20 Thread Pierre GM
Folks, Sorry for my delayed answers: I'm on the road these days and can't connect to the web as often and well I'd like to. On Wednesday 19 March 2008 19:47:37 Matt Knox wrote: > > 1. why am I not getting my NaN's back? Because they're gone when you create your masked array. The idea here is t

Re: [Numpy-discussion] isnan bug?

2008-03-20 Thread Chris Withers
Eric Firing wrote: > I don't see why you consider this a bug. isnan tests whether an > instance of a numeric type is a nan or not; Why does it limit to numeric types? isnan sounds pretty boolean to me, anything that isn't nan should return False, regardless of type, in the same way as I can do:

Re: [Numpy-discussion] documentation for masked arrays?

2008-03-20 Thread Chris Withers
Jarrod Millman wrote: > > There is a documentation day on Friday. If you have some time, it > would be great if you could help out with writing NumPy docstrings. > There more people who contribute, the faster this will happen. It's a catch 22, I don't have the knowledge to usefully do this :-(

Re: [Numpy-discussion] bug with with fill_values in masked arrays?

2008-03-20 Thread Chris Withers
Matt Knox wrote: >> 1. why am I not getting my NaN's back? > > when iterating over a masked array, you get the "ma.masked" constant for > elements that were masked (same as what you would get if you indexed the > masked > array at that element). If you are referring specifically to the .data port

Re: [Numpy-discussion] Inplace index suprise

2008-03-20 Thread Gael Varoquaux
On Thu, Mar 20, 2008 at 06:43:21PM -0300, Lisandro Dalcin wrote: > I think you are wrong, here THERE ARE tmp arrays involved... numpy has > to copy data if indices are not contiguous or strides (in the sense of > actually using a slice) > In [1]: from numpy import * > In [2]: A = array([0,0,0]) >

Re: [Numpy-discussion] Inplace index suprise

2008-03-20 Thread Lisandro Dalcin
I think you are wrong, here THERE ARE tmp arrays involved... numpy has to copy data if indices are not contiguous or strides (in the sense of actually using a slice) In [1]: from numpy import * In [2]: A = array([0,0,0]) In [3]: B = A[[0,1,2]] In [4]: print B.base None In [5]: C = A[0:3] In [6]: p

Re: [Numpy-discussion] NumPy 1.0.5 almost ready

2008-03-20 Thread Pauli Virtanen
to, 2008-03-20 kello 21:09 +0100, Matthieu Brucher kirjoitti: > Well, it is not completely solved. With the patch, the reference count > keeps on raising, but as it is for Python scalars, it is not a > problem, but the underlying problem in Py_DECREF will show up > eventually and it will need to b

Re: [Numpy-discussion] NumPy 1.0.5 almost ready

2008-03-20 Thread Matthieu Brucher
Well, it is not completely solved. With the patch, the reference count keeps on raising, but as it is for Python scalars, it is not a problem, but the underlying problem in Py_DECREF will show up eventually and it will need to be solved. But I'm afraid I'm not intimate enough with the mecanisms of

Re: [Numpy-discussion] NumPy 1.0.5 almost ready

2008-03-20 Thread Pauli Virtanen
ke, 2008-03-19 kello 11:53 -0700, Jarrod Millman kirjoitti: > Hello, > > Thanks to everyone who has been working on getting the 1.0.5 release > of NumPy out the door. Since my last email at least 12 bug tickets > have been closed. There are a few remaining issues with the trunk, > but we are fa

Re: [Numpy-discussion] Floating-point support for MyHDL

2008-03-20 Thread Robert Kern
On Thu, Mar 20, 2008 at 2:40 PM, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > > Would anyone know as to how to develop floating point support for the MyHDL > module?? Has anyone worked with any alternative versions of the IEEE > standard for floating -point? Also has anyone developed a floating

Re: [Numpy-discussion] Inplace index suprise

2008-03-20 Thread James Philbin
Hi, > More importantly, it is technically impossible because of the way that > *Python* works. See the thread "Histograms via indirect index arrays" > for a detailed explanation. > > http://projects.scipy.org/pipermail/numpy-discussion/2006-March/006877.html OK, that makes things much clearer

[Numpy-discussion] Floating-point support for MyHDL

2008-03-20 Thread Blubaugh, David A.
Would anyone know as to how to develop floating point support for the MyHDL module?? Has anyone worked with any alternative versions of the IEEE standard for floating -point? Also has anyone developed a floating-point library for a module within the python environment in order to execute numerical

Re: [Numpy-discussion] Inplace index suprise

2008-03-20 Thread Anne Archibald
On 20/03/2008, Gael Varoquaux <[EMAIL PROTECTED]> wrote: > On Thu, Mar 20, 2008 at 06:17:44PM +, James Philbin wrote: > > Hi, > > > > This cannot work, because the inplace operation does not > > > take place as a for loop. > > Well, this would be fine if I was assigning the values to temp

Re: [Numpy-discussion] Inplace index suprise

2008-03-20 Thread Robert Kern
On Thu, Mar 20, 2008 at 1:35 PM, Gael Varoquaux <[EMAIL PROTECTED]> wrote: > On Thu, Mar 20, 2008 at 06:17:44PM +, James Philbin wrote: > > Hi, > > > > This cannot work, because the inplace operation does not > > > take place as a for loop. > > Well, this would be fine if I was assigning

Re: [Numpy-discussion] Correlate with small arrays

2008-03-20 Thread Robert Kern
On Thu, Mar 20, 2008 at 5:44 AM, Peter Creasey <[EMAIL PROTECTED]> wrote: > > > I'm trying to do a PDE style calculation with numpy arrays > > > > > > y = a * x[:-2] + b * x[1:-1] + c * x[2:] > > > > > > with a,b,c constants. I realise I could use correlate for this, i.e > > > > > >

Re: [Numpy-discussion] Inplace index suprise

2008-03-20 Thread Gael Varoquaux
On Thu, Mar 20, 2008 at 06:17:44PM +, James Philbin wrote: > Hi, > > This cannot work, because the inplace operation does not > > take place as a for loop. > Well, this would be fine if I was assigning the values to tempories as > you suggest. However, the operation should be performed inpla

Re: [Numpy-discussion] isnan bug?

2008-03-20 Thread Eric Firing
Chris Withers wrote: > Hi All, > > I'm faily sure that: > > numpy.isnan(datetime.datetime.now()) > > ...should just return False and not raise an exception. > > Where can I raise a bug to this effect? > > cheers, > > Chris > Chris, I don't see why you consider this a bug. isnan tests whet

Re: [Numpy-discussion] Numpy test failure with latest svn

2008-03-20 Thread Nils Wagner
On Thu, 20 Mar 2008 18:12:22 +0100 "Matthieu Brucher" <[EMAIL PROTECTED]> wrote: > Hi, > > With latest SVN and Ubuntu 7.10 (Python 2.5.1, gcc >4.1.3, 32bits computer), > I don't have any error (BTW, I have 822 tests). > > Matthieu > > 2008/3/20, Nils Wagner <[EMAIL PROTECTED]>: >> >> Hi all,

Re: [Numpy-discussion] Inplace index suprise

2008-03-20 Thread James Philbin
Hi, > This cannot work, because the inplace operation does not > take place as a for loop. Well, this would be fine if I was assigning the values to tempories as you suggest. However, the operation should be performed inplace and this is what I don't understand - why is there no for loop? I thin

Re: [Numpy-discussion] Inplace index suprise

2008-03-20 Thread Gael Varoquaux
On Thu, Mar 20, 2008 at 05:42:05PM +, James Philbin wrote: > I was suprised to see this result: > >>> import numpy as N > >>> A = N.array([0,0,0]) > >>> A[[0,1,1,2]]+=1 > >>> A > array([1, 1, 1]) > Is this expected? Working on the principle of least surprise I would > expect [1,2,1] to be outp

[Numpy-discussion] Inplace index suprise

2008-03-20 Thread James Philbin
Hi, I was suprised to see this result: >>> import numpy as N >>> A = N.array([0,0,0]) >>> A[[0,1,1,2]]+=1 >>> A array([1, 1, 1]) Is this expected? Working on the principle of least surprise I would expect [1,2,1] to be output. Thanks, James ___ Numpy-d

Re: [Numpy-discussion] Numpy test failure with latest svn

2008-03-20 Thread P GM
That particular test in test_old_ma will never work: the .data of a masked array is implemented as a property, so its id will change from one test to another. On 3/20/08, Matthieu Brucher <[EMAIL PROTECTED]> wrote: > Hi, > > With latest SVN and Ubuntu 7.10 (Python 2.5.1, gcc 4.1.3, 32bits computer

Re: [Numpy-discussion] Numpy test failure with latest svn

2008-03-20 Thread Matthieu Brucher
Hi, With latest SVN and Ubuntu 7.10 (Python 2.5.1, gcc 4.1.3, 32bits computer), I don't have any error (BTW, I have 822 tests). Matthieu 2008/3/20, Nils Wagner <[EMAIL PROTECTED]>: > > Hi all, > > I run numpy.test() with latest svn > > >>> numpy.test() > Numpy is installed in > /usr/local/lib64/

[Numpy-discussion] Numpy test failure with latest svn

2008-03-20 Thread Nils Wagner
Hi all, I run numpy.test() with latest svn >>> numpy.test() Numpy is installed in /usr/local/lib64/python2.5/site-packages/numpy Numpy version 1.0.5.dev4898 Python version 2.5 (r25:51908, Jan 10 2008, 18:01:52) [GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] Found 10/10 tests for numpy.core.d

Re: [Numpy-discussion] Ravel and inplace modification

2008-03-20 Thread Charles R Harris
On Thu, Mar 20, 2008 at 9:11 AM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Thu, Mar 20, 2008 at 6:04 AM, Gael Varoquaux < > [EMAIL PROTECTED]> wrote: > > > At the nipy sprint in Paris, we have been having a discussion about > > methods modifying inplace and returning a view, or returnin

Re: [Numpy-discussion] Ravel and inplace modification

2008-03-20 Thread Charles R Harris
On Thu, Mar 20, 2008 at 6:04 AM, Gael Varoquaux < [EMAIL PROTECTED]> wrote: > At the nipy sprint in Paris, we have been having a discussion about > methods modifying inplace and returning a view, or returning a copy. > > The main issue is with ravel that tries to keep a view, but that > obviously

Re: [Numpy-discussion] C++ class encapsulating ctypes-numpy array?

2008-03-20 Thread Matthieu Brucher
2008/3/20, Joris De Ridder <[EMAIL PROTECTED]>: > > > > You can use ctypes if and ony if the C++ object is only used in one > > function call. You can't for instance create a C++ container with > > ctypes, then in Python call some method and then delete the > > container, because ctypes will destro

Re: [Numpy-discussion] C++ class encapsulating ctypes-numpy array?

2008-03-20 Thread Joris De Ridder
> You can use ctypes if and ony if the C++ object is only used in one > function call. You can't for instance create a C++ container with > ctypes, then in Python call some method and then delete the > container, because ctypes will destroy the data after the C++ > container was built. Thi

Re: [Numpy-discussion] C++ class encapsulating ctypes-numpy array?

2008-03-20 Thread Matthieu Brucher
2008/3/20, Joris De Ridder <[EMAIL PROTECTED]>: > > > Thanks Matthieu, for the interesting pointer. > My goal was to be able to use ctypes, though, to avoid having to do manual > memory management. Meanwhile, I was able to code something in C++ that may > be useful (see attachment). It (should) wor

Re: [Numpy-discussion] isnan bug?

2008-03-20 Thread David Huard
Chris, The trac page is to place to file tickets. Note that you have to register first before you can file new tickets. David 2008/3/20, Chris Withers <[EMAIL PROTECTED]>: > > Hi All, > > I'm faily sure that: > > numpy.isnan(datetime.datetime.now()) > >

Re: [Numpy-discussion] Can't add user defined complex types

2008-03-20 Thread Neal Becker
Travis E. Oliphant wrote: > Neal Becker wrote: >> In arrayobject.c, various complex functions (e.g., array_imag_get) use: >> PyArray_ISCOMPLEX -> PyTypeNum_ISCOMPLEX, >> which is hard coded to 2 predefined types :( >> >> If PyArray_ISCOMPLEX allowed user-defined types, I'm guessing functions >> su

Re: [Numpy-discussion] C++ class encapsulating ctypes-numpy array?

2008-03-20 Thread Joris De Ridder
Thanks Matthieu, for the interesting pointer.My goal was to be able to use ctypes, though, to avoid having to do manual memory management. Meanwhile, I was able to code something in C++ that may be useful (see attachment). It (should) work as follows.1) On the Python side: convert a numpy array to

[Numpy-discussion] Ravel and inplace modification

2008-03-20 Thread Gael Varoquaux
At the nipy sprint in Paris, we have been having a discussion about methods modifying inplace and returning a view, or returning a copy. The main issue is with ravel that tries to keep a view, but that obviously has to do a copy sometimes. (Is ravel the only place where this behavior can happen ?)

[Numpy-discussion] NumPy (1.0.5) DocDay (Fri, Mar. 21)

2008-03-20 Thread Jarrod Millman
Hello, As I mentioned yesterday, I am holding a NumPy DocDay on Friday, March 21st. I am in Paris near the RER B or C Saint-Michel station (with Stefan van der Walt, Matthieu Brucher, and Gael Varoquaux). If you are in the area and want to join us just send me an email by the end of tonight and

[Numpy-discussion] isnan bug?

2008-03-20 Thread Chris Withers
Hi All, I'm faily sure that: numpy.isnan(datetime.datetime.now()) ...should just return False and not raise an exception. Where can I raise a bug to this effect? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk

Re: [Numpy-discussion] Correlate with small arrays

2008-03-20 Thread Peter Creasey
> > I'm trying to do a PDE style calculation with numpy arrays > > > > y = a * x[:-2] + b * x[1:-1] + c * x[2:] > > > > with a,b,c constants. I realise I could use correlate for this, i.e > > > > y = numpy.correlate(x, array((a, b, c))) > > The relative performance seems to vary dependi

[Numpy-discussion] Inplace index suprise

2008-03-20 Thread James Philbin
Hi, I was suprised to see this result: >>> import numpy as N >>> A = N.array([0,0,0]) >>> A[[0,1,1,2]]+=1 >>> A array([1, 1, 1]) Is this expected? Working on the principle of least surprise I would expect [1,2,1] to be output. Thanks, James ___ Numpy-d

Re: [Numpy-discussion] documentation for masked arrays?

2008-03-20 Thread Jarrod Millman
On Wed, Mar 19, 2008 at 8:45 AM, Chris Withers <[EMAIL PROTECTED]> wrote: > That's not been my experience. I found the *one* mention of fill_value > just fine, the coverage of masked arrays is woeful :-( There is a documentation day on Friday. If you have some time, it would be great if you cou