diff --git a/topfarm/topfarm.py b/topfarm/topfarm.py index 10cf032ce17e6073b955979b2820349e179fe09b..e019117d044882de85ed33078a5168ba0a1ceac1 100644 --- a/topfarm/topfarm.py +++ b/topfarm/topfarm.py @@ -5,6 +5,7 @@ from openmdao.api import Problem, ScipyOptimizeDriver, IndepVarComp import numpy as np from topfarm.constraint_components.boundary_component import BoundaryComp from topfarm.constraint_components.spacing_component import SpacingComp +import warnings class TopFarm(object): @@ -67,7 +68,9 @@ class TopFarm(object): def evaluate(self): t = time.time() - self.problem.run_model() + with warnings.catch_warnings(): # suppress OpenMDAO/SLSQP warnings + warnings.filterwarnings('ignore', "Inefficient choice of derivative mode. You chose 'rev' for a problem with") + self.problem.run_model() print ("Evaluated in\t%.3fs" % (time.time() - t)) return self.get_cost(), self.turbine_positions