-
typeof(plan2) == PLAN2{Univariate,Float64}
and, indeed, there is no functionPLAN2{Univariate,Float64}(a, b)
but onlyPLAN2(a, b)
defined. If you want the type without parameters, you can get it withtypeof(plan2).name.wrapper
, but I would disencourage relying on “internal” fields likename
andwrapper
. I don’t know what the best approach would be here, but one possibility is to define functionsinitialize(model::PLAN1, a, b) = PLAN1(a, b)
andinitialize(model::PLAN2, a, b) = PLAN2(a, b)
. - I suspect that you have a performance decrease. I would benchmark this with
BenchmarkTools
.
By the way, and sorry for raising this when you didn’t ask for it, but I think the outer constructor of PLAN2
can be simplified, e.g. PLAN2(a, b, c = Dict(:∅ => [])) = ...
and it is always worth reading a bit in the Julia style guide, in particular here.