Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix termination condition deprecation #81

Merged
merged 8 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(), AbsSafeBestTerminationMode()
ChrisRackauckas marked this conversation as resolved.
Show resolved Hide resolved
]
sol_tc = solve(prob, DynamicSS(Tsit5()); termination_condition)
@show sol_tc.retcode, termination_condition
Expand Down
Loading