Re: [Numpy-discussion] object array alignment issues

2009-10-20 Thread Michael Droettboom
Thanks. It's passing the related unit tests on Sparc SunOS 5, and Linux x86. Cheers, Mike Charles R Harris wrote: > > > On Tue, Oct 20, 2009 at 10:13 AM, Charles R Harris > mailto:charlesr.har...@gmail.com>> wrote: > > > > On Tue, Oct 20, 2009 at 7:02 AM, Michael Droettboom > mailto:md

Re: [Numpy-discussion] object array alignment issues

2009-10-20 Thread Charles R Harris
On Tue, Oct 20, 2009 at 10:13 AM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Tue, Oct 20, 2009 at 7:02 AM, Michael Droettboom wrote: > >> I've resubmitted the patch without whitespace-only changes. >> >> For what it's worth, I had followed the directions here: >> >> http://proje

Re: [Numpy-discussion] object array alignment issues

2009-10-20 Thread Charles R Harris
On Tue, Oct 20, 2009 at 7:02 AM, Michael Droettboom wrote: > I've resubmitted the patch without whitespace-only changes. > > For what it's worth, I had followed the directions here: > > http://projects.scipy.org/numpy/wiki/EmacsSetup > > which say to perform "untabify" and "whitespace-cleanup".

Re: [Numpy-discussion] object array alignment issues

2009-10-20 Thread Michael Droettboom
I've resubmitted the patch without whitespace-only changes. For what it's worth, I had followed the directions here: http://projects.scipy.org/numpy/wiki/EmacsSetup which say to perform "untabify" and "whitespace-cleanup". Are those not current? I had added these to my pre-save hooks under my

Re: [Numpy-discussion] object array alignment issues

2009-10-19 Thread Charles R Harris
On Mon, Oct 19, 2009 at 4:36 PM, Robert Kern wrote: > On Mon, Oct 19, 2009 at 17:28, Charles R Harris > wrote: > > > > On Mon, Oct 19, 2009 at 3:55 PM, Travis Oliphant > > > wrote: > > >> Right now, though, the patch has too many white-space only changes in > >> it. Could you submit a new patc

Re: [Numpy-discussion] object array alignment issues

2009-10-19 Thread Robert Kern
On Mon, Oct 19, 2009 at 17:28, Charles R Harris wrote: > > On Mon, Oct 19, 2009 at 3:55 PM, Travis Oliphant > wrote: >> Right now, though, the patch has too many white-space only changes in >> it.  Could you submit a new patch that removes those changes? > > The old whitespace is hard tabs and n

Re: [Numpy-discussion] object array alignment issues

2009-10-19 Thread Charles R Harris
On Mon, Oct 19, 2009 at 3:55 PM, Travis Oliphant wrote: > > On Oct 19, 2009, at 9:55 AM, Michael Droettboom wrote: > > > I've filed a bug and attached a patch: > > > > http://projects.scipy.org/numpy/ticket/1267 > > > > No guarantees that I've found all of the alignment issues. I did a > > grep >

Re: [Numpy-discussion] object array alignment issues

2009-10-19 Thread Travis Oliphant
On Oct 19, 2009, at 9:55 AM, Michael Droettboom wrote: > I've filed a bug and attached a patch: > > http://projects.scipy.org/numpy/ticket/1267 > > No guarantees that I've found all of the alignment issues. I did a > grep > for "PyObject **" to find possible locations where PyObject * in > a

Re: [Numpy-discussion] object array alignment issues

2009-10-19 Thread Michael Droettboom
I've filed a bug and attached a patch: http://projects.scipy.org/numpy/ticket/1267 No guarantees that I've found all of the alignment issues. I did a grep for "PyObject **" to find possible locations where PyObject * in arrays were being dereferenced. If I could write a unit test to make it f

Re: [Numpy-discussion] object array alignment issues

2009-10-18 Thread Charles R Harris
On Sun, Oct 18, 2009 at 6:04 AM, Michael Droettboom wrote: > On 10/16/2009 11:35 PM, Travis Oliphant wrote: > > > > On Oct 15, 2009, at 11:40 AM, Michael Droettboom wrote: > > > >> I recently committed a regression test and bugfix for object pointers in > >> record arrays of unaligned size (meani

Re: [Numpy-discussion] object array alignment issues

2009-10-18 Thread Michael Droettboom
On 10/16/2009 11:35 PM, Travis Oliphant wrote: > > On Oct 15, 2009, at 11:40 AM, Michael Droettboom wrote: > >> I recently committed a regression test and bugfix for object pointers in >> record arrays of unaligned size (meaning where each record is not a >> multiple of sizeof(PyObject **)). >> >>

Re: [Numpy-discussion] object array alignment issues

2009-10-17 Thread Francesc Alted
A Friday 16 October 2009 18:05:05 Sturla Molden escrigué: > Francesc Alted skrev: > > The response is clear: avoid memcpy() if you can. It is true that > > memcpy() performance has improved quite a lot in latest gcc (it has been > > quite good in Win versions since many years ago), but working wit

Re: [Numpy-discussion] object array alignment issues

2009-10-16 Thread Charles R Harris
On Fri, Oct 16, 2009 at 9:35 PM, Travis Oliphant wrote: > > On Oct 15, 2009, at 11:40 AM, Michael Droettboom wrote: > > I recently committed a regression test and bugfix for object pointers in > record arrays of unaligned size (meaning where each record is not a > multiple of sizeof(PyObject **)).

Re: [Numpy-discussion] object array alignment issues

2009-10-16 Thread Travis Oliphant
On Oct 15, 2009, at 11:40 AM, Michael Droettboom wrote: I recently committed a regression test and bugfix for object pointers in record arrays of unaligned size (meaning where each record is not a multiple of sizeof(PyObject **)). For example: a1 = np.zeros((10,), dtype=[('o', 'O'),

Re: [Numpy-discussion] object array alignment issues

2009-10-16 Thread Sturla Molden
Francesc Alted skrev: > The response is clear: avoid memcpy() if you can. It is true that memcpy() > performance has improved quite a lot in latest gcc (it has been quite good in > Win versions since many years ago), but working with data in-place (i.e. > avoiding a memory copy) is always faste

Re: [Numpy-discussion] object array alignment issues

2009-10-16 Thread Michael Droettboom
On 10/16/2009 07:53 AM, Pauli Virtanen wrote: > Fri, 16 Oct 2009 12:07:10 +0200, Francesc Alted wrote: > [clip] > >> IMO, NumPy can be improved for unaligned data handling. For example, >> Numexpr is using this small snippet: >> >> from cpuinfo import cpu >> if cpu.is_AMD() or cpu.is_Intel():

Re: [Numpy-discussion] object array alignment issues

2009-10-16 Thread Francesc Alted
A Friday 16 October 2009 14:02:03 David Cournapeau escrigué: > On Fri, Oct 16, 2009 at 8:53 PM, Pauli Virtanen wrote: > > Fri, 16 Oct 2009 12:07:10 +0200, Francesc Alted wrote: > > [clip] > > > >> IMO, NumPy can be improved for unaligned data handling.  For example, > >> Numexpr is using this smal

Re: [Numpy-discussion] object array alignment issues

2009-10-16 Thread David Cournapeau
On Fri, Oct 16, 2009 at 8:53 PM, Pauli Virtanen wrote: > Fri, 16 Oct 2009 12:07:10 +0200, Francesc Alted wrote: > [clip] >> IMO, NumPy can be improved for unaligned data handling.  For example, >> Numexpr is using this small snippet: >> >> from cpuinfo import cpu >> if cpu.is_AMD() or cpu.is_Intel

Re: [Numpy-discussion] object array alignment issues

2009-10-16 Thread Pauli Virtanen
Fri, 16 Oct 2009 12:07:10 +0200, Francesc Alted wrote: [clip] > IMO, NumPy can be improved for unaligned data handling. For example, > Numexpr is using this small snippet: > > from cpuinfo import cpu > if cpu.is_AMD() or cpu.is_Intel(): > is_cpu_amd_intel = True > else: > is_cpu_amd_intel

Re: [Numpy-discussion] object array alignment issues

2009-10-16 Thread Francesc Alted
A Thursday 15 October 2009 19:00:04 Charles R Harris escrigué: > > So, how to fix this? > > > > One obvious workaround is for users to pass "align=True" to the dtype > > constructor. This works if the dtype descriptor is a dictionary or > > comma-separated string. Is there a reason it couldn't be

Re: [Numpy-discussion] object array alignment issues

2009-10-15 Thread Charles R Harris
On Thu, Oct 15, 2009 at 10:40 AM, Michael Droettboom wrote: > I recently committed a regression test and bugfix for object pointers in > record arrays of unaligned size (meaning where each record is not a > multiple of sizeof(PyObject **)). > > For example: > >a1 = np.zeros((10,), dtype=[(

[Numpy-discussion] object array alignment issues

2009-10-15 Thread Michael Droettboom
I recently committed a regression test and bugfix for object pointers in record arrays of unaligned size (meaning where each record is not a multiple of sizeof(PyObject **)). For example: a1 = np.zeros((10,), dtype=[('o', 'O'), ('c', 'c')]) a2 = np.zeros((10,), 'S10') #