Closed bnlawrence closed 6 months ago
I think the new unit test should ensure that some chunks are all zeros ... but some are not ... and we get the right answer for version 1 and 2 ... and that it does raise this error with the current code.
np.ma.count(tmp)
could be the answer.
There are three issues in play here:
reduce_chunk
and reduce_opens3_chunk
I think your suggestion will address the second ...
Your write right,. I should have said if tmp.size:
could be the answer! (I hadn't realized that the tmp is np.ma.compressed).
A small put important change pointed out by @bnlawrence that should have made it int the original PR: #197
closed via #197 - very good catch and fix, gents :beer:
An attempt to do some work on small chunks using PyActiveStorage version 1 raises a ValueError if the values of the array in the chunk is all zeros.
Tracking this down I find the bug occurring here:
because although in this case the
method
issum
, the check ontmp.any()
is returningFalse
because tmp is all zeros, and so we get execution going through the line with#wrong thing returned
. I think this test usingtmp.any
is not doing what the author intended. We need another solution.