SciML / SciML/ComponentArrays.jl
vcat of ComponentVectors is type-unstable
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 375
- Forks
- 42
- Avg merge
- 7h 25m
- Merged PRs (30d)
- 17
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"
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 reproducing the three vcat examples with ComponentArrays v0.15.17 on Julia 1.10.5 and inspect their output types and Jet.jl reports. Trace the ComponentVector vcat entry point and compare cases with repeated keys and different numbers of vectors; done means vcat has consistent, type-stable behavior for these cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100