options.py¶
OptionsDictionary class definition.
-
class
openmdao.util.options.
OptionsDictionary
(read_only=True)[source]¶ Bases:
object
A dictionary for storing options for components/drivers/solvers. It is generally used like a standard Python dictionary, except that 1) you can only set or get keys that have been registered with add_option, and 2) type is enforced
Args: read_only : bool
If this is True, these options should not be modified at run time, and should not be printed in the docs.
.
-
add_option
(name, value, low=None, high=None, values=None, desc='')[source]¶ Adds an option to this options dictionary.
Args: name : str
Name of the option.
value : object
Default value for this option. The type of this value will be enforced.
low : float, optional
Lower bounds for a float value.
high : float, optional
Upper bounds for a float value.
values : list, optional
List of all possible values for an enumeration option.
desc : str, optional
String containing documentation of this option.
-