diff --git a/.github/workflows/Downstream.yml b/.github/workflows/Downstream.yml index b2b43a4bb..0ec4ca550 100644 --- a/.github/workflows/Downstream.yml +++ b/.github/workflows/Downstream.yml @@ -91,4 +91,4 @@ jobs: with: file: lcov.info token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true + fail_ci_if_error: false diff --git a/Project.toml b/Project.toml index a85c81a24..184be67bd 100644 --- a/Project.toml +++ b/Project.toml @@ -95,7 +95,7 @@ Printf = "1.9" RecursiveArrayTools = "3" Reexport = "1.0" ReverseDiff = "1" -SciMLBase = "2.56.0" +SciMLBase = "2.60.0" SciMLOperators = "0.3" SciMLStructures = "1.5" Setfield = "1" diff --git a/src/solve.jl b/src/solve.jl index 0dd5b6aa0..357f2f78d 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -500,6 +500,19 @@ function Base.showerror(io::IO, e::IncompatibleMassMatrixError) println(io, TruncatedStacktraces.VERBOSE_MSG) end +const LATE_BINDING_TSTOPS_ERROR_MESSAGE = """ + This solver does not support providing `tstops` as a function. + Consider using a different solver or providing `tstops` as an array + of times. + """ + +struct LateBindingTstopsNotSupportedError <: Exception end + +function Base.showerror(io::IO, e::LateBindingTstopsNotSupportedError) + println(io, LATE_BINDING_TSTOPS_ERROR_MESSAGE) + println(io, TruncatedStacktraces.VERBOSE_MSG) +end + function init_call(_prob, args...; merge_callbacks = true, kwargshandle = nothing, kwargs...) kwargshandle = kwargshandle === nothing ? KeywordArgError : kwargshandle @@ -555,6 +568,13 @@ function init_up(prob::AbstractDEProblem, sensealg, u0, p, args...; kwargs...) p = p, kwargs...) init_call(_prob, args...; kwargs...) else + tstops = get(kwargs, :tstops, nothing) + if tstops === nothing && has_kwargs(prob) + tstops = get(prob.kwargs, :tstops, nothing) + end + if !(tstops isa Union{Nothing, AbstractArray, Tuple, Real}) && !SciMLBase.allows_late_binding_tstops(alg) + throw(LateBindingTstopsNotSupportedError()) + end _prob = get_concrete_problem(prob, isadaptive(alg); u0 = u0, p = p, kwargs...) _alg = prepare_alg(alg, _prob.u0, _prob.p, _prob) check_prob_alg_pairing(_prob, alg) # alg for improved inference @@ -1084,6 +1104,13 @@ function solve_up(prob::Union{AbstractDEProblem, NonlinearProblem}, sensealg, u0 p = p, kwargs...) solve_call(_prob, args...; kwargs...) else + tstops = get(kwargs, :tstops, nothing) + if tstops === nothing && has_kwargs(prob) + tstops = get(prob.kwargs, :tstops, nothing) + end + if !(tstops isa Union{Nothing, AbstractArray, Tuple, Real}) && !SciMLBase.allows_late_binding_tstops(alg) + throw(LateBindingTstopsNotSupportedError()) + end _prob = get_concrete_problem(prob, isadaptive(alg); u0 = u0, p = p, kwargs...) _alg = prepare_alg(alg, _prob.u0, _prob.p, _prob) check_prob_alg_pairing(_prob, alg) # use alg for improved inference