From 3307b06637b9bc0b8aea300df7aff0e1fe1e3097 Mon Sep 17 00:00:00 2001 From: Vaibhav Dixit Date: Fri, 20 Sep 2024 16:48:36 -0400 Subject: [PATCH] Fix random tests --- docs/pages.jl | 4 ++-- lib/OptimizationNLopt/test/runtests.jl | 3 +-- test/diffeqfluxtests.jl | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/pages.jl b/docs/pages.jl index 83d03f539..baeca2800 100644 --- a/docs/pages.jl +++ b/docs/pages.jl @@ -7,7 +7,7 @@ pages = ["index.md", "tutorials/linearandinteger.md", "tutorials/minibatch.md", "tutorials/remakecomposition.md", - "tutorials/symbolic.md", + "tutorials/symbolic.md" ], "Examples" => [ "examples/rosenbrock.md" @@ -41,6 +41,6 @@ pages = ["index.md", "Polyalgorithms.jl" => "optimization_packages/polyopt.md", "PRIMA.jl" => "optimization_packages/prima.md", "QuadDIRECT.jl" => "optimization_packages/quaddirect.md", - "SpeedMapping.jl" => "optimization_packages/speedmapping.md", + "SpeedMapping.jl" => "optimization_packages/speedmapping.md" ] ] diff --git a/lib/OptimizationNLopt/test/runtests.jl b/lib/OptimizationNLopt/test/runtests.jl index 5245dfe50..65c91372d 100644 --- a/lib/OptimizationNLopt/test/runtests.jl +++ b/lib/OptimizationNLopt/test/runtests.jl @@ -117,8 +117,7 @@ using Test, Random # @test sol.retcode == ReturnCode.Success @test 10 * sol.objective < l1 - Random.seed!(1) - prob = OptimizationProblem(optprob, rand(2), _p, lcons = [-Inf, -Inf], + prob = OptimizationProblem(optprob, [0.5, 0.5], _p, lcons = [-Inf, -Inf], ucons = [0.0, 0.0], lb = [-1.0, -1.0], ub = [1.0, 1.0]) sol = solve(prob, NLopt.GN_ISRES(), maxiters = 1000) @test sol.retcode == ReturnCode.MaxIters diff --git a/test/diffeqfluxtests.jl b/test/diffeqfluxtests.jl index c92463ba0..243027246 100644 --- a/test/diffeqfluxtests.jl +++ b/test/diffeqfluxtests.jl @@ -1,6 +1,7 @@ using OrdinaryDiffEq, DiffEqFlux, Lux, Optimization, OptimizationOptimJL, OptimizationOptimisers, ForwardDiff, ComponentArrays, Random rng = Random.default_rng() +Random.seed!(123) function lotka_volterra!(du, u, p, t) x, y = u