You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to this package and it may be possible that I am misusing it, but
using ComponentArrays, StaticArrays
a = [zeros(3) for _ in1:5]
ComponentVector((; a)) # works fine
b =zeros(SVector{3}, 5)
ComponentArray((; b)) # errors
Hey all. ComponentArrays re-form your data to a dense array under the hood so unfortunately inputting things like static arrays or sparse arrays wouldn't be very useful (although it would be useful to unpack to those types, which we don't currently do). So that's one issue here. The other is that arrays of arrays as components aren't well supported. This is mostly due to the fact that we wouldn't have any way of handling jagged arrays because the size needs to be encoded in the type domain at the outer level. I'm actually surprised that that first example works. Supporting arrays of same-sized static arrays would make sense, but they're currently unsupported. But I do agree that that error message isn't super helpful.
Right now as a workaround you could always just wrap the inner arrays in some sort of named tuple.
a = [(v=zeros(3),) for _ in1:5]
ComponentVector((; a))
I am new to this package and it may be possible that I am misusing it, but
stacktrace:
versions:
The text was updated successfully, but these errors were encountered: