Closed sethaxen closed 1 year ago
Could be a bug in Base? - that it mixes Int
and axes. But maybe we just have to handle that.
Seems the Int
s are what the Base.OneTo
axes from the Array
get converted to.
I just checked, and OffsetArrays works:
julia> using OffsetArrays
julia> x = OffsetArray([randn(2) for _ in 1:4, _ in 1:3], 0:3, 0:2)
4×3 OffsetArray(::Matrix{Vector{Float64}}, 0:3, 0:2) with eltype Vector{Float64} with indices 0:3×0:2:
[-1.60527, -0.380328] [0.583878, -0.910585] [-0.525119, 1.61862]
[-0.673478, -0.723257] [1.00405, -1.54902] [1.00349, 0.450481]
[-0.685164, 0.401531] [-0.646748, -0.995447] [0.128681, 0.293356]
[0.243163, -0.243523] [0.287951, 0.407418] [-0.0961986, -1.21144]
julia> stack(x)
2×4×3 OffsetArray(::Array{Float64, 3}, 1:2, 0:3, 0:2) with eltype Float64 with indices 1:2×0:3×0:2:
[:, :, 0] =
-1.60527 -0.673478 -0.685164 0.243163
-0.380328 -0.723257 0.401531 -0.243523
[:, :, 1] =
0.583878 1.00405 -0.646748 0.287951
-0.910585 -1.54902 -0.995447 0.407418
[:, :, 2] =
-0.525119 1.00349 0.128681 -0.0961986
1.61862 0.450481 0.293356 -1.21144
julia> x = [OffsetArray(randn(2), 0:1) for _ in 1:4, _ in 1:3]
4×3 Matrix{OffsetVector{Float64, Vector{Float64}}}:
[-0.607889, -0.603977] [-0.819231, -1.44292] [-0.339097, 1.70372]
[-1.56102, -0.128917] [0.390498, 0.125584] [-1.72841, -1.00742]
[0.0900471, 1.43783] [-0.369288, -0.0750261] [2.33101, 0.160303]
[-0.422105, -0.466955] [-0.113919, -0.73531] [0.88667, -1.49588]
julia> stack(x)
2×4×3 OffsetArray(::Array{Float64, 3}, 0:1, 1:4, 1:3) with eltype Float64 with indices 0:1×1:4×1:3:
[:, :, 1] =
-0.607889 -1.56102 0.0900471 -0.422105
-0.603977 -0.128917 1.43783 -0.466955
[:, :, 2] =
-0.819231 0.390498 -0.369288 -0.113919
-1.44292 0.125584 -0.0750261 -0.73531
[:, :, 3] =
-0.339097 -1.72841 2.33101 0.88667
1.70372 -1.00742 0.160303 -1.49588
But this seems to be one of those cases where it works by fundamentally changing how Base works. e.g. if OffsetArrays is in scope, stack
now "works" for the examples above, but returns an OffsetArray
julia> using DimensionalData
julia> a = [randn(4) for _ in 1:3, _ in 1:2];
julia> da2 = map(x -> DimArray(x, X), a);
julia> stack(da2)
4×3×2 OffsetArray(::Array{Float64, 3}, 1:4, 1:3, 1:2) with eltype Float64 with indices 1:4×1:3×1:2:
[:, :, 1] =
0.879905 0.341284 -0.661324
0.881001 0.811677 0.544223
0.578309 -1.29874 0.759717
-1.26487 -0.168756 0.702541
[:, :, 2] =
-0.606822 -0.801057 -0.857598
-1.58481 -1.07869 0.591615
-1.18106 0.462734 0.843158
0.873367 -0.269853 2.55689
julia> da3 = DimArray(a, (Y, Z));
julia> stack(da3)
4×3×2 OffsetArray(::Array{Float64, 3}, 1:4, 1:3, 1:2) with eltype Float64 with indices 1:4×1:3×1:2:
[:, :, 1] =
0.879905 0.341284 -0.661324
0.881001 0.811677 0.544223
0.578309 -1.29874 0.759717
-1.26487 -0.168756 0.702541
[:, :, 2] =
-0.606822 -0.801057 -0.857598
-1.58481 -1.07869 0.591615
-1.18106 0.462734 0.843158
0.873367 -0.269853 2.55689
Haha I have a grumpy rant over at OffsetArrays.jl about this.
https://github.com/JuliaArrays/OffsetArrays.jl/issues/306
It's really not Ok that loading OffsetArrays.jl anywhere in the session fixes a bug here with Base Julia behavior.
But in this case it seems OffsetArrays.jl does the right thing and Base doesn't?
And we load OffsetArrays.jl in the tests so this bug wont even show up !!!
Haha I have a grumpy rant over at OffsetArrays.jl about this.
Yeah I came across this after hours of trying to debug an issue in DimUnitRange
while writing it. Turns out OffsetArray's type piracy caused the problem.
I found the function that makes OffsetArrays work: https://github.com/JuliaArrays/OffsetArrays.jl/blob/add7611dd3b9afc767f9a1a1816de6cec7a70c00/src/OffsetArrays.jl#L320-L329 . All types in this signature are from Base.
We could make this work for us for the most common cases without piracy by defining the methods:
# works for all cases where the DimArray is the wrapper
Base.similar(A::AbstractArray, ::Type{T}, shape::Tuple{DimUnitRange,Vararg{Union{DimUnitRange,Integer}}}) where T
# works for all cases where a 1-3-dimensional array is the wrapper.
Base.similar(A::AbstractArray, ::Type{T}, shape::Tuple{Integer,DimUnitRange,Vararg{Union{DimUnitRange,Integer}}}) where T
Base.similar(A::AbstractArray, ::Type{T}, shape::Tuple{Integer,Integer,DimUnitRange,Vararg{Union{DimUnitRange,Integer}}}) where T
Base.similar(A::AbstractArray, ::Type{T}, shape::Tuple{Integer,Integer,Integer,DimUnitRange,Vararg{Union{DimUnitRange,Integer}}}) where T
The issue seems to be that similar is not defined for a mixture of Int and DimUnitRange. I'm not certain why stack ends up mixing these two, since the similar docstring documents that you can provide integer sizes or axes.
Notice that stack
isn't mixing up the two. _typed_stack
at abstractarray.jl:2791 is calling similar
with ::DimensionalData.Dimensions.DimUnitRange, ::OneTo, ::OneTo
, which are the inner & outer axes
.
That falls back to method at abstractarray.jl:838 which allows a mixture, added in https://github.com/JuliaLang/julia/pull/27038.
julia> stack(da2)
ERROR: MethodError: no method matching similar(::DimArray{Float64, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}}}, Tuple{}, Vector{Float64}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, ::Type{Float64}, ::Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}}}, Int64, Int64})
...
Stacktrace:
[1] similar(::DimArray{Float64, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}}}, Tuple{}, Vector{Float64}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, ::Type{Float64}, ::DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}}}, ::Base.OneTo{Int64}, ::Base.OneTo{Int64})
@ Base ./abstractarray.jl:838
[2] _typed_stack(::Colon, ::Type{Float64}, ::Type{DimArray{Float64, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}}}, Tuple{}, Vector{Float64}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, A::Matrix{DimArray{Float64, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.NoLookup{Base.OneTo{Int64}}}}, Tuple{}, Vector{Float64}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Aax::Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}})
@ Base ./abstractarray.jl:2791
Yeah, seems like a good fix for now. It may also be worth making an issue in base? thanks for clarifying @mcabbott
That falls back to method at abstractarray.jl:838 which allows a mixture, added in JuliaLang/julia#27038.
From the comment there:
# but we don't want to require all AbstractArray subtypes to dispatch on Base.OneTo. So instead we
# define this method to convert supported axes to Ints, with the expectation that an offset array
# package will define a method with dims::Tuple{Union{Integer, UnitRange}, Vararg{Union{Integer, UnitRange}}}
Defining a method with this signature would be type piracy. Maybe by UnitRange
they mean a type named UnitRange
defined in that package? But still, don't the Union
s here introduce an ambiguity?
That reads as if it's designed for exactly one OffsetArray package.
To allow arbitrary packages to supply weird axes, in any combination, I don't think multiple dispatch can really work. There would need to be some disambiguation mechanism, perhaps peeling them off one-by-one like to_indices
does.
To just allow this package & Base, I don't think you should overload similar
with a mix of integers and ranges, but rather catch it earlier at OneTo. Something like:
Base.similar(A::AbstractArray, ::Type{T}, shape::Tuple{OneTo,DimUnitRange, ...}) = ...
Base.similar(A::AbstractArray, ::Type{T}, shape::Tuple{DimUnitRange, OneTo, ...}) = ...
Base.similar(A::AbstractArray, ::Type{T}, shape::Tuple{DimUnitRange,DimUnitRange, ...}) = ...
Thanks @mcabbott for the input! I opened an issue on Base Julia: https://github.com/JuliaLang/julia/issues/48736
Here's another example on v1.9 where stack
fails at this method:
julia> da = DimArray(randn(5, 2, 10), (X(1:5), Y(1:2), Z(1:10)))
5×2×10 DimArray{Float64,3} with dimensions:
X Sampled{Int64} 1:5 ForwardOrdered Regular Points,
Y Sampled{Int64} 1:2 ForwardOrdered Regular Points,
Z Sampled{Int64} 1:10 ForwardOrdered Regular Points
[:, :, 1]
1 2
1 -0.102949 -2.11069
2 1.79828 0.146289
3 -0.327256 -0.426165
4 -0.712312 0.524461
5 0.370998 -1.08046
[and 9 more slices...]
julia> slices = eachslice(da; dims=X)
5-element Slices{DimArray{Float64, 3, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Array{Float64, 3}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, Tuple{Int64, Colon, Colon}, Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1} with indices DimensionalData.Dimensions.DimUnitRange(Base.OneTo(5), X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}([1, 2, 3, 4, 5])):
[-0.10294865417938587 0.5698825736323255 … -1.5378023712827968 1.0307246759708226; -2.110688097558331 0.0011790991422298577 … -0.6593841156030812 -0.11688915410161158]
[1.7982779792641022 0.13907155933046084 … -0.07504633767741557 -0.25039500080737614; 0.14628901474635184 0.9524727566035762 … -0.19643334603411086 -0.009078044117570114]
[-0.3272564704019956 -0.575908906586761 … -0.050182744578040304 -0.22420385548518917; -0.42616544757027924 0.8776995896758558 … -0.8566502141518096 1.4463988149826326]
[-0.7123122057852254 0.20799454493477493 … 0.8374795127610608 -1.3053013623918044; 0.5244605108649851 -0.49963337952532505 … -0.2164155911041088 -0.23920201930054835]
[0.3709978605647305 -2.1742176908724895 … 0.019797323120978306 0.8758089159274857; -1.0804569058541924 -0.44105352240311374 … 0.18673505188968414 -0.6334841199845449]
julia> da_slices = rebuild(da; data=slices, dims=dims(axes(slices)))
5-element DimArray{DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata},1} with dimensions:
X Sampled{Int64} 1:5 ForwardOrdered Regular Points
1 [-0.102949 0.569883 … -1.5378 1.03072; -2.11069 0.0011791 … -0.659384 -0.116889]
2 [1.79828 0.139072 … -0.0750463 -0.250395; 0.146289 0.952473 … -0.196433 -0.00907804]
3 [-0.327256 -0.575909 … -0.0501827 -0.224204; -0.426165 0.8777 … -0.85665 1.4464]
4 [-0.712312 0.207995 … 0.83748 -1.3053; 0.524461 -0.499633 … -0.216416 -0.239202]
5 [0.370998 -2.17422 … 0.0197973 0.875809; -1.08046 -0.441054 … 0.186735 -0.633484]
julia> stack(slices)
2×10×5 DimArray{Float64,3} with dimensions:
Y Sampled{Int64} 1:2 ForwardOrdered Regular Points,
Z Sampled{Int64} 1:10 ForwardOrdered Regular Points,
X Sampled{Int64} 1:5 ForwardOrdered Regular Points
[:, :, 1]
1 2 3 4 5 … 7 8 9 10
1 -0.102949 0.569883 0.355713 0.75725 -0.851722 -1.38102 0.0402863 -1.5378 1.03072
2 -2.11069 0.0011791 1.26613 0.396935 2.40101 -0.42801 0.355688 -0.659384 -0.116889
[and 4 more slices...]
julia> stack(da_slices)
ERROR: MethodError: no method matching similar(::SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, ::Type{Float64}, ::Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}, DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}})
Closest candidates are:
similar(::SubArray, ::Type, ::Tuple{Vararg{Int64, N}} where N)
@ Base subarray.jl:65
similar(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{N}}, ::Type{ElType}, ::Any) where {N, ElType}
@ Base broadcast.jl:212
similar(::Base.Broadcast.Broadcasted{Base.Broadcast.ArrayConflict}, ::Type{ElType}, ::Any) where ElType
@ Base broadcast.jl:217
...
Stacktrace:
[1] similar(A::DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, T::Type, shape::Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, DimensionalData.Dimensions.DimUnitRange{Int64, DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}})
@ DimensionalData ~/.julia/packages/DimensionalData/bJAtd/src/array/array.jl:132
[2] similar(::DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, ::Type{Float64}, ::DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, ::DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, ::DimensionalData.Dimensions.DimUnitRange{Int64, DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}})
@ Base ./abstractarray.jl:838
[3] _typed_stack(::Colon, ::Type{Float64}, ::Type{DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, A::DimArray{DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Slices{DimArray{Float64, 3, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Array{Float64, 3}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, Tuple{Int64, Colon, Colon}, Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, Aax::Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}})
@ Base ./abstractarray.jl:2791
[4] _typed_stack(::Colon, ::Type{Float64}, ::Type{DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, A::DimArray{DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Slices{DimArray{Float64, 3, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Array{Float64, 3}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, Tuple{Int64, Colon, Colon}, Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata})
@ Base ./abstractarray.jl:2787
[5] _stack(dims::Function, #unused#::Base.HasShape{1}, iter::DimArray{DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Slices{DimArray{Float64, 3, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Array{Float64, 3}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, Tuple{Int64, Colon, Colon}, Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata})
@ Base ./abstractarray.jl:2777
[6] _stack(dims::Colon, iter::DimArray{DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Slices{DimArray{Float64, 3, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Array{Float64, 3}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, Tuple{Int64, Colon, Colon}, Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata})
@ Base ./abstractarray.jl:2769
[7] stack(iter::DimArray{DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Slices{DimArray{Float64, 3, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Array{Float64, 3}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, Tuple{Int64, Colon, Colon}, Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}; dims::Function)
@ Base ./abstractarray.jl:2737
[8] stack(iter::DimArray{DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Slices{DimArray{Float64, 3, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{}, Array{Float64, 3}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, Tuple{Int64, Colon, Colon}, Tuple{DimensionalData.Dimensions.DimUnitRange{Int64, Base.OneTo{Int64}, X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}}, DimArray{Float64, 2, Tuple{Y{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}, Z{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, Tuple{X{DimensionalData.Dimensions.LookupArrays.Sampled{Int64, UnitRange{Int64}, DimensionalData.Dimensions.LookupArrays.ForwardOrdered, DimensionalData.Dimensions.LookupArrays.Regular{Int64}, DimensionalData.Dimensions.LookupArrays.Points, DimensionalData.Dimensions.LookupArrays.NoMetadata}}}, SubArray{Float64, 2, Array{Float64, 3}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}}, true}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata}, 1}, DimensionalData.NoName, DimensionalData.Dimensions.LookupArrays.NoMetadata})
@ Base ./abstractarray.jl:2737
[9] top-level scope
@ REPL[38]:1
In this case, the error is caused by nested DimUnitRange
s in the outer DimArray
but not the inner:
julia> axes(da_slices[1]) isa Tuple{Vararg{Dimensions.DimUnitRange{Int,Base.OneTo{Int}}}}
true
julia> axes(da_slices) isa Tuple{Vararg{Dimensions.DimUnitRange{Int,<:Dimensions.DimUnitRange{Int}}}}
true
So when we hit this line, the un-nested DimUnitRange
s get converted to Base.OneTo
, and the rest stay DimUnitRange
.
https://github.com/rafaqz/DimensionalData.jl/blob/8cd137f9e3fc65abe2aca7dc82a277b0a06b9575/src/array/array.jl#L138
Perhaps this should be solved again by a similar
method that dispatches on Union{DimUnitRange,Base.OneTo}
, but I wonder if this issue of nested DimUnitRange
s should be handled elsewhere instead.
Julia v1.9 introduces
Base.stack
(also available in Compat.jl). This can be used to flatten arrays of arrays via stacking and already works when aDimArray
contains allDimArray
s:However, if we have a
DimArray
of non-dimensional arrays or a non-dimensional array ofDimArray
s, then instead of falling back to stacking a non-dimensional array, an error is thrown:The issue seems to be that
similar
is not defined for a mixture ofInt
andDimUnitRange
. I'm not certain whystack
ends up mixing these two, since thesimilar
docstring documents that you can provide integer sizes or axes.