numpy/numpy — pull request #3153 by seberg (2013-03-17 16:03:48+00:00)
Title: BUG: Do not reuse nditer buffers when not filled enough.

This checks if the previous time around, the buffers were filled
with as much data as they would be filled this time around. Since
This is difficult for the initial loop before reusing is activated
because in that case the buffer may be larger then just the
first outer reduce dimension. In that case do not allow reuse
unless the index along that dimension was 0.
When the inner reduce index is not 0, then also the reusing of
the buffer is dangerous.

--

The test is pretty slow since it is a big scan of through parameters (but with the slow decorator a few seconds should be OK I think), and I bet only a small fraction is necessary, etc., but I am a bit tired to try and think of how to best reduce it, so if anyone feels like it, please go ahead, but it seems like an important thing to fix overall.