Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/source/api/launcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ The ``launcher`` module launches the Sherlock gRPC server and a Sherlock client.
:toctree: _autosummary

ansys.sherlock.core.launcher.launch_sherlock
ansys.sherlock.core.launcher.connect_grpc_channel

4 changes: 2 additions & 2 deletions src/ansys/sherlock/core/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ def run_strain_map_analysis(
strain_map_analyses : list
List of analyses consisting of these properties:

- analysis_type : RunStrainMapAnalysisRequest.StrainMapAnalysis.AnalysisType
- analysis_type : RunStrainMapAnalysisRequestAnalysisType
Type of analysis to run.
- event_strain_maps : list
List of the strain maps assigned to the desired life cycle events for
Expand Down Expand Up @@ -1296,7 +1296,7 @@ def run_strain_map_analysis(
"AssemblyTutorial",
"Main Board",
[[
analysis_request.StrainMapAnalysis.AnalysisType.RandomVibe,
RunStrainMapAnalysisRequestAnalysisType.RANDOM_VIBE,
[["Phase 1", "Random Vibe", "TOP", "MainBoardStrain - Top"],
["Phase 1", "Random Vibe", "BOTTOM", "MainBoardStrain - Bottom"],
["Phase 1", "Random Vibe", "TOP", "MemoryCard1Strain", "Memory Card 1"]],
Expand Down
19 changes: 12 additions & 7 deletions src/ansys/sherlock/core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ def launch_sherlock(
IP address to start gRPC on. The default is ``"127.0.0.1"``, which
is the IP address for the local host.
port : int, optional
Port number for the connection. If no port is specified, ``9090``
is used.
Port number for the connection.
single_project_path : str, optional
Path to the Sherlock project if invoking Sherlock in the single-project mode.
The default is ``""``.
sherlock_cmd_args : str, optional
Additional command arguments for launching Sherlock. The default is ``""``.
Additional command arguments for launching Sherlock.

Returns
-------
Expand All @@ -75,7 +73,7 @@ def launch_sherlock(
return None

try:
args = _get_sherlock_exe_path() + " " + "-grpcPort=" + str(port)
args = _get_sherlock_exe_path() + " -grpcPort=" + str(port)
if single_project_path != "":
args = f'{args} -singleProject "{single_project_path}"'
if sherlock_cmd_args != "":
Expand Down Expand Up @@ -108,9 +106,16 @@ def launch_sherlock(


def connect_grpc_channel(port=SHERLOCK_DEFAULT_PORT):
"""Create a gRPC connection to a specified port and return the ``sherlock``connection object.
"""Create a gRPC connection to a specified port and return the ``Sherlock`` connection object.

The ``sherlock``connection object is used to invoke the APIs from their respective services.
The ``Sherlock`` connection object is used to invoke the APIs from their respective services.
This can be used to connect to the Sherlock instance that is already running with the specified
port.

Parameters
----------
port : int, optional
Port number for the connection.

Returns
-------
Expand Down
20 changes: 10 additions & 10 deletions tests/test_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def helper_test_add_potting_region(layer):
"cca_name": "Main Board",
"potting_id": "Test Region",
"side": "TOP",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand Down Expand Up @@ -74,7 +74,7 @@ def helper_test_add_potting_region(layer):
{
"potting_id": "Test Region",
"side": "TOP",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand All @@ -95,7 +95,7 @@ def helper_test_add_potting_region(layer):
"cca_name": "",
"potting_id": "Test Region",
"side": "TOP",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand All @@ -115,7 +115,7 @@ def helper_test_add_potting_region(layer):
"cca_name": "Test Card",
"potting_id": "Test Region",
"side": "TOP",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand All @@ -134,7 +134,7 @@ def helper_test_add_potting_region(layer):
"cca_name": "Test Card",
"potting_id": "Test Region",
"side": "TOP",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand All @@ -155,7 +155,7 @@ def helper_test_add_potting_region(layer):
"cca_name": "Test Card",
"potting_id": "Test Region",
"side": "TOP",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand All @@ -177,7 +177,7 @@ def helper_test_add_potting_region(layer):
"cca_name": "Test Card",
"potting_id": "Test Region",
"side": "TOP",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand All @@ -199,7 +199,7 @@ def helper_test_add_potting_region(layer):
"cca_name": "Test Card",
"potting_id": "Test Region",
"side": "TOP",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand All @@ -224,7 +224,7 @@ def helper_test_add_potting_region(layer):
"cca_name": "Main Board",
"potting_id": potting_id,
"side": "INVALID",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand All @@ -246,7 +246,7 @@ def helper_test_add_potting_region(layer):
"cca_name": "Main Board",
"potting_id": potting_id,
"side": "TOP",
"material": "epoxyencapsulant",
"material": "COPPER",
"potting_units": "in",
"thickness": 0.1,
"standoff": 0.2,
Expand Down