mcabbott / mcabbott/AxisKeys.jl
Selecting fails with vector
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 154
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
Somehow, behavior for key-based selections differs between ranges and vectors. Selecting with vectors fails when some of the keys are not found:
julia> ka = KeyedArray(rand(3), x=10:12)
julia> ka(x=12:13)
1-dimensional KeyedArray(NamedDimsArray(...)) with keys:
↓ x ∈ 1-element UnitRange{Int64}
And data, 1-element view(::Vector{Float64}, 3:3) with eltype Float64:
(12) 0.8790116535631433
julia> ka(x=[12, 13])
ERROR: ArgumentError: unable to check bounds for indices of type Nothing
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 KeyedArray examples in the issue, comparing selection with x=12:13 against x=[12, 13]. Trace the key-based selection path for vectors and ranges; done means vector selection handles missing keys consistently with range selection without raising the shown bounds error.
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
- Mostly clear
- Newbie friendliness
- 42/100