mcabbott / mcabbott/AxisKeys.jl
`getindex(::KeyedVector, ::Colon, ::Colon)` is broken
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 154
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the wrapdims(rand(5); obs=1:5)[:, :] example and read the getindex(::KeyedArray, ...) entry point in AxisKeys, alongside the NamedDims stack frames. Done means indexing a one-dimensional keyed array with two colons no longer raises the shown BoundsError and behaves like the plain Julia array example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100