From d363171c98346d95da58b37e7bb7a295f6388f80 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 24 Feb 2024 13:05:41 -0500 Subject: [PATCH 1/6] Auto stash before checking out "origin/master" --- src/scimlfunctions.jl | 88 ++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 38 deletions(-) diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index a5e9b3c3c..a495e9dff 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -402,7 +402,7 @@ numerically-defined functions. """ struct ODEFunction{iip, specialize, F, TMM, Ta, Tt, TJ, JVP, VJP, JP, SP, TW, TWt, WP, TPJ, O, TCV, - SYS} <: AbstractODEFunction{iip} + SYS, IProb, IProbMap} <: AbstractODEFunction{iip} f::F mass_matrix::TMM analytic::Ta @@ -419,6 +419,8 @@ struct ODEFunction{iip, specialize, F, TMM, Ta, Tt, TJ, JVP, VJP, JP, SP, TW, TW observed::O colorvec::TCV sys::SYS + initializeprob::IProb + initializeprobmap::IProbMap end TruncatedStacktraces.@truncate_stacktrace ODEFunction 1 2 @@ -2254,30 +2256,33 @@ end ######### Basic Constructor function ODEFunction{iip, specialize}(f; - mass_matrix = __has_mass_matrix(f) ? f.mass_matrix : - I, - analytic = __has_analytic(f) ? f.analytic : nothing, - tgrad = __has_tgrad(f) ? f.tgrad : nothing, - jac = __has_jac(f) ? f.jac : nothing, - jvp = __has_jvp(f) ? f.jvp : nothing, - vjp = __has_vjp(f) ? f.vjp : nothing, - jac_prototype = __has_jac_prototype(f) ? - f.jac_prototype : - nothing, - sparsity = __has_sparsity(f) ? f.sparsity : - jac_prototype, - Wfact = __has_Wfact(f) ? f.Wfact : nothing, - Wfact_t = __has_Wfact_t(f) ? f.Wfact_t : nothing, - W_prototype = __has_W_prototype(f) ? f.W_prototype : nothing, - paramjac = __has_paramjac(f) ? f.paramjac : nothing, - syms = nothing, - indepsym = nothing, - paramsyms = nothing, - observed = __has_observed(f) ? f.observed : - DEFAULT_OBSERVED, - colorvec = __has_colorvec(f) ? f.colorvec : nothing, - sys = __has_sys(f) ? f.sys : nothing) where {iip, - specialize + mass_matrix = __has_mass_matrix(f) ? f.mass_matrix : + I, + analytic = __has_analytic(f) ? f.analytic : nothing, + tgrad = __has_tgrad(f) ? f.tgrad : nothing, + jac = __has_jac(f) ? f.jac : nothing, + jvp = __has_jvp(f) ? f.jvp : nothing, + vjp = __has_vjp(f) ? f.vjp : nothing, + jac_prototype = __has_jac_prototype(f) ? + f.jac_prototype : + nothing, + sparsity = __has_sparsity(f) ? f.sparsity : + jac_prototype, + Wfact = __has_Wfact(f) ? f.Wfact : nothing, + Wfact_t = __has_Wfact_t(f) ? f.Wfact_t : nothing, + W_prototype = __has_W_prototype(f) ? f.W_prototype : nothing, + paramjac = __has_paramjac(f) ? f.paramjac : nothing, + syms = nothing, + indepsym = nothing, + paramsyms = nothing, + observed = __has_observed(f) ? f.observed : + DEFAULT_OBSERVED, + colorvec = __has_colorvec(f) ? f.colorvec : nothing, + sys = __has_sys(f) ? f.sys : nothing, + initializeprob = nothing, + initializeprobmap = nothing + ) where {iip, + specialize, } if mass_matrix === I && f isa Tuple mass_matrix = ((I for i in 1:length(f))...,) @@ -2321,7 +2326,10 @@ function ODEFunction{iip, specialize}(f; _f = prepare_function(f) - sys = sys_or_symbolcache(sys, syms, paramsyms, indepsym) + sys = something(sys, SymbolCache(syms, paramsyms, indepsym)) + + @assert typeof(initializeprob) <: Union{NonlinearProblem, NonlinearLeastSquaresProblem} + if specialize === NoSpecialize ODEFunction{iip, specialize, Any, Any, Any, Any, @@ -2329,10 +2337,10 @@ function ODEFunction{iip, specialize}(f; typeof(sparsity), Any, Any, typeof(W_prototype), Any, Any, typeof(_colorvec), - typeof(sys)}(_f, mass_matrix, analytic, tgrad, jac, + typeof(sys), Any, Any}(_f, mass_matrix, analytic, tgrad, jac, jvp, vjp, jac_prototype, sparsity, Wfact, Wfact_t, W_prototype, paramjac, - observed, _colorvec, sys) + observed, _colorvec, sys, initializeprob, initializeprobmap) elseif specialize === false ODEFunction{iip, FunctionWrapperSpecialize, typeof(_f), typeof(mass_matrix), typeof(analytic), typeof(tgrad), @@ -2341,10 +2349,11 @@ function ODEFunction{iip, specialize}(f; typeof(paramjac), typeof(observed), typeof(_colorvec), - typeof(sys)}(_f, mass_matrix, analytic, tgrad, jac, + typeof(sys), typeof(initializeprob), + typeof(initializeprobmap)}(_f, mass_matrix, analytic, tgrad, jac, jvp, vjp, jac_prototype, sparsity, Wfact, - Wfact_t, W_prototype, paramjac, - observed, _colorvec, sys) + Wfact_t, W_prototype, paramjac, + observed, _colorvec, sys, initializeprob, initializeprobmap) else ODEFunction{iip, specialize, typeof(_f), typeof(mass_matrix), typeof(analytic), typeof(tgrad), @@ -2353,10 +2362,11 @@ function ODEFunction{iip, specialize}(f; typeof(paramjac), typeof(observed), typeof(_colorvec), - typeof(sys)}(_f, mass_matrix, analytic, tgrad, jac, + typeof(sys), typeof(initializeprob), + typeof(initializeprobmap)}(_f, mass_matrix, analytic, tgrad, jac, jvp, vjp, jac_prototype, sparsity, Wfact, - Wfact_t, W_prototype, paramjac, - observed, _colorvec, sys) + Wfact_t, W_prototype, paramjac, + observed, _colorvec, sys, initializeprob, initializeprobmap) end end @@ -2373,10 +2383,10 @@ function unwrapped_f(f::ODEFunction, newf = unwrapped_f(f.f)) Any, Any, Any, Any, typeof(f.jac_prototype), typeof(f.sparsity), Any, Any, Any, Any, typeof(f.colorvec), - typeof(f.sys)}(newf, f.mass_matrix, f.analytic, f.tgrad, f.jac, + typeof(f.sys), Any, Any}(newf, f.mass_matrix, f.analytic, f.tgrad, f.jac, f.jvp, f.vjp, f.jac_prototype, f.sparsity, f.Wfact, f.Wfact_t, f.W_prototype, f.paramjac, - f.observed, f.colorvec, f.sys) + f.observed, f.colorvec, f.sys, f.initializeprob, f.initializeprobmap) else ODEFunction{isinplace(f), specialization(f), typeof(newf), typeof(f.mass_matrix), typeof(f.analytic), typeof(f.tgrad), @@ -2384,10 +2394,12 @@ function unwrapped_f(f::ODEFunction, newf = unwrapped_f(f.f)) typeof(f.sparsity), typeof(f.Wfact), typeof(f.Wfact_t), typeof(f.W_prototype), typeof(f.paramjac), typeof(f.observed), typeof(f.colorvec), - typeof(f.sys)}(newf, f.mass_matrix, f.analytic, f.tgrad, f.jac, + typeof(f.sys), typeof(initializeprob), + typeof(initializeprobmap)}(newf, f.mass_matrix, f.analytic, f.tgrad, f.jac, f.jvp, f.vjp, f.jac_prototype, f.sparsity, f.Wfact, f.Wfact_t, f.W_prototype, f.paramjac, - f.observed, f.colorvec, f.sys) + f.observed, f.colorvec, f.sys, f.initializeprob, + f.initializeprobmap) end end From d571a8298d80a42377f61959b439ce423b23f3f6 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 24 Feb 2024 13:23:40 -0500 Subject: [PATCH 2/6] handle DAEFunction as well --- src/scimlfunctions.jl | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index a495e9dff..cf57ad0b8 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -1524,7 +1524,7 @@ automatically symbolically generating the Jacobian and more from the numerically-defined functions. """ struct DAEFunction{iip, specialize, F, Ta, Tt, TJ, JVP, VJP, JP, SP, TW, TWt, TPJ, O, TCV, - SYS} <: + SYS, IProb, IProbMap} <: AbstractDAEFunction{iip} f::F analytic::Ta @@ -1540,6 +1540,8 @@ struct DAEFunction{iip, specialize, F, Ta, Tt, TJ, JVP, VJP, JP, SP, TW, TWt, TP observed::O colorvec::TCV sys::SYS + initializeprob::IProb + initializeprobmap::IProbMap end TruncatedStacktraces.@truncate_stacktrace DAEFunction 1 2 @@ -2279,8 +2281,8 @@ function ODEFunction{iip, specialize}(f; DEFAULT_OBSERVED, colorvec = __has_colorvec(f) ? f.colorvec : nothing, sys = __has_sys(f) ? f.sys : nothing, - initializeprob = nothing, - initializeprobmap = nothing + initializeprob = _has_initializeprob(f) ? f.sys : nothing, + initializeprobmap = _has_initializeprobmap(f) ? f.sys : nothing ) where {iip, specialize, } @@ -2328,7 +2330,7 @@ function ODEFunction{iip, specialize}(f; sys = something(sys, SymbolCache(syms, paramsyms, indepsym)) - @assert typeof(initializeprob) <: Union{NonlinearProblem, NonlinearLeastSquaresProblem} + @assert typeof(initializeprob) <: Union{Nothing, NonlinearProblem, NonlinearLeastSquaresProblem} if specialize === NoSpecialize ODEFunction{iip, specialize, @@ -3189,7 +3191,9 @@ function DAEFunction{iip, specialize}(f; observed = __has_observed(f) ? f.observed : DEFAULT_OBSERVED, colorvec = __has_colorvec(f) ? f.colorvec : nothing, - sys = __has_sys(f) ? f.sys : nothing) where {iip, + sys = __has_sys(f) ? f.sys : nothing, + initializeprob = _has_initializeprob(f) ? f.sys : nothing, + initializeprobmap = _has_initializeprobmap(f) ? f.sys : nothing) where {iip, specialize } if jac === nothing && isa(jac_prototype, AbstractSciMLOperator) @@ -3221,6 +3225,8 @@ function DAEFunction{iip, specialize}(f; _f = prepare_function(f) sys = sys_or_symbolcache(sys, syms, paramsyms, indepsym) + @assert typeof(initializeprob) <: Union{Nothing, NonlinearProblem, NonlinearLeastSquaresProblem} + if specialize === NoSpecialize DAEFunction{iip, specialize, Any, Any, Any, Any, Any, Any, Any, Any, @@ -3228,7 +3234,7 @@ function DAEFunction{iip, specialize}(f; Any, typeof(_colorvec), Any}(_f, analytic, tgrad, jac, jvp, vjp, jac_prototype, sparsity, Wfact, Wfact_t, paramjac, observed, - _colorvec, sys) + _colorvec, sys, initializeprob, initializeprobmap) else DAEFunction{iip, specialize, typeof(_f), typeof(analytic), typeof(tgrad), typeof(jac), typeof(jvp), typeof(vjp), typeof(jac_prototype), @@ -3238,7 +3244,7 @@ function DAEFunction{iip, specialize}(f; typeof(sys)}(_f, analytic, tgrad, jac, jvp, vjp, jac_prototype, sparsity, Wfact, Wfact_t, paramjac, observed, - _colorvec, sys) + _colorvec, sys, initializeprob, initializeprobmap) end end @@ -3957,6 +3963,8 @@ __has_colorvec(f) = isdefined(f, :colorvec) __has_sys(f) = isdefined(f, :sys) __has_analytic_full(f) = isdefined(f, :analytic_full) __has_resid_prototype(f) = isdefined(f, :resid_prototype) +__has_initializeprob(f) = isdefined(f, :initializeprob) +__has_initializeprobmap(f) = isdefined(f, :initializeprobmap) # compatibility has_invW(f::AbstractSciMLFunction) = false @@ -3969,6 +3977,9 @@ has_Wfact(f::AbstractSciMLFunction) = __has_Wfact(f) && f.Wfact !== nothing has_Wfact_t(f::AbstractSciMLFunction) = __has_Wfact_t(f) && f.Wfact_t !== nothing has_paramjac(f::AbstractSciMLFunction) = __has_paramjac(f) && f.paramjac !== nothing has_sys(f::AbstractSciMLFunction) = __has_sys(f) && f.sys !== nothing +has_initializeprob(f::AbstractSciMLFunction) = __has_initializeprob(f) && f.initializeprob !== nothing +has_initializeprobmap(f::AbstractSciMLFunction) = __has_initializeprobmap(f) && f.initializeprobmap !== nothing + function has_syms(f::AbstractSciMLFunction) if __has_syms(f) f.syms !== nothing From 96eda01c2bfdcca10e12784c97b6656342bcf6cd Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 24 Feb 2024 13:30:14 -0500 Subject: [PATCH 3/6] fix typos --- src/scimlfunctions.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index cf57ad0b8..e6b170573 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -2281,8 +2281,8 @@ function ODEFunction{iip, specialize}(f; DEFAULT_OBSERVED, colorvec = __has_colorvec(f) ? f.colorvec : nothing, sys = __has_sys(f) ? f.sys : nothing, - initializeprob = _has_initializeprob(f) ? f.sys : nothing, - initializeprobmap = _has_initializeprobmap(f) ? f.sys : nothing + initializeprob = __has_initializeprob(f) ? f.sys : nothing, + initializeprobmap = __has_initializeprobmap(f) ? f.sys : nothing ) where {iip, specialize, } @@ -3192,8 +3192,8 @@ function DAEFunction{iip, specialize}(f; DEFAULT_OBSERVED, colorvec = __has_colorvec(f) ? f.colorvec : nothing, sys = __has_sys(f) ? f.sys : nothing, - initializeprob = _has_initializeprob(f) ? f.sys : nothing, - initializeprobmap = _has_initializeprobmap(f) ? f.sys : nothing) where {iip, + initializeprob = __has_initializeprob(f) ? f.sys : nothing, + initializeprobmap = __has_initializeprobmap(f) ? f.sys : nothing) where {iip, specialize } if jac === nothing && isa(jac_prototype, AbstractSciMLOperator) From afc661462c8b670b6da1c1ed2475918e4cab8a19 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 25 Feb 2024 13:34:45 -0800 Subject: [PATCH 4/6] fix namespacing --- src/scimlfunctions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index e6b170573..b3e1a8d90 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -2396,8 +2396,8 @@ function unwrapped_f(f::ODEFunction, newf = unwrapped_f(f.f)) typeof(f.sparsity), typeof(f.Wfact), typeof(f.Wfact_t), typeof(f.W_prototype), typeof(f.paramjac), typeof(f.observed), typeof(f.colorvec), - typeof(f.sys), typeof(initializeprob), - typeof(initializeprobmap)}(newf, f.mass_matrix, f.analytic, f.tgrad, f.jac, + typeof(f.sys), typeof(f.initializeprob), + typeof(f.initializeprobmap)}(newf, f.mass_matrix, f.analytic, f.tgrad, f.jac, f.jvp, f.vjp, f.jac_prototype, f.sparsity, f.Wfact, f.Wfact_t, f.W_prototype, f.paramjac, f.observed, f.colorvec, f.sys, f.initializeprob, From 5b80eb8e5eb086cfd2ef4ffd878f877a2b0b99ff Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 25 Feb 2024 13:55:50 -0800 Subject: [PATCH 5/6] fix some constructors --- src/scimlfunctions.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index b3e1a8d90..c1965c9a2 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -3231,7 +3231,7 @@ function DAEFunction{iip, specialize}(f; DAEFunction{iip, specialize, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, Any, - Any, typeof(_colorvec), Any}(_f, analytic, tgrad, jac, jvp, + Any, typeof(_colorvec), Any, Any, Any}(_f, analytic, tgrad, jac, jvp, vjp, jac_prototype, sparsity, Wfact, Wfact_t, paramjac, observed, _colorvec, sys, initializeprob, initializeprobmap) @@ -3241,7 +3241,8 @@ function DAEFunction{iip, specialize}(f; typeof(sparsity), typeof(Wfact), typeof(Wfact_t), typeof(paramjac), typeof(observed), typeof(_colorvec), - typeof(sys)}(_f, analytic, tgrad, jac, jvp, vjp, + typeof(sys), typeof(initializeprob), typeof(initializeprobmap)}( + _f, analytic, tgrad, jac, jvp, vjp, jac_prototype, sparsity, Wfact, Wfact_t, paramjac, observed, _colorvec, sys, initializeprob, initializeprobmap) From a5f294274b33b934a1da1faaab3b72cf4ad504bc Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 25 Feb 2024 14:07:14 -0800 Subject: [PATCH 6/6] format --- src/scimlfunctions.jl | 72 +++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index c1965c9a2..b2f609c11 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -2258,33 +2258,33 @@ end ######### Basic Constructor function ODEFunction{iip, specialize}(f; - mass_matrix = __has_mass_matrix(f) ? f.mass_matrix : - I, - analytic = __has_analytic(f) ? f.analytic : nothing, - tgrad = __has_tgrad(f) ? f.tgrad : nothing, - jac = __has_jac(f) ? f.jac : nothing, - jvp = __has_jvp(f) ? f.jvp : nothing, - vjp = __has_vjp(f) ? f.vjp : nothing, - jac_prototype = __has_jac_prototype(f) ? - f.jac_prototype : - nothing, - sparsity = __has_sparsity(f) ? f.sparsity : - jac_prototype, - Wfact = __has_Wfact(f) ? f.Wfact : nothing, - Wfact_t = __has_Wfact_t(f) ? f.Wfact_t : nothing, - W_prototype = __has_W_prototype(f) ? f.W_prototype : nothing, - paramjac = __has_paramjac(f) ? f.paramjac : nothing, - syms = nothing, - indepsym = nothing, - paramsyms = nothing, - observed = __has_observed(f) ? f.observed : - DEFAULT_OBSERVED, - colorvec = __has_colorvec(f) ? f.colorvec : nothing, - sys = __has_sys(f) ? f.sys : nothing, - initializeprob = __has_initializeprob(f) ? f.sys : nothing, - initializeprobmap = __has_initializeprobmap(f) ? f.sys : nothing - ) where {iip, - specialize, + mass_matrix = __has_mass_matrix(f) ? f.mass_matrix : + I, + analytic = __has_analytic(f) ? f.analytic : nothing, + tgrad = __has_tgrad(f) ? f.tgrad : nothing, + jac = __has_jac(f) ? f.jac : nothing, + jvp = __has_jvp(f) ? f.jvp : nothing, + vjp = __has_vjp(f) ? f.vjp : nothing, + jac_prototype = __has_jac_prototype(f) ? + f.jac_prototype : + nothing, + sparsity = __has_sparsity(f) ? f.sparsity : + jac_prototype, + Wfact = __has_Wfact(f) ? f.Wfact : nothing, + Wfact_t = __has_Wfact_t(f) ? f.Wfact_t : nothing, + W_prototype = __has_W_prototype(f) ? f.W_prototype : nothing, + paramjac = __has_paramjac(f) ? f.paramjac : nothing, + syms = nothing, + indepsym = nothing, + paramsyms = nothing, + observed = __has_observed(f) ? f.observed : + DEFAULT_OBSERVED, + colorvec = __has_colorvec(f) ? f.colorvec : nothing, + sys = __has_sys(f) ? f.sys : nothing, + initializeprob = __has_initializeprob(f) ? f.sys : nothing, + initializeprobmap = __has_initializeprobmap(f) ? f.sys : nothing +) where {iip, + specialize } if mass_matrix === I && f isa Tuple mass_matrix = ((I for i in 1:length(f))...,) @@ -2330,7 +2330,8 @@ function ODEFunction{iip, specialize}(f; sys = something(sys, SymbolCache(syms, paramsyms, indepsym)) - @assert typeof(initializeprob) <: Union{Nothing, NonlinearProblem, NonlinearLeastSquaresProblem} + @assert typeof(initializeprob) <: + Union{Nothing, NonlinearProblem, NonlinearLeastSquaresProblem} if specialize === NoSpecialize ODEFunction{iip, specialize, @@ -2354,7 +2355,7 @@ function ODEFunction{iip, specialize}(f; typeof(sys), typeof(initializeprob), typeof(initializeprobmap)}(_f, mass_matrix, analytic, tgrad, jac, jvp, vjp, jac_prototype, sparsity, Wfact, - Wfact_t, W_prototype, paramjac, + Wfact_t, W_prototype, paramjac, observed, _colorvec, sys, initializeprob, initializeprobmap) else ODEFunction{iip, specialize, @@ -2367,7 +2368,7 @@ function ODEFunction{iip, specialize}(f; typeof(sys), typeof(initializeprob), typeof(initializeprobmap)}(_f, mass_matrix, analytic, tgrad, jac, jvp, vjp, jac_prototype, sparsity, Wfact, - Wfact_t, W_prototype, paramjac, + Wfact_t, W_prototype, paramjac, observed, _colorvec, sys, initializeprob, initializeprobmap) end end @@ -3225,7 +3226,8 @@ function DAEFunction{iip, specialize}(f; _f = prepare_function(f) sys = sys_or_symbolcache(sys, syms, paramsyms, indepsym) - @assert typeof(initializeprob) <: Union{Nothing, NonlinearProblem, NonlinearLeastSquaresProblem} + @assert typeof(initializeprob) <: + Union{Nothing, NonlinearProblem, NonlinearLeastSquaresProblem} if specialize === NoSpecialize DAEFunction{iip, specialize, Any, Any, Any, @@ -3978,8 +3980,12 @@ has_Wfact(f::AbstractSciMLFunction) = __has_Wfact(f) && f.Wfact !== nothing has_Wfact_t(f::AbstractSciMLFunction) = __has_Wfact_t(f) && f.Wfact_t !== nothing has_paramjac(f::AbstractSciMLFunction) = __has_paramjac(f) && f.paramjac !== nothing has_sys(f::AbstractSciMLFunction) = __has_sys(f) && f.sys !== nothing -has_initializeprob(f::AbstractSciMLFunction) = __has_initializeprob(f) && f.initializeprob !== nothing -has_initializeprobmap(f::AbstractSciMLFunction) = __has_initializeprobmap(f) && f.initializeprobmap !== nothing +function has_initializeprob(f::AbstractSciMLFunction) + __has_initializeprob(f) && f.initializeprob !== nothing +end +function has_initializeprobmap(f::AbstractSciMLFunction) + __has_initializeprobmap(f) && f.initializeprobmap !== nothing +end function has_syms(f::AbstractSciMLFunction) if __has_syms(f)