Skip to content
Snippets Groups Projects
Commit a45a01b3 authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

Merge branch 'fix_slsqp_warning' into 'master'

closes #2

Closes #2

See merge request !10
parents e7703ab1 42de67dd
No related branches found
No related tags found
1 merge request!94Handle disabled mpi
...@@ -5,6 +5,7 @@ from openmdao.api import Problem, ScipyOptimizeDriver, IndepVarComp ...@@ -5,6 +5,7 @@ from openmdao.api import Problem, ScipyOptimizeDriver, IndepVarComp
import numpy as np import numpy as np
from topfarm.constraint_components.boundary_component import BoundaryComp from topfarm.constraint_components.boundary_component import BoundaryComp
from topfarm.constraint_components.spacing_component import SpacingComp from topfarm.constraint_components.spacing_component import SpacingComp
import warnings
class TopFarm(object): class TopFarm(object):
...@@ -67,7 +68,9 @@ class TopFarm(object): ...@@ -67,7 +68,9 @@ class TopFarm(object):
def evaluate(self): def evaluate(self):
t = time.time() 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)) print ("Evaluated in\t%.3fs" % (time.time() - t))
return self.get_cost(), self.turbine_positions return self.get_cost(), self.turbine_positions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment