add_strain_maps#

Project.add_strain_maps(project: str, strain_maps: list) int#

Add strain map files to CCAs in a Sherlock project.

Available Since: 2023R2

Parameters:
  • project (str) – Name of the Sherlock project to add strain maps to.

  • strain_maps (list) –

    Strain maps consisting of these properties:

    • strain_map_file: str

      Full path to the CSV file with the strain maps.

    • file_comment: str

      Comment to associate with the file.

    • file_type: StrainMapsFileType

      Strain maps file type. Options are CSV, Excel, and Image.

    • header_row_count: int

      Number of rows before the file’s column header.

    • reference_id_column: str

      Name of the column in the file with reference IDs.

    • strain_column: str

      Name of the column in the file with strain values.

    • strain_units: str

      Strain units. Options are µε and ε.

    • image_file: StrainMapImageFile, optional

      The properties of the strain map file to add.

    • ccas: list, optional

      List of CCA names to assign the file to. When no list is specified, the file is assigned to all CCAs in the project.

Returns:

Status code of the response. 0 for success.

Return type:

int

Examples

>>> from ansys.sherlock.core.launcher import launch_sherlock
>>> from ansys.sherlock.core.types.project_types import (
    BoardBounds,
    ImageBounds,
    ImageFile,
    LegendBounds,
    LegendOrientation,
    StrainMapsFileType,
    StrainMapLegendOrientation,
)
>>> sherlock = launch_sherlock()
>>> sherlock.project.add_strain_maps(
    "Tutorial Project",
        [
            (
                "StrainMap.csv",
                "This is the strain map file for the project",
                StrainMapsFileType.CSV,
                0,
                "refDes",
                "strain",
                "µε",
                ["Main Board"]
            )
        ]
    )
>>> properties = (
        BoardBounds([
            (1.0, 2.0),
            (3.0, 4.0),
            (1.0, 2.0),
            (1.0, 2.0)
        ]),
        "in",
        ImageBounds(0.0, 0.0, 10.0, 8.0),
        LegendBounds(1.0, 2.0, 4.0, 2.0),
        StrainMapLegendOrientation.VERTICAL,
        20.0,
        50.0,
        "µε"
    )
>>> sherlock.project.add_strain_maps(
    "Tutorial Project",
        [
            (
                "StrainMap.jpg",
                "This is the strain map image for the project",
                StrainMapsFileType.IMAGE,
                properties,
                ["Main Board"]
            )
        ]
    )