Closed ivirshup closed 9 months ago
Hey good to hear from you, and you too! (In Denmark these days, almost forgotten about the pandemic now)
Sorry about that it's an unintentional change, so a bug. Maybe there is no test for it.
Now that I'm running your example... I think it was maybe a bug before? With most other operations the doubled dimension is just accessed by order.
This works:
A[X(3:5), X(3:5)]
And is maybe better? but it's up for debate. I think these behaviors are the result of lower level generalisation in sortdims
or some other primitive method.
using DimensionalData
A = rand(1:100, X(5), X(5))
Just using the same dimension twice works, I think its better for that to be explicit anyway:
julia> A[X(3:5), X(3:5)]
3×3 DimArray{Int64,2} with dimensions: X, X
57 60 26
44 95 54
8 53 39
When indexing into an array with repeated dimension names, only the first dimension is indexed. E.g.
In a previous version, this would have indexed both
X
dimensions, see: https://github.com/rafaqz/DimensionalData.jl/issues/46#issue-557264711. This is the behavior I would have expected when order of indexing statements doesn't matter.Is this change intentional?
(also hey, hope your pandemic went alright Raf!)