Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5b59ff6
Added import thermal signal API
ansys-pwalters Jul 25, 2025
f83bc2c
Added import thermal signal API
ansys-pwalters Jul 25, 2025
11e6085
Added time filtering to importThermalSignal API.
ansys-pwalters Aug 1, 2025
31240d6
Merge remote-tracking branch 'origin/main'
ansys-pwalters Aug 1, 2025
5fb5ff1
Added time filtering to importThermalSignal API.
ansys-pwalters Aug 12, 2025
749e2a7
Merge remote-tracking branch 'origin/main'
ansys-pwalters Aug 12, 2025
1938065
Merge remote-tracking branch 'origin/main'
ansys-pwalters Aug 28, 2025
fc9b6e8
Updated rainflow cycle binning to use separate binning parameters for…
ansys-pwalters Sep 3, 2025
f6add2d
Merge remote-tracking branch 'origin/main'
ansys-pwalters Sep 29, 2025
7a807ee
Added pcb_material_elasticity option to export_FEA_model()
ansys-pwalters Oct 2, 2025
5c967d0
Merge remote-tracking branch 'origin/main'
ansys-pwalters Nov 14, 2025
3811aa1
Updated lifecycle load profile methods to support CSV file imports fr…
ansys-pwalters Nov 17, 2025
06ef2fb
Updated lifecycle load profile methods to support CSV file imports fr…
ansys-pwalters Nov 17, 2025
04e2285
Updated lifecycle load profile methods to support CSV file imports fr…
ansys-pwalters Nov 17, 2025
8b32174
Merge remote-tracking branch 'origin/main'
ansys-pwalters Nov 19, 2025
f1214e7
Merge remote-tracking branch 'origin/main'
ansys-pwalters Nov 20, 2025
3587ffd
Merge remote-tracking branch 'origin/main'
ansys-pwalters Nov 21, 2025
8cab0bb
Added get_mount_point_props and update_mount_points methods.
ansys-pwalters Nov 21, 2025
128a334
chore: adding changelog file 672.miscellaneous.md [dependabot-skip]
pyansys-ci-bot Nov 21, 2025
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
1 change: 1 addition & 0 deletions doc/changelog.d/672.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Feat: added get_mount_point_props and update_mount_points methods.
3 changes: 3 additions & 0 deletions doc/source/api/layer_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ Classes used for the Layer API.
CopyPottingRegionRequest
DeletePottingRegionRequest
GetICTFixturesPropertiesRequest
GetMountPointsPropertiesRequest
GetTestPointPropertiesRequest
ICTFixtureProperties
MountPointProperties
PolygonalShape
RectangularShape
SlotShape
Expand All @@ -27,6 +29,7 @@ Classes used for the Layer API.
PottingRegionUpdateData
TestPointProperties
UpdateICTFixturesRequest
UpdateMountPointsRequest
UpdatePottingRegionRequest
UpdateTestPointsRequest

Expand Down
96 changes: 96 additions & 0 deletions src/ansys/sherlock/core/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
CopyPottingRegionRequest,
DeletePottingRegionRequest,
GetICTFixturesPropertiesRequest,
GetMountPointsPropertiesRequest,
GetTestPointPropertiesRequest,
PCBShape,
PolygonalShape,
RectangularShape,
SlotShape,
UpdateICTFixturesRequest,
UpdateMountPointsRequest,
UpdatePottingRegionRequest,
UpdateTestPointsRequest,
)
Expand Down Expand Up @@ -2239,3 +2241,97 @@ def update_ict_fixtures(
update_request = request._convert_to_grpc()
response = self.stub.updateICTFixtures(update_request)
return response

@require_version(261)
def get_mount_point_props(
self, request: GetMountPointsPropertiesRequest
) -> SherlockLayerService_pb2.GetMountPointsPropertiesResponse:
"""
Return the properties for each mount point given a comma-separated list of mount point IDs.

Available Since: 2026R1

Parameters
----------
request: GetmountPointsPropertiesRequest
Contains all the information needed to return the properties for one or more mount
points.

Returns
-------
SherlockCommonService_pb2.GetMountPointsPropertiesResponse
Properties for each mount point that correspond to the reference designators.

Examples
--------
>>> from ansys.sherlock.core.launcher import launch_sherlock
>>> from ansys.sherlock.core.types.layer_types import GetMountPointsPropertiesRequest
>>> sherlock = launch_sherlock()
>>> request = layer_types.GetMountPointsPropertiesRequest(
>>> project = "Tutorial Project"
>>> cca_name = "Main Board"
>>> mount_point_ids = "MP1,MP2"
>>> )
>>> response = layer.get_mount_point_props(request)
"""
if not self._is_connection_up():
raise SherlockNoGrpcConnectionException()

return self.stub.getMountPointsProperties(request._convert_to_grpc())

@require_version(261)
def update_mount_points(
self, request: UpdateMountPointsRequest
) -> SherlockLayerService_pb2.UpdateMountPointsResponse:
"""Update mount point properties of a CCA from input parameters.

Available Since: 2026R1

Parameters
----------
request: UpdateMountPointsRequest
Contains all the information needed to update the properties for one or more
mount points.

Returns
-------
SherlockCommonService_pb2.UpdateMountPointsResponse
A status code and message for the update mount points request.

Examples
--------
>>> from ansys.sherlock.core.launcher import launch_sherlock
>>> from ansys.sherlock.core.types.layer_types import UpdateMountPointsRequest,
>>> MountPointProperties
>>> sherlock = connect()
>>> mount_point = MountPointProperties(
>>> id="MP1",
>>> type="Mount Pad",
>>> shape="Rectangular",
>>> units="mm",
>>> side="BOTTOM",
>>> height=1.0,
>>> material="GOLD",
>>> state="DISABLED",
>>> x=0.3,
>>> y=-0.4,
>>> length=1.0,
>>> width=0.2,
>>> diameter=0.0,
>>> nodes="",
>>> rotation=45,
>>> polygon="",
>>> boundary="Outline",
>>> constraints="X-axis translation|Z-axis translation",
>>> chassis_material="SILVER",
>>> )
>>> response = sherlock.layer.update_mount_points(UpdateMountPointsRequest(
>>> project="Tutorial Project",
>>> cca_name="Main Board",
>>> update_mount_points=[mount_point],
>>> ))
"""
if not self._is_connection_up():
raise SherlockNoGrpcConnectionException()

return self.stub.updateMountPoints(request._convert_to_grpc())
145 changes: 145 additions & 0 deletions src/ansys/sherlock/core/types/layer_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,3 +574,148 @@ def _convert_to_grpc(self) -> SherlockLayerService_pb2.UpdateICTFixturesRequest:
for update_fixture in self.update_fixtures:
request.ICTFixtureProperties.append(update_fixture._convert_to_grpc())
return request


class MountPointProperties(BaseModel):
"""Contains the properties of a mount point."""

id: str
"""ID"""
type: str
"""Type"""
shape: str
"""Shape type"""
units: str
"""Units"""
x: float
"""Center X"""
y: float
"""Center Y"""
length: float
"""Length"""
width: float
"""Width"""
diameter: float
"""Diameter"""
nodes: str
"""Number of nodes"""
rotation: float
"""Degrees of rotation"""
side: str
"""Side"""
height: float
"""Height"""
material: str
"""Material"""
boundary: str
"""Boundary point(s)"""
constraints: str
"""FEA constraints"""
polygon: str
"""Coordinates of points"""
state: str
"""State"""
chassis_material: str
"""Chassis material"""

def _convert_to_grpc(self) -> SherlockLayerService_pb2.MountPointProperties:
grpc_mount_point_data = SherlockLayerService_pb2.MountPointProperties()

grpc_mount_point_data.ID = self.id
grpc_mount_point_data.type = self.type
grpc_mount_point_data.shape = self.shape
grpc_mount_point_data.units = self.units
grpc_mount_point_data.x = str(self.x)
grpc_mount_point_data.y = str(self.y)
grpc_mount_point_data.length = str(self.length)
grpc_mount_point_data.width = str(self.width)
grpc_mount_point_data.diameter = str(self.diameter)
grpc_mount_point_data.nodes = self.nodes
grpc_mount_point_data.rotation = str(self.rotation)
grpc_mount_point_data.side = self.side
grpc_mount_point_data.height = str(self.height)
grpc_mount_point_data.material = self.material
grpc_mount_point_data.boundary = self.boundary
grpc_mount_point_data.constraints = self.constraints
grpc_mount_point_data.polygon = self.polygon
grpc_mount_point_data.state = self.state
grpc_mount_point_data.chassisMaterial = self.chassis_material

return grpc_mount_point_data

@field_validator("type", "shape", "units", "side", "state")
@classmethod
def str_validation(cls, value: str, info: ValidationInfo):
"""Validate string fields listed."""
return basic_str_validator(value, info.field_name)


class GetMountPointsPropertiesRequest(BaseModel):
"""Return the properties for each mount point given a comma-separated list of mount point ids.""" # noqa: E501

project: str
"""Name of the project."""
cca_name: str
"""Name of the CCA containing the mount point properties to return."""
mount_point_ids: Optional[str] = None
"""Optional Param: Comma-separated list of mount point ids representing one or more mount
points. If this parameter is not included, then the entire list of mount points
for a given CCA will have their properties returned.
"""

@field_validator("project", "cca_name", "mount_point_ids")
@classmethod
def str_validation(cls, value: str, info: ValidationInfo):
"""Validate string fields listed."""
return basic_str_validator(value, info.field_name)

@field_validator("mount_point_ids")
@classmethod
def optional_str_validation(cls, value: Optional[str], info):
"""Allow the mount_point_ids to not be set, i.e., None."""
return optional_str_validator(value, info.field_name)

def _convert_to_grpc(self) -> SherlockLayerService_pb2.GetMountPointsPropertiesRequest:
request = SherlockLayerService_pb2.GetMountPointsPropertiesRequest()
request.project = self.project
request.ccaName = self.cca_name
if self.mount_point_ids is not None:
request.mountPointIDs = self.mount_point_ids
return request


class UpdateMountPointsRequest(BaseModel):
"""Contains the properties of a mount point update per project."""

project: str
"""Name of the Sherlock project."""
cca_name: str
"""Name of the Sherlock CCA."""
mount_points: list[MountPointProperties]
"""List of mount points with their properties to update"""

@field_validator("project", "cca_name")
@classmethod
def str_validation(cls, value: str, info: ValidationInfo):
"""Validate string fields listed."""
return basic_str_validator(value, info.field_name)

@field_validator("mount_points")
@classmethod
def list_validation(cls, value: list, info: ValidationInfo):
"""Validate that mount_points is not empty."""
if not value:
raise ValueError(f"{info.field_name} must contain at least one item.")
return value

def _convert_to_grpc(self) -> SherlockLayerService_pb2.UpdateMountPointsRequest:
request = SherlockLayerService_pb2.UpdateMountPointsRequest()
request.project = self.project
request.ccaName = self.cca_name
if self.mount_points is not None:
for mount_point in self.mount_points:
request.mountPointsProperties.append(mount_point._convert_to_grpc())
else:
raise ValueError("mount_points is invalid because it is None or empty.")

return request
Loading
Loading