SciML / SciMLBase.jl

The Base interface of the SciML ecosystem
https://docs.sciml.ai/SciMLBase/stable
MIT License
127 stars 92 forks source link

Fix bcresid_prototype in TwoPointBVPFunction #522

Closed ErikQQY closed 10 months ago

ErikQQY commented 10 months ago

When trying to construct a TwoPointBVPFunction without specifying bcresid_prototype, it throws errors

julia> f1 = SciMLBase.TwoPointBVPFunction(ex7_f!, (ex7_2pbc1!, ex7_2pbc2!))
ERROR: bcresid_prototype must be a tuple / indexable collection of length 2 for a inplace TwoPointBVPFunction
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] (BVPFunction{true, SciMLBase.FullSpecialize, true})(f::typeof(ex7_f!), bc::Tuple{typeof(ex7_2pbc1!), typeof(ex7_2pbc2!)}; mass_matrix::LinearAlgebra.UniformScaling{Bool}, analytic::Nothing, tgrad::Nothing, jac::Nothing, bcjac::Nothing, jvp::Nothing, vjp::Nothing, jac_prototype::Nothing, bcjac_prototype::Nothing, bcresid_prototype::Nothing, sparsity::Nothing, Wfact::Nothing, Wfact_t::Nothing, paramjac::Nothing, syms::Nothing, indepsym::Nothing, paramsyms::Nothing, observed::typeof(SciMLBase.DEFAULT_OBSERVED), colorvec::Nothing, bccolorvec::Nothing, sys::Nothing)
   @ SciMLBase ~/.julia/packages/SciMLBase/N8cDr/src/scimlfunctions.jl:4071
 [3] (BVPFunction{true, SciMLBase.FullSpecialize, true})(f::Function, bc::Tuple{typeof(ex7_2pbc1!), typeof(ex7_2pbc2!)})
   @ SciMLBase ~/.julia/packages/SciMLBase/N8cDr/src/scimlfunctions.jl:3966
 [4] BVPFunction(f::Function, bc::Tuple{typeof(ex7_2pbc1!), typeof(ex7_2pbc2!)}; twopoint::Val{true}, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ SciMLBase ~/.julia/packages/SciMLBase/N8cDr/src/scimlfunctions.jl:4122
 [5] SciMLBase.TwoPointBVPFunction(::Function, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ SciMLBase ~/.julia/packages/SciMLBase/N8cDr/src/problems/bvp_problems.jl:154
 [6] SciMLBase.TwoPointBVPFunction(::Function, ::Vararg{Any})
   @ SciMLBase ~/.julia/packages/SciMLBase/N8cDr/src/problems/bvp_problems.jl:153
 [7] top-level scope
   @ REPL[10]:1
codecov[bot] commented 10 months ago

Codecov Report

Merging #522 (bf167ce) into master (c6623b2) will increase coverage by 0.28%. Report is 1 commits behind head on master. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #522      +/-   ##
==========================================
+ Coverage   40.41%   40.70%   +0.28%     
==========================================
  Files          53       53              
  Lines        3882     3882              
==========================================
+ Hits         1569     1580      +11     
+ Misses       2313     2302      -11     
Files Coverage Δ
src/scimlfunctions.jl 52.24% <100.00%> (+1.49%) :arrow_up:

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more