From 283c21b4e51a7dbb83d93500009b8ef52c95ca98 Mon Sep 17 00:00:00 2001 From: Neil Wu Date: Tue, 15 Aug 2023 16:12:14 -0700 Subject: [PATCH] add an nsga2 test to rosenbrock --- tests/test_rosenbrock.py | 3 ++- tests/testing_utils.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_rosenbrock.py b/tests/test_rosenbrock.py index b590d605..b10615fb 100644 --- a/tests/test_rosenbrock.py +++ b/tests/test_rosenbrock.py @@ -50,6 +50,7 @@ class TestRosenbrock(OptTest): "CONMIN": 1e-9, "PSQP": 1e-8, "ParOpt": 1e-8, + "NSGA2": 1e-6, } optOptions = { "SLSQP": {"ACC": 1e-10}, @@ -146,7 +147,7 @@ def test_snopt_hotstart_starting_from_grad(self): # The first is from a call we deleted and the second is the call after 'last' self.assertEqual(self.ng, 2) - @parameterized.expand(["IPOPT", "SLSQP", "PSQP", "CONMIN", "NLPQLP", "ParOpt"]) + @parameterized.expand(["IPOPT", "SLSQP", "PSQP", "CONMIN", "NLPQLP", "ParOpt", "NSGA2"]) def test_optimization(self, optName): self.optName = optName if optName == "IPOPT" and sys.platform == "win32": diff --git a/tests/testing_utils.py b/tests/testing_utils.py index b0bccd73..9d5a8a55 100644 --- a/tests/testing_utils.py +++ b/tests/testing_utils.py @@ -61,7 +61,7 @@ def get_dict_distance(d, d2): } # these are optimizers which are installed by default -DEFAULT_OPTIMIZERS = {"SLSQP", "PSQP", "CONMIN", "ALPSO", "NSGA2"} +DEFAULT_OPTIMIZERS = {"SLSQP", "PSQP", "CONMIN", "ALPSO"} # Define gradient-based optimizers GRAD_BASED_OPTIMIZERS = {"CONMIN", "IPOPT", "NLPQLP", "ParOpt", "PSQP", "SLSQP", "SNOPT"}