JuliaArrays / JuliaArrays/ArrayViews.jl
getindex with UnitRange
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 20
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
x = reshape(1:25, 5, 5)
v = view(x, 1:2:5, 1:2:5)
v[:,1]
produces
ERROR: `getindex` has no method matching getindex(::StridedView{Int64,2,0,Array{Int64,2}}, ::UnitRange{Int64}, ::Int64)
Selecting by range is very common and I believe should be supported. Is there a reason why it is not?
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 Julia example in the issue: reshape a 5×5 range, create the view with 1:2:5 indices, and evaluate v[:,1]. Trace the getindex methods for StridedView and UnitRange; done means the shown range selection works without the reported method error, with coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100