SciML / SciML/ComponentArrays.jl
Get rid of `ComponentMatrix` and higher-order `ComponentArray`s?
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 375
- Forks
- 42
- Avg merge
- 7h 25m
- Merged PRs (30d)
- 17
Description
This is a very disruptive proposition, I know, but hear me out. The reason I'm suggesting it is because higher-order ComponentArrays are
- still a bit buggy
- not widely used
- keeping
Basefrom doing its job
Still a bit buggy
For as long as I can remember, the doc has stated:
Higher dimensional ComponentArrays can be created too, but it's a little messy at the moment.
Indeed, ComponentMatrix gives rise to a number of issues like
Indexing
- https://github.com/jonniedie/ComponentArrays.jl/issues/257
- https://github.com/jonniedie/ComponentArrays.jl/issues/248
- https://github.com/jonniedie/ComponentArrays.jl/pull/249
Concatenation
- https://github.com/jonniedie/ComponentArrays.jl/issues/254
- https://github.com/jonniedie/ComponentArrays.jl/issues/168
- https://github.com/jonniedie/ComponentArrays.jl/issues/113
- https://github.com/jonniedie/ComponentArrays.jl/pull/169
Linear algebra operations
- https://github.com/jonniedie/ComponentArrays.jl/issues/187#issuecomment-1426937580
- https://github.com/jonniedie/ComponentArrays.jl/issues/128#issuecomment-1138059402
- https://github.com/jonniedie/ComponentArrays.jl/pull/233
- https://github.com/jonniedie/ComponentArrays.jl/pull/170
Basically, as soon as we touch matrices, the number of necessary overloads grows out of control, and no one has time to play whack-a-mole.
Not widely used
If we take a look at the search
https://github.com/search?q=language%3AJulia+ComponentMatrix&type=code
and exclude forks, we find exactly 4 repos where ComponentMatrix is used:
- MuseInference.jl by @marius311: one linalg overload
- MacroModeling.jl by @thorek1: one commented line
- Flight.jl by @e271828e: seems like a legitimate use
- MTKHelpers.jl by @bgctw: not sure what this does exactly but it has type piracy
In addition, @vpuri3 and @dingraha have recently submitted PRs related to ComponentMatrix, so perhaps they use it too.
Keeping Base from doing its job
In several of the bugs outlined above, @mcabbott and I think that just removing the higher-order ComponentArrays would allow functions from Base (like stack or hcat) to take over and do the right thing. But that is still an untested hypothesis.
Upsides of ComponentMatrix
On the other hand it is true that this format has good things going for it. Most notably, the ability to index block by block, as demonstrated in the ODE example
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
No source file or test is named. Start by reviewing the linked indexing, concatenation, and linear-algebra issues and pull requests, then inspect the four reported external uses of ComponentMatrix. Done would require an agreed direction and a coordinated resolution of compatibility, usage, and Base-behavior questions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100