SciML / SciML/ComponentArrays.jl
Extend KeepIndex to Vector indices
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 375
- Forks
- 42
- Avg merge
- 7h 25m
- Merged PRs (30d)
- 17
Description
Using an example from the documentation:
julia> ca = ComponentArray(a=5, b=[4, 1], c=(a=2, b=[6, 30]))
ComponentVector{Int64}(a = 5, b = [4, 1], c = (a = 2, b = [6, 30]))
julia> ca[KeepIndex(:b)]
ComponentVector{Int64}(b = [4, 1])
julia> ca[KeepIndex(1)]
ComponentVector{Int64}(a = 5)
julia> ca[KeepIndex(2:3)]
ComponentVector{Int64}(b = [4, 1])
julia> ca[KeepIndex([2,3])]
ERROR: TypeError: in Type, in parameter, expected Type, got a value of type Vector{Int64}
How hard would it be to extend the KeepIndex functionality to more general types of indices?
Contributor guide
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 reading the KeepIndex implementation and the documentation example shown in this issue. Reproduce the KeepIndex([2, 3]) failure, then determine which general index types should be supported and how success should be verified without the current TypeError.
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
- Needs clarification
- Newbie friendliness
- 30/100