diff --git a/doc/source/api/launcher.rst b/doc/source/api/launcher.rst index 7092ab9a9..d4eb4c074 100644 --- a/doc/source/api/launcher.rst +++ b/doc/source/api/launcher.rst @@ -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 + diff --git a/src/ansys/sherlock/core/analysis.py b/src/ansys/sherlock/core/analysis.py index f1a803910..7b963587c 100644 --- a/src/ansys/sherlock/core/analysis.py +++ b/src/ansys/sherlock/core/analysis.py @@ -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 @@ -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"]], diff --git a/src/ansys/sherlock/core/launcher.py b/src/ansys/sherlock/core/launcher.py index 68d8dc106..4e90f994b 100644 --- a/src/ansys/sherlock/core/launcher.py +++ b/src/ansys/sherlock/core/launcher.py @@ -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 ------- @@ -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 != "": @@ -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 ------- diff --git a/tests/test_layer.py b/tests/test_layer.py index 3cf191a37..17c9698a4 100644 --- a/tests/test_layer.py +++ b/tests/test_layer.py @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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, @@ -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,