class pyoptsparse.pyOpt_optimizer.Optimizer(name=None, category=None, defOptions=None, informs=None, **kwargs)[source]

Base optimizer class

name : str

Optimizer name

category : str

Typically local or global

defOptions : dictionary

A dictionary containing the default options

informs : dict

Dictionary of the inform codes

getInform(self, infocode=None)[source]

Get optimizer result inform code at exit

infocode : int

Integer information code

getOption(self, name)[source]

Return the optimizer option value for name

name : str

name of option for which to retrieve value

value : varies

value of option for ‘name’

setOption(self, name, value=None)[source]

Generic routine for all option setting. The routine does error checking on the type of the value.

name : str

Name of the option to set

value : varies

Variable value to set.

pyoptsparse.pyOpt_optimizer.OPT(optName, *args, **kwargs)[source]

This is a simple utility function that enables creating an optimizer based on the ‘optName’ string. This can be useful for doing optimization studies with respect to optimizer since you don’t need massive if-statements.

optName : str

String identifying the optimizer to create

*args, **kwargs : varies

Passed to optimizer creation.

opt : pyOpt_optimizer inherited optimizer

The desired optimizer