Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcat of ComponentVectors is type-unstable #270

Open
okartal opened this issue Sep 26, 2024 · 0 comments
Open

vcat of ComponentVectors is type-unstable #270

okartal opened this issue Sep 26, 2024 · 0 comments

Comments

@okartal
Copy link

okartal commented Sep 26, 2024

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant