AxisKeys.jl icon indicating copy to clipboard operation
AxisKeys.jl copied to clipboard

`getindex(::KeyedVector, ::Colon, ::Colon)` is broken

Open mzgubic opened this issue 3 years ago • 0 comments

Compare

julia> rand(5)[:, :]
5×1 Matrix{Float64}:
 0.9821831290750086
 0.3574801822912895
 0.36794326869601435
 0.39263359417430765
 0.45195237298701174

julia> wrapdims(rand(5); obs=1:5)[:, :]
ERROR: BoundsError: attempt to access Tuple{Symbol} at index [2]
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/NamedDims/f4IvC/src/name_core.jl:0 [inlined]
 [2] remaining_dimnames_from_indexing(dimnames::Tuple{Symbol}, inds::Tuple{Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}})
   @ NamedDims ~/.julia/packages/NamedDims/f4IvC/src/name_core.jl:355
 [3] getindex(::NamedDimsArray{(:obs,), Float64, 1, Vector{Float64}}, ::Base.Slice{Base.OneTo{Int64}}, ::Base.Slice{Base.OneTo{Int64}})
   @ NamedDims ~/.julia/packages/NamedDims/f4IvC/src/wrapper_array.jl:160
 [4] getindex(::KeyedArray{Float64, 1, NamedDimsArray{(:obs,), Float64, 1, Vector{Float64}}, Base.RefValue{UnitRange{Int64}}}, ::Function, ::Function)
   @ AxisKeys ~/.julia/packages/AxisKeys/MK99E/src/struct.jl:77
 [5] top-level scope
   @ REPL[57]:1

mzgubic avatar Jul 07 '22 12:07 mzgubic