From 28a7248deaa6383a29519e7bd7386e342f074e87 Mon Sep 17 00:00:00 2001 From: ErikQQY <2283984853@qq.com> Date: Wed, 6 Sep 2023 15:37:21 +0800 Subject: [PATCH 1/2] Fix BVPFunction errors Signed-off-by: ErikQQY <2283984853@qq.com> --- src/problems/bvp_problems.jl | 14 +++++++------- src/scimlfunctions.jl | 16 +++------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/problems/bvp_problems.jl b/src/problems/bvp_problems.jl index 73f39463a..3beec8702 100644 --- a/src/problems/bvp_problems.jl +++ b/src/problems/bvp_problems.jl @@ -94,9 +94,9 @@ struct BVProblem{uType, tType, isinplace, P, F, BF, PT, K} <: kwargs...) where {iip} _tspan = promote_tspan(tspan) warn_paramtype(p) - new{typeof(u0), typeof(_tspan), iip, typeof(p), - typeof(f.f), typeof(bc), - typeof(problem_type), typeof(kwargs)}(f.f, bc, u0, _tspan, p, + new{typeof(u0), typeof(_tspan), isinplace(f), typeof(p), + typeof(f), typeof(f.bc), + typeof(problem_type), typeof(kwargs)}(f, f.bc, u0, _tspan, p, problem_type, kwargs) end @@ -107,12 +107,12 @@ end TruncatedStacktraces.@truncate_stacktrace BVProblem 3 1 2 -function BVProblem(f, bc, u0, tspan, p = NullParameters(); kwargs...) - BVProblem(BVPFunction(f, bc), u0, tspan, p; kwargs...) +function BVProblem(f::AbstractBVPFunction, u0, tspan, p = NullParameters(); kwargs...) + BVProblem{isinplace(f)}(f, f.bc, u0, tspan, p; kwargs...) end -function BVProblem(f::AbstractBVPFunction, u0, tspan, p = NullParameters(); kwargs...) - BVProblem{isinplace(f)}(f.f, f.bc, u0, tspan, p; kwargs...) +function BVProblem(f, bc, u0, tspan, p = NullParameters(); kwargs...) + BVProblem(BVPFunction(f, bc), u0, tspan, p; kwargs...) end """ diff --git a/src/scimlfunctions.jl b/src/scimlfunctions.jl index 102e0c041..ab6a8cff4 100644 --- a/src/scimlfunctions.jl +++ b/src/scimlfunctions.jl @@ -2236,8 +2236,7 @@ struct BVPFunction{iip, specialize, F, BF, TMM, Ta, Tt, TJ, BCTJ, JVP, VJP, JP, BCJP, SP, TW, TWt, TPJ, S, S2, S3, O, TCV, BCTCV, - SYS} <: - AbstractBVPFunction{iip} + SYS} <: AbstractBVPFunction{iip} f::F bc::BF mass_matrix::TMM @@ -2262,6 +2261,8 @@ struct BVPFunction{iip, specialize, F, BF, TMM, Ta, Tt, TJ, BCTJ, JVP, VJP, JP, sys::SYS end +TruncatedStacktraces.@truncate_stacktrace BVPFunction 1 2 + ######### Backwards Compatibility Overloads (f::ODEFunction)(args...) = f.f(args...) @@ -3928,17 +3929,6 @@ function BVPFunction{iip, specialize}(f, bc; indepsym, paramsyms, observed, _colorvec, _bccolorvec, sys) - elseif specialize === false - BVPFunction{iip, FunctionWrapperSpecialize, - typeof(f), typeof(bc), typeof(mass_matrix), typeof(analytic), typeof(tgrad), - typeof(jac), typeof(jvp), typeof(vjp), typeof(jac_prototype), - typeof(sparsity), typeof(Wfact), typeof(Wfact_t), typeof(paramjac), - typeof(syms), typeof(indepsym), typeof(paramsyms), typeof(observed), - typeof(_colorvec), typeof(_bccolorvec), - typeof(sys)}(f, bc, mass_matrix, analytic, tgrad, jac, bcjac, - jvp, vjp, jac_prototype, bcjac_prototype, sparsity, Wfact, - Wfact_t, paramjac, syms, indepsym, paramsyms, - observed, _colorvec, _bccolorvec, sys) else BVPFunction{iip, specialize, typeof(f), typeof(bc), typeof(mass_matrix), typeof(analytic), From 0b0c5bbce5639cbe58f6ecc5c245a93c203ac4c2 Mon Sep 17 00:00:00 2001 From: ErikQQY <2283984853@qq.com> Date: Wed, 6 Sep 2023 16:37:31 +0800 Subject: [PATCH 2/2] Update Project.toml Signed-off-by: ErikQQY <2283984853@qq.com> --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index a14d73463..d97c63a52 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLBase" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" authors = ["Chris Rackauckas and contributors"] -version = "1.96.1" +version = "1.96.2" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"