Setup#

This prepares the environment for running the examples.

Description#

Perform the following steps to set up the environment: - Launch Sherlock. - Store the Sherlock tutorial path.

import os
import sys

# Add the 'examples' directory to the Python path to allow importing files in that directory.
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(os.getcwd()))))

from examples.examples_globals import store_sherlock_tutorial_path

from ansys.sherlock.core import launcher

Launch Sherlock#

Launch the Sherlock service and ensure proper initialization.

sherlock, ansys_install_path = launcher.launch_and_connect(
    port=9092,
    # sherlock_command_args="-noGUI",
)

store_sherlock_tutorial_path(ansys_install_path)