From 9667029500fff3a92b97767ba9f6ecdb35dc7e7c Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Thu, 24 Nov 2022 10:55:52 +0100 Subject: [PATCH] Fix return codes --- lib/SimpleNonlinearSolve/Project.toml | 2 +- lib/SimpleNonlinearSolve/src/raphson.jl | 4 ++-- lib/SimpleNonlinearSolve/test/basictests.jl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/SimpleNonlinearSolve/Project.toml b/lib/SimpleNonlinearSolve/Project.toml index 71f516462..8b87181da 100644 --- a/lib/SimpleNonlinearSolve/Project.toml +++ b/lib/SimpleNonlinearSolve/Project.toml @@ -1,7 +1,7 @@ name = "SimpleNonlinearSolve" uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7" authors = ["SciML"] -version = "0.1.1" +version = "0.1.2" [deps] ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2" diff --git a/lib/SimpleNonlinearSolve/src/raphson.jl b/lib/SimpleNonlinearSolve/src/raphson.jl index 1f23debd7..3db5b62bc 100644 --- a/lib/SimpleNonlinearSolve/src/raphson.jl +++ b/lib/SimpleNonlinearSolve/src/raphson.jl @@ -40,11 +40,11 @@ function SciMLBase.solve(prob::NonlinearProblem, fx) end iszero(fx) && - return SciMLBase.build_solution(prob, alg, x, fx; retcode = ReturnCode.Default) + return SciMLBase.build_solution(prob, alg, x, fx; retcode = ReturnCode.Success) Δx = dfx \ fx x -= Δx if isapprox(x, xo, atol = atol, rtol = rtol) - return SciMLBase.build_solution(prob, alg, x, fx; retcode = ReturnCode.Default) + return SciMLBase.build_solution(prob, alg, x, fx; retcode = ReturnCode.Success) end xo = x end diff --git a/lib/SimpleNonlinearSolve/test/basictests.jl b/lib/SimpleNonlinearSolve/test/basictests.jl index 0a0716173..0c4194675 100644 --- a/lib/SimpleNonlinearSolve/test/basictests.jl +++ b/lib/SimpleNonlinearSolve/test/basictests.jl @@ -18,7 +18,7 @@ end const csu0 = 1.0 sol = benchmark_scalar(sf, csu0) -@test sol.retcode === ReturnCode.Default +@test sol.retcode === ReturnCode.Success @test sol.u * sol.u - 2 < 1e-9 @test (@ballocated benchmark_scalar(sf, csu0)) == 0