Skip to content

vcat of ComponentVectors is type-unstable #270

Open
@okartal

Description

The output type of vcat depends on whether the same key is present in multiple vectors and on the number of concatenated vectors.

using ComponentArrays

ca1 = ComponentVector(a=1, b=2, c=3)
ca2 = ComponentVector(d=4)
ca3 = ComponentVector(e=4)
ca = vcat(ca1, ca2) # gives ComponentVector, @report_opt vcat(ca1, ca2) from Jet.jl detects runtime dispatch
ca = vcat(ca1, ca2, ca3) # gives Vector, no runtime dispatch

ca1 = ComponentVector(a=1, b=2, c=3)
ca2 = ComponentVector(c=5, d=4)
ca = vcat(ca1, ca2) # gives Vector, no runtime dispatch
  • ComponentArrays v"0.15.17"
  • Julia v"1.10.5"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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