[Numpy-svn] [numpy/numpy] b29d5c: BUG: core: Fix "a[...] += 1" with array scalar 'a'
noreply at github.com
noreply at github.com
Sun Jan 30 16:50:50 EST 2011
Branch: refs/heads/master
Home: https://github.com/numpy/numpy
Commit: b29d5c36e8b0a62956d5e097b5b7ce73351f7bef
https://github.com/numpy/numpy/commit/b29d5c36e8b0a62956d5e097b5b7ce73351f7bef
Author: Mark Wiebe <mwwiebe at gmail.com>
Date: 2011-01-30 (Sun, 30 Jan 2011)
Changed paths:
M numpy/core/src/multiarray/mapping.c
M numpy/core/src/multiarray/number.c
M numpy/core/tests/test_regression.py
Log Message:
-----------
BUG: core: Fix "a[...] += 1" with array scalar 'a'
This was crashing, because it appears Python does this:
1. call the array_subscript to get a[...], then calls inplace add on it
2. call the array_ass_subscript with (a, Ellipsis, a), which for an object
array was setting the single element of a to point to itself, and
caused crashes. This case is now checked, and success is returned
immediately when an array is assigned to itself this way.
Commit: 395146e64101ac65a057214d64135993a4c67d16
https://github.com/numpy/numpy/commit/395146e64101ac65a057214d64135993a4c67d16
Author: Mark Wiebe <mwwiebe at gmail.com>
Date: 2011-01-30 (Sun, 30 Jan 2011)
Changed paths:
M numpy/core/src/multiarray/new_iterator.c.src
M numpy/core/tests/test_new_iterator.py
Log Message:
-----------
BUG: iter: Fix checking of allocated output with op_axes specified
Commit: 4faf10e9246a77bc19c77dc80363d809f5a85396
https://github.com/numpy/numpy/commit/4faf10e9246a77bc19c77dc80363d809f5a85396
Author: Mark Wiebe <mwwiebe at gmail.com>
Date: 2011-01-30 (Sun, 30 Jan 2011)
Changed paths:
M numpy/core/src/multiarray/new_iterator.c.src
M numpy/core/src/umath/ufunc_object.c
M numpy/core/tests/test_new_iterator.py
Log Message:
-----------
ENH: iter: Allow copies of read-only scalar arrays even if COPY isn't specified
When buffering, this reduces the work needed by a lot. For non-reduction
operands, the iterator always provides contiguous data when an operand
is buffered, but by making a copy the operand can be flagged as never
needing buffering
More information about the Numpy-svn
mailing list