Skip to content

Commit

Permalink
Merge pull request #81 from SciML/depwarn
Browse files Browse the repository at this point in the history
Fix termination condition deprecation
  • Loading branch information
ChrisRackauckas authored Jul 30, 2024
2 parents 820157f + 83be667 commit 275ae85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "SteadyStateDiffEq"
uuid = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
version = "2.2.0"
version = "2.2.1"

[deps]
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
Expand Down
3 changes: 2 additions & 1 deletion src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ function __get_tspan(u0, tspan::Number)
(DiffEqBase.value(zero(tspan)), tspan))
end

infnorm(x) = norm(x,Inf)
function DiffEqBase.__solve(prob::DiffEqBase.AbstractSteadyStateProblem, alg::DynamicSS,
args...; abstol = 1e-8, reltol = 1e-6, odesolve_kwargs = (;),
save_idxs = nothing, termination_condition = SteadyStateDiffEqTerminationMode(),
save_idxs = nothing, termination_condition = NormTerminationMode(infnorm),
kwargs...)
tspan = __get_tspan(prob.u0, alg)

Expand Down
7 changes: 3 additions & 4 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ sol2 = solve(prob, DynamicSS(Tsit5()); abstol = 1e-4)
@test typeof(u0) == typeof(sol2.u)

for termination_condition in [
SteadyStateDiffEqTerminationMode(), SimpleNonlinearSolveTerminationMode(),
NormTerminationMode(), RelTerminationMode(), RelNormTerminationMode(),
AbsTerminationMode(), AbsNormTerminationMode(), RelSafeTerminationMode(),
AbsSafeTerminationMode(), RelSafeBestTerminationMode(), AbsSafeBestTerminationMode()
NormTerminationMode(SteadyStateDiffEq.infnorm), RelTerminationMode(), RelNormTerminationMode(SteadyStateDiffEq.infnorm),
AbsTerminationMode(), AbsNormTerminationMode(SteadyStateDiffEq.infnorm), RelSafeTerminationMode(SteadyStateDiffEq.infnorm),
AbsSafeTerminationMode(SteadyStateDiffEq.infnorm), RelSafeBestTerminationMode(SteadyStateDiffEq.infnorm), AbsSafeBestTerminationMode(SteadyStateDiffEq.infnorm)
]
sol_tc = solve(prob, DynamicSS(Tsit5()); termination_condition)
@show sol_tc.retcode, termination_condition
Expand Down

0 comments on commit 275ae85

Please sign in to comment.