run_analysis#

Analysis.run_analysis(project, cca_name, analyses)#

Run one or more Sherlock analyses.

Available Since: 2021R1

Parameters:
  • project (str) – str: Name of the Sherlock project.

  • cca_name (str) – str: Name of the CCA.

  • analyses (list[tuple[int, tuple[str, str]]]) –

    list of elements: - elements: list[ tuple[ SherlockAnalysisService_pb2.RunAnalysisRequest. Analysis.AnalysisType.ValueType, tuple[str, str], ] ] Tuples (type, event)

    • analysis_type: SherlockAnalysisService_pb2.RunAnalysisRequest. Analysis.AnalysisType.ValueType

      Type of analysis to run.

    • event: list[tuple[str, str]]

      Tuples (phase_name, event_name)

      • phase_name: str

        Name of the life cycle phase.

      • event_name: str

        Name of the life cycle event.

Return type:

int

Returns:

:
int

Status code of the response. 0 for success.

Examples

>>> from ansys.sherlock.core import launcher
>>> sherlock, install_dir = launcher.launch_and_connect(transport_mode="wnua")
>>> sherlock.project.import_odb_archive(
>>>    "ODB++ Tutorial.tgz",
>>>    True,
>>>    True,
>>>    True,
>>>    True,
>>>    project="Test",
>>>    cca_name="Card",
>>> )
>>> sherlock.analysis.run_analysis(
>>>    "Test",
>>>    "Card",
>>>    [
>>>        (
>>>            SherlockAnalysisService_pb2.RunAnalysisRequest.
>>>            Analysis.AnalysisType.NaturalFreq,
>>>            [
>>>                ("Phase 1", ["Harmonic Event"])
>>>            ],
>>>        )
>>>    ]
>>> )