Python DOE Technique

The Python DOE technique provides a convenient way for you to develop your own DOE algorithm using the Python programming language outside of Isight and still make use of Isight's integration and automation capabilities. The design matrix can be generated by a user-provided algorithm, Isight allowing you to execute the DOE study (automatically evaluate all the design points) and analyze the results.

This technique requires you to implement a defined set of functions in your Python routine. All the functions must be mandatorily implemented. When Isight infrastructure calls these functions, either a design time interface object or a runtime interface object, as applicable, is passed to the functions as an argument. The APIs available on these interface objects are documented in this section subsequently.

This page discusses:

Contract of functions required to be implemented in Python routine

Function What should you implement in this function? When is it called?
defineTechniqueOptions(dt_interface) You should add the custom technique options for the DOE algorithm using the API exposed by the design time interface object. The specified technique options will be added to the technique and will become visible in the Technique Options table in the DOE component editor.
  1. When you select a Python DOE Routine from the DOE editor
  2. When the set("pythonDOETechnique", String filePath) method of DOE Component API is called
computeNumberOfExperiements(rt_interface) You should compute the number of experiments based on the values of technique options, factors, and bounds on factors. Then you should return the computed number of experiments. The Isight infrastructure uses this return value to initialize arrays of required size to hold the design matrix generated by the generateDesignMatrix() function.

The values of technique options, factors, and bounds on factors are accessible from the runtime interface object.

Whenever design matrix is generated; for example,
  1. When Generate is clicked in the Design Matrix tab of the DOE component editor
  2. When the model containing this technique is executed
generateDesignMatrix(rt_interface) You should generate the design matrix based on the values of technique options, factors, and bounds on factors.

The values of technique options, factors, and bounds on factors are accessible from the runtime interface object. The number of design points to be generated is also accessible from the runtime interface object, and it will be identical to the value returned by a prior call to the computeNumberOfExperiements() function.

The generated design matrix should be populated in the design matrix array accessible from the interface object.

Whenever design matrix is generated; for example,
  1. When Generate is clicked in Design Matrix tab of the DOE component editor
  2. When the model containing this technique is executed

APIs exposed by the design time interface object

Method Arguments (in the required sequence) Return value Description
addOption() name: name of the custom technique option as a string.

type: data type of the custom technique option as a string. It must be one of the following: "Integer", "Real", "Boolean", and "String".

defaultValue: the default value of the custom technique option; must be provided as a string.

limit: an object representing either a discrete limit or a range limit.

None Adds a new custom technique option having the specified name, data type, default value, and limit.

You should use either createDiscreteLimit() or createRangeLimit() API to create a limit object.

To create an unbounded option, you should use a range limit that has no bounds. Refer the documentation of createRangeLimit() API for more details.

createDiscreteLimit() This method does not take any arguments. A discrete limit object. Returns a discrete limit object. At the time of creation this object does not contain any allowed value. You should add the allowed values to this object using addAllowedValue() API. For more details, refer the documentation of discrete limit object, available below.

A discrete limit can be used for a technique option that has any of "Integer", "Real", "String", and "Boolean" data type.

createRangeLimit() lowerBound: the lower bound value as a string.

lbInclusive: whether or not the lower bound value itself is allowed as a value of the technique option. It should be a boolean value: True or False.

upperBound: the upper bound value as a string.

ubInclusive: whether or not the upper bound value itself is allowed as a value of the technique option. It should be a boolean value: True or False.

A range limit object Returns a range limit object. The returned object is immutable.

It makes sense to use range limit for technique options that have only "Integer" or "Real" data types.

If lowerBound and/or upperBound is specified as None, the technique option is treated as unbounded on the corresponding end of the range.

logDebug() message: the message to be logged as a string value None Logs the message to Isight system log as a debug-level message.
logInfo() message: the message to be logged as a string value None Logs the message to Isight system log as an information-level message.
logWarn() message: the message to be logged as a string value None Logs the message to Isight system log as a warning-level message.
logError() message: the message to be logged as a string value None Logs the message to Isight system log as an error-level message.
logSysError() message: the message to be logged as a string value None Logs the message to Isight system log as a system-error-level message.
logAlways() message: the message to be logged as a string value None Logs the message to Isight system log as an always-level message.

APIs exposed by discrete limit object

Method Arguments (in the required sequence) Return value Description
addAllowedValue() allowedValue: a specific value to be permitted as an allowed value. The discrete limit object itself on which this method is called. Adds the supplied value as an allowed value to this discrete limit object, and returns this object. This allows chaining of multiple calls to addAllowedValue() method. For example, limit.addAllowedValue("1").addAllowedValue("3").

APIs exposed by the runtime interface object

Method Arguments (in the required sequence) Return value Description
getFactors() This method does not take any arguments. A list of objects, each representing a DOE factor Returns a list of objects, each representing a DOE factor. Each object encapsulates the configuration of corresponding DOE factor in Isight DOE component. Factor objects are immutable.

For more details about the API exposed by factor objects, refer the documentation of factor object, available below.

getTechniqueOptions() This method does not take any arguments. A dictionary of technique option names mapped to option values. Returns a dictionary of technique option names mapped to the corresponding technique option values. Both the names and values are string values.
getNumPoints() This method does not take any arguments. The number of experiments to be executed as an integer value. Returns the number of design points to be generated by the DOE algorithm, as an integer value. This value is identical to the value returned by computeNumberOfExperiements() function in the user-supplied Python routine.
setNumPoints() - -
Warning: This API is for internal use of the Isight infrastructure. You should never call this API. Calling this API from a user-defined Python routine will result in undefined behavior.
getMatrix() This method does not take any arguments. A 2D array of string values Returns a 2D array of string values. The number of rows and columns in the array correspond to the value returned by getNumPoints() API and the number of factors selected in the Isight DOE component, respectively.

You are expected to populate the DOE matrix that will be generated in the generateDesignMatrix() function in a Python routine in to this array.

logDebug() message: The message to be logged as a string value None Logs the message to Isight system log or job log, as applicable, as a debug-level message.
logInfo() message: The message to be logged as a string value None Logs the message to an Isight system log or job log, as applicable, as an information-level message.
logWarn() message: the message to be logged as a string value None Logs the message to an Isight system log or job log, as applicable, as a warning-level message.
logError() message: the message to be logged as a string value None Logs the message to Isight system log or job log, as applicable, as an error-level message.
logSysError() message: the message to be logged as a string value None Logs the message to Isight system log or job log, as applicable, as a system-error-level message.
logAlways() message: the message to be logged as a string value None Logs the message to Isight system log or job log, as applicable, as an always-level message.

APIs exposed by factor object

Method Arguments (in the required sequence) Return value Description
getName() This method does not take any arguments. Name of this factor as a string value. Returns the name of this factor.
getType() This method does not take any arguments. Data type of this factor as a string value. Returns the data type of this factor. It will be either "Integer" or "Real" because "String" or "Boolean" type factors are not allowed in the Python DOE technique.
getLowerBound() This method does not take any arguments. Lower bound of this factor as a string value. Returns the lower bound of this factor as a string value. This value is as defined in the Factors tab of the Isight DOE component.
getUpperBound() This method does not take any arguments. Upper bound of this factor as a string value. Returns the upper bound of this factor as a string value. This value is as defined in the Factors tab of the Isight DOE component.