[Numpy-discussion] [SciPy-Dev] ANN: Scipy 0.15.0 beta 1 release
njs at pobox.com
Tue Nov 25 14:14:46 EST 2014
On Tue, Nov 25, 2014 at 7:07 PM, Sturla Molden <sturla.molden at gmail.com> wrote:
> Nathaniel Smith <njs at pobox.com> wrote:
>> On Tue, Nov 25, 2014 at 12:53 PM, David Cournapeau <cournape at gmail.com> wrote:
>>> Shall we consider https://github.com/scipy/scipy/issues/4168 to be a blocker
>>> (the issue arises on scipy master as well as 0.14.1) ?
>> Do you think there's anything scipy can do about it? It looks like a
>> pure numpy bug to me.
> I think we should assume it is not a bug in NumPy. There is nothing that
> dictates that an ndarray's buffer must be aligned. It can just as well be
> an unaligned view or wrap an external buffer. An ndarray is valud with any
> alignment, but it does not mean it can be used with intent(inout) in f2py.
> Then by deduction if it is not a NumPy bug it must be a SciPy bug, which
> means the bug must be the unprotected use of intent(inout) in the f2py
> wrapper. I would think it is the responsibility of SciPy to ensure that
> whatever is passed with intent(inout) in SciPy is properly aligned.
In general you have a point, but in this case the reason the array is
"unaligned" is that numpy is being overly strict about its definition
of "aligned". In fact, it's so strict that numpy itself doesn't
provide any standard and reliable way to *create* an aligned array by
(I guess scipy could create an overallocated copy and then take a
slice at the right offset, but asking scipy to use such hacks to work
around our bugs is clearly wrong.)
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
More information about the NumPy-Discussion