-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
- FR: Preserve CA-ness when indexing component matrix with shaped components #257
- Indexing
ComponentMatrixwithFlatAxiscomponents #248 - Mat index bug #249
Concatenation
- ComponentVectors are not stack-able #254
- hcat: type unstable based on the number of arguments #168
- Need
reduce(hcat, ...method #113 - Fix *cat inconsistencies #169
Linear algebra operations
- Reexport
invanddiagetc fromLinearAlgebra? #187 (comment) - Component Arrays with DAE's #128 (comment)
- [wip] Fix LinearAlgebra.lmul! on GPU #233
- Change Adjoints to be ComponentArrays #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