Open jbiffl opened 3 years ago
Thanks. This is definitely not a case I considered, so I'm pushing a reminder to the weekend.
BTW, ComponentArrays.jl is basically a version of of LabelledArrays that can be nested like this. However, it doesn't actually solve the modelingtoolkitize
problem because that's a separate thing. I've had it on my TODO list to make it easier to modelingtoolkitize
ComponentArrays problems and "componentarrayize
" ModelingToolkit problems. The reason the latter is useful is it would let you more easily write callbacks and such for ModelingToolkit models. To be honest, it shouldn't be too hard to convert between the two, I just haven't gotten around to it yet. And I'm not sure where I want it to live (because I have a few other things I'd like to do to make it easier to convert between the two and gets to the point where it seems silly to do that much with Requires
).
Some of LabelledArrays is already specialized. I think we could just add a hook to ComponentArrays here? I think more and more it would be good to just integrate it fully into the SciML ecosystem. define_vars
would just need to be made recursive for ComponentArrays to work well there though.
I'm having the same issues as in this previous issue but with nested labelled vectors with the latest version. The code below gives the same kind of error as the original example by fkrauer, but only when using nested LVectors now that single layer LVectors work.
That code throws this error:
When you inspect p while it is running, you obtain