From fe3b02dcb383b8ca31b944d037d26a49b6ac46f6 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 4 May 2025 14:12:16 -0400 Subject: [PATCH] Update termination reason dictionary Makes it easier to match. Fixes https://github.com/SciML/Optimization.jl/issues/904 --- src/utils.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index fb0d4096a..36afe4c23 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -70,13 +70,13 @@ const STOP_REASON_MAP = Dict( r"InitialFailure" => ReturnCode.InitialFailure, r"ConvergenceFailure|ITERATION_LIMIT" => ReturnCode.ConvergenceFailure, r"Infeasible|INFEASIBLE|DUAL_INFEASIBLE|LOCALLY_INFEASIBLE|INFEASIBLE_OR_UNBOUNDED" => ReturnCode.Infeasible, - r"STOP: TOTAL NO. of ITERATIONS REACHED LIMIT" => ReturnCode.MaxIters, - r"STOP: TOTAL NO. of f AND g EVALUATIONS EXCEEDS LIMIT" => ReturnCode.MaxIters, - r"STOP: ABNORMAL_TERMINATION_IN_LNSRCH" => ReturnCode.Unstable, - r"STOP: ERROR INPUT DATA" => ReturnCode.InitialFailure, - r"STOP: FTOL.TOO.SMALL" => ReturnCode.ConvergenceFailure, - r"STOP: GTOL.TOO.SMALL" => ReturnCode.ConvergenceFailure, - r"STOP: XTOL.TOO.SMALL" => ReturnCode.ConvergenceFailure, + r"TOTAL NO. of ITERATIONS REACHED LIMIT" => ReturnCode.MaxIters, + r"TOTAL NO. of f AND g EVALUATIONS EXCEEDS LIMIT" => ReturnCode.MaxIters, + r"ABNORMAL_TERMINATION_IN_LNSRCH" => ReturnCode.Unstable, + r"ERROR INPUT DATA" => ReturnCode.InitialFailure, + r"FTOL.TOO.SMALL" => ReturnCode.ConvergenceFailure, + r"GTOL.TOO.SMALL" => ReturnCode.ConvergenceFailure, + r"XTOL.TOO.SMALL" => ReturnCode.ConvergenceFailure, r"STOP: TERMINATION" => ReturnCode.Terminated, r"Optimization completed" => ReturnCode.Success, r"Convergence achieved" => ReturnCode.Success,