When using the blockwise iterator, I get the following error on the last iteration's read:
Error: Subarray: Cannot add range to dimension 'soma_dim_0'; Range [2638, 2638] is out of domain bounds [0, 2637]
It turns out we were not handling 0-based coordinates correctly. When creating a new blockwise read, we would start at 0L, but then go up to array$shape()[dimension], which is a 1-indexed value. This needed to be corrected to array$shape()[dimension] - 1L
However, this messed up calculating a dimension for the returning matrix; to get around this, if coords$start == 0L, we increase the length of the coords by 1 (eg. if the coordinates run from [0, 499], then the length should be 500, not 499)
Modified SOMA methods:
SOMASparseNDArray$new(): decrease the end of the coordinate strider by 1
CoordsStrider$length(): if coords$start is 0, increase the length by 1
When using the blockwise iterator, I get the following error on the last iteration's read:
It turns out we were not handling 0-based coordinates correctly. When creating a new blockwise read, we would start at 0L, but then go up to
array$shape()[dimension]
, which is a 1-indexed value. This needed to be corrected toarray$shape()[dimension] - 1L
However, this messed up calculating a dimension for the returning matrix; to get around this, if
coords$start == 0L
, we increase the length of the coords by 1 (eg. if the coordinates run from[0, 499]
, then the length should be 500, not 499)Modified SOMA methods:
SOMASparseNDArray$new()
: decrease the end of the coordinate strider by 1CoordsStrider$length()
: ifcoords$start
is 0, increase the length by 1SC-54350