mcabbott / mcabbott/AxisKeys.jl

Selecting fails with vector

Open
#104 3 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.