Skip to content

Extend KeepIndex to Vector indices #243

@qua4tre

Description

@qua4tre

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions