You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> A =rand(5,5,5);
julia> S =Slices(A, True(), False(), False());
julia>size(S)
(5, 5)
julia>for s in S
@showsize(s)
end
ERROR: ArgumentError: tuple must be non-empty
Stacktrace:
[1] first(::Tuple{}) at ./tuple.jl:77
[2] setindex(::Tuple{Base.OneTo{Int64}}, ::Tuple{}, ::Tuple{True}) at /home/tim/.julia/packages/JuliennedArrays/t66eT/src/JuliennedArrays.jl:39
[3] setindex(::Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}, ::Tuple{CartesianIndex{2}}, ::Tuple{True,True}) at /home/tim/.julia/packages/JuliennedArrays/t66eT/src/JuliennedArrays.jl:43 (repeats 2 times)
[4] getindex at /home/tim/.julia/packages/JuliennedArrays/t66eT/src/JuliennedArrays.jl:58 [inlined]
[5] iterate at ./abstractarray.jl:860 [inlined]
[6] iterate(::Slices{SubArray{Float64,1,Array{Float64,3},Tuple{Base.OneTo{Int64},Int64,Int64},true},2,Array{Float64,3},Tuple{True,False,False}}) at ./abstractarray.jl:858
[7] top-level scope at ./none:0
These kinds of things could be caught in real tests 😉.
The text was updated successfully, but these errors were encountered:
Never mind, index::Int... seems to do the trick. Fixed on master.
This would incorrectly capture Linear Indexing getindex(S, 1) and some weird indexinggetindex(S, 1, 2, 3, 4, 5). Because Align/Slices internally uses the cartesian index to calculate where to insert the dimensions, we need to use the fallback version of getindex for linear indexing cases.
These kinds of things could be caught in real tests 😉.
The text was updated successfully, but these errors were encountered: