[Numpy-discussion] potential bug in PyArray_MoveInto and PyArray_CopyInto?

James Bergstra bergstrj at iro.umontreal.ca
Thu Jul 7 16:59:19 EDT 2011


On Thu, Jul 7, 2011 at 1:10 PM, Charles R Harris
<charlesr.harris at gmail.com> wrote:
>
>
> On Thu, Jul 7, 2011 at 11:03 AM, James Bergstra <bergstrj at iro.umontreal.ca>
> wrote:
>>
>> In numpy 1.5.1,  the functions PyArray_MoveInto and PyArray_CopyInto
>> don't appear to treat strides correctly.
>>
>> Evidence:
>> PyNumber_InPlaceAdd(dst, src), and modifies the correct subarray to
>> which dst points.
>>
>> In the same context, PyArray_MoveInto(dst, src) modifies the first two
>> rows of the
>> underlying matrix instead of the first two columns. PyArray_CopyInto
>> does the same.
>>
>> Is there something subtle going on here?
>>
>
> What are the strides/dims in src and dst?
>
> Chuck
>

In dst: strides = (40,8), dims=(5,2)
in src: strides = () dims=()

dst was sliced out of a 5x5 array of doubles.
src is a 0-d array

James
-- 
http://www-etud.iro.umontreal.ca/~bergstrj



More information about the NumPy-Discussion mailing list