Skip to content

Commit

Permalink
Merge pull request #487 from ErikQQY/master
Browse files Browse the repository at this point in the history
Fix BVPFunction errors
  • Loading branch information
ChrisRackauckas authored Sep 6, 2023
2 parents b4905ca + 0b0c5bb commit 89503d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SciMLBase"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
authors = ["Chris Rackauckas <[email protected]> and contributors"]
version = "1.96.1"
version = "1.96.2"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down
14 changes: 7 additions & 7 deletions src/problems/bvp_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

"""
Expand Down
16 changes: 3 additions & 13 deletions src/scimlfunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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...)
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 89503d7

Please sign in to comment.