Subtype ArrayPartition and NamedArrayPartition
We want to use a NamedArrayPartition as our u0 in a problem to replace a DEDataArray which we used (for not much good reason) and NamedArrayPartitions have the functionality we really want. However we need to be able to multiple dispatch on the 'type' of u0 we build (aka the fields we have assigned) and therefore want to use NamedArrayPartition as a supertype to subtype from. Something like the below:
mutable struct test_struct <: NamedArrayPartition
x :: Vector{Real}
y :: Matrix{Real}
z :: AnyothersupportedtypebyNamedArrayPartition
end
It's not clear how this would work, since the interface only expects x and x should be a tuple. We can write up what the AbstractArrayPartition interface should be but this type doesn't seem like it would match it.
I could possibly change the need so that it has one field instead of 3 but our main need is the NamedTuple type character of NamedArrayPartitions, in a type that is both multiple dispatchable and usable as an initial condition of an ODEProblem. I don't think NamedTuple's or similar work
Step one would be to do a code overhaul to make a bunch of functions that use an abstract type. Right now it wouldn't do much because all of the dispatches are on the concrete types.
I could try to make a new type similar to ArrayPartitions, and somewhat copy the code and then if it works provide it as a pull request directly into RecursiveArrayTools if that is considered acceptable by yourselves.
yes
I have a fork with the corrections to the ArrayInterface.zeromatrix within it as well as a new type structure for NamedArrayPartitions which adds an abstract type to allow for subtyping with the same structure as NamedArrayPartition. I was wondering if I could create a pull request for this onto here so someone can review the changes but I can't create a branch here to do so.
If you create a pull request from your fork then it can be reviewed?