SciML / SciML/ComponentArrays.jl
FR: View sub-arrays as Complex with Real underlying array
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 375
- Forks
- 42
- Avg merge
- 7h 25m
- Merged PRs (30d)
- 17
Description
It would be nice to be able to include complex variables/arrays in a ComponentArray that still behaves as an array of Reals. This is necessary when some other components are real, or for use in solvers that only take Real arrays.
This would look something like:
julia> arr = ComponentArray(a = 0, b = ComplexView([ 1+ 2im, 3 + 4im ]));
julia> collect(arr)
[ 0, 1, 2, 3, 4 ]
julia> arr.b[1]
1 + 2im
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 with ComponentArray and the proposed ComplexView behavior shown in the examples. Check how ComponentArray currently handles nested arrays and how Julia array views represent complex values. Done means supporting the demonstrated construction, collecting the underlying real values, and preserving complex indexing through arr.b.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100