Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Mark Wiebe
On Thu, Oct 21, 2010 at 2:47 PM, Pauli Virtanen wrote: > Thu, 21 Oct 2010 14:25:24 -0700, Mark Wiebe wrote: > [clip] > > That sounds like it could be tricky to handle correctly, especially > > since it should probably work to compare Fortran-order arrays with > > non-Fortran ones. > > > > Does an

Re: [Numpy-discussion] whitespace in git repo

2010-10-21 Thread Darren Dale
On Thu, Oct 21, 2010 at 4:48 PM, Friedrich Romstedt wrote: > 2010/10/21 Darren Dale : >> I filed a new pull request, http://github.com/numpy/numpy/pull/7 . >> This should enforce LF on all text files, with the current exception >> of the nsi.in file, which is CRLF. The svgs have been converted to

Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Pauli Virtanen
Thu, 21 Oct 2010 14:25:24 -0700, Mark Wiebe wrote: [clip] > That sounds like it could be tricky to handle correctly, especially > since it should probably work to compare Fortran-order arrays with > non-Fortran ones. > > Does anything actually depend on this behavior? Maybe it's something > that c

Re: [Numpy-discussion] test_creation Errors with np 1.5.1rc1 built on osx 10.5 py27 32bit

2010-10-21 Thread Vincent Davis
Sorry for the noise, I guess I had some cross installed python27 after deleting everything and starting over it work. New results below. Vincent >>> numpy.test() Running unit tests for numpy NumPy version 1.5.1rc1 NumPy is installed in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2

[Numpy-discussion] test_creation Errors with np 1.5.1rc1 built on osx 10.5 py27 32bit

2010-10-21 Thread Vincent Davis
Build info numpy-1.5.1rc1-py2.7-python.org-macosx10.5 python-2.7-macosx10.3 os x 10.5 installed on osx 10.6 python-2.7-macosx10.3 Been working on building the dmg, you can try it/download at http://vincentdavis.info/Shared/numpy-1.5.1rc1-py2.6-python.org-macosx10.3.dmg Saw a few tickets in trac

Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Mark Wiebe
On Thu, Oct 21, 2010 at 2:11 PM, Pauli Virtanen wrote: > > > Also, it is not correct to assume the dimensions are added to the end: > > >>> x = np.zeros((2,3),dtype=[('a','f8',(4,))]).T > >>> x.shape > (3, 2) > >>> x['a'].shape > (4, 3, 2) > > There's a special branch in the field access code th

Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Pauli Virtanen
Thu, 21 Oct 2010 13:33:21 -0700, Mark Wiebe wrote: [clip] > There's a bug in my current patch with regard to this then, as follows: > > >>> x = np.array([(0,),(0,),(1,)],dtype=[('a','f8',(1,))]) y = np.array([[(0,)],[(1,)]],dtype=[('a','f8',(1,))]) x==y > array([ True, False, False], dtype=b

Re: [Numpy-discussion] whitespace in git repo

2010-10-21 Thread Friedrich Romstedt
2010/10/21 Darren Dale : > I filed a new pull request, http://github.com/numpy/numpy/pull/7 . > This should enforce LF on all text files, with the current exception > of the nsi.in file, which is CRLF. The svgs have been converted to LF. > Additional, confusing reading can be found at > http://help

Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Mark Wiebe
On Thu, Oct 21, 2010 at 1:06 PM, Pauli Virtanen wrote: > > It seems that `_void_compare` *must* handle broadcasting itself -- I > thought this was done by the caller, but apparently not. So you're right > that the correct place to do the shape check is on the dtype level. > > There's a bug in my

Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Pauli Virtanen
Thu, 21 Oct 2010 12:50:11 -0700, Mark Wiebe wrote: [clip] > >>> import numpy as np > >>> from numpy.core.multiarray import memorysimpleview as memoryview > >>> obj = np.array(([[1, 2], [3, 4]],), dtype=[('a', ' >>> x = memoryview(obj) > >>> y = np.asarray(x) > >>> obj == y > False > > >>> y['a'].

Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Mark Wiebe
> > The other issue of allowing broadcasting in sub-arrays --- it does not seem very useful to me. Unlike arrays, the dimensions of sub-arrays cannot be manipulated easily, and so many use-cases of broadcasting just disappear. I implemented the a/b shape checking in the structured array comp

Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Charles R Harris
On Thu, Oct 21, 2010 at 12:18 PM, Pauli Virtanen wrote: > Thu, 21 Oct 2010 11:03:52 -0600, Charles R Harris wrote: > [clip] > > I think the important thing to settle here is just how dtype comparisons > > are supposed to work. The current implementation might well be intended > > and if so we nee

Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Pauli Virtanen
Thu, 21 Oct 2010 11:03:52 -0600, Charles R Harris wrote: [clip] > I think the important thing to settle here is just how dtype comparisons > are supposed to work. The current implementation might well be intended > and if so we need to know why it is so. I'd like Travis to weigh in > here. To me i

Re: [Numpy-discussion] dtype subarray comparison

2010-10-21 Thread Charles R Harris
On Wed, Oct 20, 2010 at 5:59 PM, Mark Wiebe wrote: > It turns out that when comparing dtypes, the subarray is currently ignored. > This means you can get things like this: > > >>> import numpy as np > >>> np.dtype(('f4',(6))) == np.dtype(('f4',(2,3))) > True > >>> np.dtype(([('a','i4')],2)) == n

Re: [Numpy-discussion] whitespace in git repo

2010-10-21 Thread Darren Dale
On Thu, Oct 21, 2010 at 9:26 AM, David Cournapeau wrote: > On Thu, Oct 21, 2010 at 8:47 PM, Friedrich Romstedt > wrote: >> 2010/10/21 David Cournapeau : >>> On Thu, Oct 21, 2010 at 12:56 AM, Friedrich Romstedt >>> wrote: 2010/10/20 Darren Dale : > On Wed, Oct 20, 2010 at 6:12 AM, Friedr

Re: [Numpy-discussion] portable doctests despite floating points numbers

2010-10-21 Thread Sébastien Barthélemy
I've haven't found any clean way. So I'll use "numpy.allclose" in my doctests. It will be harder to read, less interactive-session-like, but it might show the reader how compare floats properly. On Fri, Oct 15, 2010 at 2:05 PM, Fabrice Silva wrote: > Maybe you should not rely on doctest to do th

Re: [Numpy-discussion] whitespace in git repo

2010-10-21 Thread David Cournapeau
On Thu, Oct 21, 2010 at 8:47 PM, Friedrich Romstedt wrote: > 2010/10/21 David Cournapeau : >> On Thu, Oct 21, 2010 at 12:56 AM, Friedrich Romstedt >> wrote: >>> 2010/10/20 Darren Dale : On Wed, Oct 20, 2010 at 6:12 AM, Friedrich Romstedt wrote: > Due to Darren's config file the .ns

Re: [Numpy-discussion] whitespace in git repo

2010-10-21 Thread Friedrich Romstedt
2010/10/21 David Cournapeau : > On Thu, Oct 21, 2010 at 12:56 AM, Friedrich Romstedt > wrote: >> 2010/10/20 Darren Dale : >>> On Wed, Oct 20, 2010 at 6:12 AM, Friedrich Romstedt >>> wrote: Due to Darren's config file the .nsi.in file made it with CRLF into the repo. >>> >>> Uh, no. >>

Re: [Numpy-discussion] function name as parameter

2010-10-21 Thread Johann Cohen-Tanugi
On 10/20/2010 11:49 PM, Zachary Pincus wrote: >> Hi Robert, >> so in a big data analysis framework, that is essentially written in C >> ++, >> exposed to python with SWIG, plus dedicated python modules, the user >> performs an analysis choosing some given modules by name,as in : >> myOpt="foo" >>