Skip to content

Commit

Permalink
Revert minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
frcroth committed Feb 3, 2023
1 parent 0470031 commit f7d9f75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DatasetArray(relativePath: DatasetPath,
offsetInChunk = computeOffsetInChunk(chunkIndex, offset)
sourceChunkInCOrder: MultiArray = MultiArrayUtils.axisOrderXYZView(sourceChunk,
axisOrder,
header.order != ArrayOrder.C)
flip = header.order != ArrayOrder.C)
_ = MultiArrayUtils.copyRange(offsetInChunk, sourceChunkInCOrder, targetInCOrder)
} yield ()
}
Expand Down Expand Up @@ -119,7 +119,7 @@ class DatasetArray(relativePath: DatasetPath,
private def isZeroOffset(offset: Array[Int]): Boolean =
util.Arrays.equals(offset, new Array[Int](offset.length))

protected def computeOffsetInChunk(chunkIndex: Array[Int], globalOffset: Array[Int]): Array[Int] =
private def computeOffsetInChunk(chunkIndex: Array[Int], globalOffset: Array[Int]): Array[Int] =
chunkIndex.indices.map { dim =>
globalOffset(dim) - (chunkIndex(dim) * axisOrder.permuteIndicesReverse(header.chunkSize)(dim))
}.toArray
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ object MultiArrayUtils {
*/
@throws[InvalidRangeException]
def copyRange(offset: Array[Int], source: MultiArray, target: MultiArray): Unit = {
// At this point offset is XYZ, source should be XYZ (but for precomputed it is XZY)

val sourceShape: Array[Int] = source.getShape
val targetShape: Array[Int] = target.getShape
val sourceRanges = new util.ArrayList[Range]
Expand Down Expand Up @@ -130,7 +128,6 @@ object MultiArrayUtils {
* For all cases we could test, the two are identical. Beware of this when debugging future datasets,
* e.g. with axis order ZXY
*/

val permutation = axisOrder.permutation(source.getRank)
val flippedIfNeeded = if (flip) permutation.reverse else permutation
source.permute(flippedIfNeeded)
Expand Down

0 comments on commit f7d9f75

Please sign in to comment.