I recently noticed an inconvenient issue with the atvalue function, namely that it does not work for negatively iterated ranges/units. Here's an example:
using AxisArrays
using Unitful: mm
AA = AxisArray(reshape(1:11^2, (11, 11)),
Axis{:x}(-5mm:1mm:5mm), # positive
Axis{:y}(5mm:-1mm:-5mm)) # negative
# positive direction
println(AA[x = atvalue(1mm)])
# negative direction
println(AA[y = atvalue(1mm)])
While the instantiation of the AxisArray and the first example in the positive direction (x-axis) work perfectly fine, the latter in the negative direction (y-axis) fails and prints the following error message:
I wonder if there is a simple solution to that problem (am I doing something wrong?) or if this undesired behavior needs to be fixed inside of the package.
Kindly,
EminentCoder
PS: Unitful does not contribute to the error, the problem remains without the units as well.
Dear all,
I recently noticed an inconvenient issue with the
atvalue
function, namely that it does not work for negatively iterated ranges/units. Here's an example:While the instantiation of the
AxisArray
and the first example in the positive direction (x-axis) work perfectly fine, the latter in the negative direction (y-axis) fails and prints the following error message:I wonder if there is a simple solution to that problem (am I doing something wrong?) or if this undesired behavior needs to be fixed inside of the package.
Kindly, EminentCoder
PS: Unitful does not contribute to the error, the problem remains without the units as well.