@@ -356,7 +356,10 @@ def set_driver(self, opt_prob):
356356 return opt_prob
357357
358358 def set_objective (self , opt_prob ):
359- """Set merit figure. Each objective has its own scaling. Check first for user override
359+ """Set merit figure. Each objective has its own scaling. Check first for user override.
360+
361+ The optimization is always minimizing the objective. If you wish to maximize the objective,
362+ use a negative ref or scaler value in the config.
360363
361364 Args:
362365 opt_prob (openmdao problem instance): openmdao problem instance for
@@ -413,11 +416,12 @@ def set_constraints(self, opt_prob):
413416 opt_prob (openmdao problem instance): openmdao problem instance for
414417 current optimization problem edited to include constraint setup
415418 """
416- for technology , variables in self .config ["constraints" ].items ():
417- for key , value in variables .items ():
418- if value ["flag" ]:
419- value .pop ("flag" )
420- opt_prob .model .add_constraint (f"{ technology } .{ key } " , ** value )
419+ if self .config .get ("constraints" , False ):
420+ for technology , variables in self .config ["constraints" ].items ():
421+ for key , value in variables .items ():
422+ if value ["flag" ]:
423+ value .pop ("flag" )
424+ opt_prob .model .add_constraint (f"{ technology } .{ key } " , ** value )
421425
422426 def set_recorders (self , opt_prob ):
423427 """sets up a recorder for the openmdao problem as desired in the input yaml
0 commit comments