Data Exchange

Data exchange is done using exported optiSLang built-in types, lists, and dictionaries.

The following types are essential for implementing the data exchange between optiSLang and the node:

The following tables describe the standardized data structures of important objects transferred to several of the plugin functions where they are received in a structure of arguments.

Table 7: Common Incoming Key Word Arguments (KWARGs)

NameTypeDescription
project_working_directoryStringPath of the project's working directory.
modifying_settingPython object

User interface editable settings that require a node reset if changed.

non_modifying_settingsPython object

User interface editable settings that do not require a node reset if changed.

propertiesDictionaryProperties of the node (for example, read_mode).
node_nameStringThe current node's name.
osl_variablesDictionaryDictionary of optiSLang variables. Does not vary per HID.
reference_fileString

Optional: Path to the reference file.

Only available if FileBased is not set to false in the configuration file.

reference_file_is_relative_to_working_directory

Bool

Optional: Whether or not the path to reference file is relative to the working directory.

Only available if FileBased is not set to falsein the configuration file.


Table 8: Additional Incoming KWARGs for the Execute Function

NameTypeDescription
input_containerList of HidSpecificInputDataIntegrationsAggregate of arguments per HID.
registered_inputsDictionaryDictionary of inputs that are registered in optiSLang.
registered_outputsDictionaryDictionary of outputs that are registered in optiSLang.

Table 9: optiSLang Variables That Do Not Vary Per HID

NameTypeDescription
OSL_PROJECT_DIRStringAbsolute path of the current project (*opd).
OSL_NODE_NAMEStringName of the current node.
OSL_RLS_VERStringThe version number of optiSLang.
OSL_RLS_REVStringThe revision number of optiSLang.
OSL_RLS_FLGStringA version suffix which is normally empty unless a specific build is set.

Table 10: optiSLang Variables that Vary Per HID in Execute Function

NameTypeDescription
OSL_DESIGN_NOStringDesign number.
OSL_DESIGN_NAMEStringDesign directory name (for example, Design_0001).
OSL_DESIGN_DIRStringAbsolute path of the current design directory.

Table 11: HidSpecificInputDataIntegrations Attributes

NameTypeDescription
hidHIDHierarchical ID of a design variation, for example, [0.99.4].
hierarchyDictionaryThe node's position within the surrounding systems.
input_slot_valuesDictionaryThe values of the input slots.
osl_variablesDictionaryDictionary of optiSLang variables that vary per HID.
working_directoryStringThe nodes working directory.
reference_fileString

Optional: Path to the reference file.

Only available if FileBased is not set to false in the configuration file.

reference_file_is_relative_to_working_directoryBool

Optional: Whether or not the path to reference file is relative to the working directory.

Only available if FileBased is not set to falsein the configuration file.

parameter_valuesPyOsDesignPointParameter values for a specific HID.

Table 12: HidSpecificOutputDataIntegrations Attributes

NameTypeDescription
hidHIDHierarchical ID of a design variation, for example, [0.99.4].
output_slot_valuesDictionaryA dictionary of name-value pairs that should be written to the output slots specified in the configuration file.
statusRunStatusAn object for documenting success and logging.
responsesPyOsDesignPointThe responses and their values.
adapted_parameter_valuesPyOsDesignPoint

Optional: The parameter values used by the solver.

Normally these are equal to parameter_values of HidSpecificInputDataIntegrations but if the solver requires adaptation (formatting, precision) of the parameters, the integration author can communicate theses parameters and their values to optiSLang. They are then shown in the design table.


Table 13: Contents of InputValueDefinition

NameTypeDescription
nameStringName of the input.
reference_valuePyOsDesignEntryThe input's reference value.
additional_dataDictionary

Specifies additional data (for example, unit). It is then used to create an additional column in the parameter registration in the node edit dialog box.

Tree view: When providing entry_n with n from 1-9 as key and a leaf name as value a tree structure for grouping purposes can be created in the parameter registration.

lower_boundFloatAn object for documenting success and logging.
upper_boundFloatThe node's position within the surrounding systems.
input_slot_ discrete_statesDictionaryThe values of the input slots.
random_variable_typeEnum
meanFloatOptional: Mean of the data.
std_dev_FloatOptional: Spread of the data.

Table 14: Contents of OutputValueDefinition

NameTypeDescription
nameStringName of the output.
reference_valuePyOsDesignEntryThe input's reference value.
additional_dataDictionary

Specifies additional data (for example, unit). It is then used to create an additional column in the parameter registration in the node edit dialog box.

Tree view: When providing entry_n with n from 1-9 as key and a leaf name as value a tree structure for grouping purposes can be created in the parameter registration.