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:
HidSpecificInputDataIntegrations: An aggregate of various input data which may differ for each Hierarchical ID (HID).
HidSpecificOutputDataIntegrations: An aggregate of various output data which may differ for each HID.
RunStatus: An object for documenting success and logging.
InputValueDefinition: An object for defining inputs.
OutputValueDefinition: An object for defining outputs.
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)
Name | Type | Description |
---|---|---|
project_working_directory | String | Path of the project's working directory. |
modifying_setting | Python object | User interface editable settings that require a node reset if changed. |
non_modifying_settings | Python object | User interface editable settings that do not require a node reset if changed. |
properties | Dictionary | Properties of the node (for example, read_mode). |
node_name | String | The current node's name. |
osl_variables | Dictionary | Dictionary of optiSLang variables. Does not vary per HID. |
reference_file | String | Optional: Path to the reference file. Only available if |
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 |
Table 8: Additional Incoming KWARGs for the Execute Function
Name | Type | Description |
---|---|---|
input_container | List of HidSpecificInputDataIntegrations | Aggregate of arguments per HID. |
registered_inputs | Dictionary | Dictionary of inputs that are registered in optiSLang. |
registered_outputs | Dictionary | Dictionary of outputs that are registered in optiSLang. |
Table 9: optiSLang Variables That Do Not Vary Per HID
Name | Type | Description |
---|---|---|
OSL_PROJECT_DIR | String | Absolute path of the current project (*opd). |
OSL_NODE_NAME | String | Name of the current node. |
OSL_RLS_VER | String | The version number of optiSLang. |
OSL_RLS_REV | String | The revision number of optiSLang. |
OSL_RLS_FLG | String | A version suffix which is normally empty unless a specific build is set. |
Table 10: optiSLang Variables that Vary Per HID in Execute Function
Name | Type | Description |
---|---|---|
OSL_DESIGN_NO | String | Design number. |
OSL_DESIGN_NAME | String | Design directory name (for example, Design_0001). |
OSL_DESIGN_DIR | String | Absolute path of the current design directory. |
Table 11: HidSpecificInputDataIntegrations Attributes
Name | Type | Description |
---|---|---|
hid | HID | Hierarchical ID of a design variation, for example, [0.99.4]. |
hierarchy | Dictionary | The node's position within the surrounding systems. |
input_slot_values | Dictionary | The values of the input slots. |
osl_variables | Dictionary | Dictionary of optiSLang variables that vary per HID. |
working_directory | String | The nodes working directory. |
reference_file | String | Optional: Path to the reference file. Only available if |
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 |
parameter_values | PyOsDesignPoint | Parameter values for a specific HID. |
Table 12: HidSpecificOutputDataIntegrations Attributes
Name | Type | Description |
---|---|---|
hid | HID | Hierarchical ID of a design variation, for example, [0.99.4]. |
output_slot_values | Dictionary | A dictionary of name-value pairs that should be written to the output slots specified in the configuration file. |
status | RunStatus | An object for documenting success and logging. |
responses | PyOsDesignPoint | The responses and their values. |
adapted_parameter_values | PyOsDesignPoint | Optional: The parameter values used by the solver. Normally these are equal to |
Table 13: Contents of InputValueDefinition
Name | Type | Description |
---|---|---|
name | String | Name of the input. |
reference_value | PyOsDesignEntry | The input's reference value. |
additional_data | Dictionary | 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_bound | Float | An object for documenting success and logging. |
upper_bound | Float | The node's position within the surrounding systems. |
input_slot_ discrete_states | Dictionary | The values of the input slots. |
random_variable_type | Enum | |
mean | Float | Optional: Mean of the data. |
std_dev_ | Float | Optional: Spread of the data. |
Table 14: Contents of OutputValueDefinition
Name | Type | Description |
---|---|---|
name | String | Name of the output. |
reference_value | PyOsDesignEntry | The input's reference value. |
additional_data | Dictionary | 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. |