launch_acp#
- ansys.acp.core.launch_acp(config=None, launch_mode=None, timeout=30.0, auto_transfer_files=True)#
Launch an ACP instance.
Launch the ACP gRPC server with the given configuration. If no configuration is provided, the configured default is used.
Warning
Do not execute this function with untrusted input parameters. See the security guide for details.
- Parameters:
config (DirectLaunchConfig | DockerComposeLaunchConfig | None) – The configuration used for launching ACP. If unspecified, the default for the given launch mode is used.
launch_mode (LaunchMode | None) – Specifies which ACP launcher is used. One of
direct
,docker_compose
, orconnect
. If unspecified, the configured default is used. If no default is configured,direct
is used.timeout (float | None) – Timeout to wait until ACP responds. If
None
is specified, the check that ACP has started is skipped.auto_transfer_files (bool) – Determines whether input and output files are automatically transferred (up- or downloaded) to the server. If
True
, files are automatically transferred, and all paths in the import or export methods are local paths. IfFalse
, file transfer needs to be handled manually, and the paths are relative to the server working directory. If thelaunch_mode
is"direct"
, this only has an effect if the current working directory is changed after launching the server.
- Returns:
ACP instance which can be used to control the server, and instantiate objects on the server.
- Return type:
Examples using launch_acp#
PyMechanical to CDB shell workflow
CDB to PyMechanical shell workflow