Runtime API#

This section documents GLOW’s Runtime API which enables the integration of a GLOW Solution (a Guided Workflow Application) with the GLOW infrastructure.

ansys.saf.glow.runtime.glow_main(definition_module: ModuleType, ui_app_module: ModuleType | None = None) → None#

Implement a Solution component process requiring a Solution derived Solution definition. The process will be orchestrated by GLOW which will pass command line arguments to enable the process to perform the required functionality. glow_main will parse those command line arguments.

From the perspective of a Solution developer the call to glow_main is the means for registering a Solution (a class derived from Solution) and, optionally, a UI for that Solution with the GLOW infrastructure.

glow_main should be called as the only or core part of a module designed to run in the python top-level code environment.

The saf run command searches ansys.solutions for a module that imports glow_main (as glow_main) and executes that module in the python top-level code environment.

The saf run command, with a --no-ui argument, can run the Solution without a UI if ui_app_module is not present.

The GLOW Solution template includes a main module that satisfies the requirements of saf run. The Solution Developer’s guide section on solution creation contains more information on the Solution template.

Parameters:
definition_moduleModuleType

The python module object that contains a single class derived from Solution.

ui_app_moduleModuleType, optional

The python module object that contains an app variable referring to a Dash app object. This module is required to enable the GLOW infrastructure to orchestrate a UI for the Solution.

Notes

The module containing glow_main will potentially be executed by the orchestrator in a number of different concurrent processes in the same Solution stack.