[Numpy-discussion] Numpy 1.9.1, zeros and alignement

2014-11-18 Thread David Cournapeau
Hi, I have not followed closely the changes that happen in 1.9.1, but was surprised by the following: x = np.zeros(12, d) assert x.flags.aligned # fails This is running numpy 1.9.1 built on windows with VS 2008. Is it expected that zeros may return a non-aligned array ? David

Re: [Numpy-discussion] Numpy 1.9.1, zeros and alignement

2014-11-18 Thread Charles R Harris
On Tue, Nov 18, 2014 at 11:20 AM, David Cournapeau courn...@gmail.com wrote: Hi, I have not followed closely the changes that happen in 1.9.1, but was surprised by the following: x = np.zeros(12, d) assert x.flags.aligned # fails This is running numpy 1.9.1 built on windows with VS 2008.

Re: [Numpy-discussion] Numpy 1.9.1, zeros and alignement

2014-11-18 Thread Julian Taylor
On 18.11.2014 19:20, David Cournapeau wrote: Hi, I have not followed closely the changes that happen in 1.9.1, but was surprised by the following: x = np.zeros(12, d) assert x.flags.aligned # fails This is running numpy 1.9.1 built on windows with VS 2008. Is it expected that zeros

Re: [Numpy-discussion] Numpy 1.9.1, zeros and alignement

2014-11-18 Thread David Cournapeau
It is on windows 32 bits, but I would need to make this work for complex (pair of double) as well. Is this a bug (I assumed array creation methods would always create aligned arrays for their type) ? Seems like quite a bit of code out there would assume this (scipy itself does for example).

Re: [Numpy-discussion] Numpy 1.9.1, zeros and alignement

2014-11-18 Thread David Cournapeau
Additional point: it seems to always return aligned data on 1.8.1 (same platform/compiler/everything). On Tue, Nov 18, 2014 at 6:35 PM, David Cournapeau courn...@gmail.com wrote: It is on windows 32 bits, but I would need to make this work for complex (pair of double) as well. Is this a bug

Re: [Numpy-discussion] Numpy 1.9.1, zeros and alignement

2014-11-18 Thread Julian Taylor
1.9 lies about alignment it doesn't actually check for new arrays. is the array aligned? On 18.11.2014 19:37, David Cournapeau wrote: Additional point: it seems to always return aligned data on 1.8.1 (same platform/compiler/everything). On Tue, Nov 18, 2014 at 6:35 PM, David Cournapeau

Re: [Numpy-discussion] Numpy 1.9.1, zeros and alignement

2014-11-18 Thread David Cournapeau
On Tue, Nov 18, 2014 at 6:40 PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: 1.9 lies about alignment it doesn't actually check for new arrays. When I do the following on 1.8.1 with win 32 bits: x = np.zeros(12, D) print x.aligned.flags == (x.__array_interface__[data][0] % 16 == 0)

Re: [Numpy-discussion] Numpy 1.9.1, zeros and alignement

2014-11-18 Thread Julian Taylor
32 bit windows should not provide 16 byte alignment, at least it doesn't for me. That is typically a property of 64 bit OS. But that does not explain why normal double is not aligned for you, that only needs 4 bytes on i386 which even 32 bit OS should provide. I though I tested scipy on 32 bit

Re: [Numpy-discussion] Numpy 1.9.1, zeros and alignement

2014-11-18 Thread Pauli Virtanen
18.11.2014, 21:44, David Cournapeau kirjoitti: On Tue, Nov 18, 2014 at 7:05 PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: 32 bit windows should not provide 16 byte alignment, at least it doesn't for me. That is typically a property of 64 bit OS. But that does not explain why