Skip to content

Commit

Permalink
FIX: Miscellaneous fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
drewm102 committed Oct 10, 2024
1 parent 94c2239 commit f87bf42
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 12 deletions.
6 changes: 3 additions & 3 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# For contributions made under a Corporate CLA, the organization is
# added to this file.
#
# If you have contributed to the repository and wish to be added to this file
# please submit a request.
# If you have contributed to the repository and want to be added to this file,
# submit a request.
#
#
ANSYS, Inc.
ANSYS, Inc.
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Authors
# Contributors

## Project Lead

Expand Down
13 changes: 11 additions & 2 deletions src/ansys/edb/core/hierarchy/pin_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
from ansys.edb.core.inner import messages
from ansys.edb.core.inner.conn_obj import ConnObj
from ansys.edb.core.primitive.primitive import PadstackInstance
from ansys.edb.core.session import StubAccessor, StubType
from ansys.edb.core.session import PinGroupServiceStub, StubAccessor, StubType
from ansys.edb.core.terminal.terminals import PinGroupTerminal


class PinGroup(ConnObj):
"""Represents a pin group object."""

__stub = StubAccessor(StubType.pin_group)
__stub: PinGroupServiceStub = StubAccessor(StubType.pin_group)
layout_obj_type = LayoutObjType.PIN_GROUP

@classmethod
Expand Down Expand Up @@ -110,3 +111,11 @@ def remove_pins(self, pins):
List of padstick instances.
"""
self.__stub.RemovePins(messages.pin_group_pins_modify_message(self, pins))

@property
def pin_group_terminal(self):
""":class:`.PinGroupTerminal`: Terminal this pin group is part of.
This property is read-only.
"""
return PinGroupTerminal(self.__stub.GetPinGroupTerminal(self.msg))
2 changes: 1 addition & 1 deletion src/ansys/edb/core/inner/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def polygon_data_with_circle_message(pd, center, radius):

def polygon_data_with_point_message(pd, point):
"""Convert to a ``PolygonDataWithPointMessage`` object."""
return PolygonDataWithPointMessage(polygon=polygon_data_message(pd), point=point_message(point))
return PolygonDataWithPointMessage(target=polygon_data_message(pd), point=point_message(point))


def polygon_data_with_points_message(pd, point=None, polygon=None):
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/primitive/primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ def _set_elevation_message(b, cell_instance, lyrname):
)


class PadstackInstance(Primitive):
class PadstackInstance(conn_obj.ConnObj):
"""Representis a padstack instance object."""

__stub: padstack_instance_pb2_grpc.PadstackInstanceServiceStub = StubAccessor(
Expand Down
1 change: 0 additions & 1 deletion src/ansys/edb/core/simulation_setup/simulation_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ def _msg_to_interpolating_sweep_data(msg):
interp_sweep_data.use_full_basis = msg.interp_use_full_basis
interp_sweep_data.fast_sweep = msg.fast_sweep
interp_sweep_data.adaptive_sampling = msg.adaptive_sampling
interp_sweep_data.enforce_dc_and_causality = msg.enforce_dc_and_causality
interp_sweep_data.matrix_conv_entry_list = map_list(
msg.matrix_conv_entry_list, _msg_to_matrix_convergence_entry
)
Expand Down
20 changes: 20 additions & 0 deletions src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ class SParamDCBehavior(Enum):
OPEN_DC = pb.OPEN_DC


class ACDCMergeMode(Enum):
"""Provides an enum representing AC/DC merge mode types."""

DEFAULT = pb.DEFAULT
FAST = pb.FAST


class SIWaveSimulationSettings(SimulationSettings):
"""Represents SIWave simulation settings."""

Expand Down Expand Up @@ -259,6 +266,19 @@ def mesh_frequency(self):
def mesh_frequency(self, mesh_frequency):
self.__stub.SetMeshFrequency(messages.string_property_message(self, mesh_frequency))

@property
def ac_dc_merge_mode(self):
""":obj:`int`: AC/DC merge mode."""
return ACDCMergeMode(self.__stub.GetAcDcMergeMode(self.msg).ac_dc_merge_mode)

@ac_dc_merge_mode.setter
def ac_dc_merge_mode(self, ac_dc_merge_mode):
self.__stub.SetAcDcMergeMode(
pb.ACDCMergeModePropertyMessage(
target=self.msg, ac_dc_merge_mode=ac_dc_merge_mode.value
)
)

@property
def return_current_distribution(self):
""":obj:`bool`: Flag indicating if return current distribution is traced."""
Expand Down
6 changes: 3 additions & 3 deletions src/ansys/edb/core/terminal/terminals.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def layer(self):

@layer.setter
def layer(self, value):
self.params = (messages.edb_obj_message(value), self.point)
self.params = (value, self.point)

@property
def point(self):
Expand All @@ -648,7 +648,7 @@ def point(self):

@point.setter
def point(self, value):
self.params = (self.layer, messages.point_message(value))
self.params = (self.layer, value)


class PadstackInstanceTerminal(Terminal):
Expand Down Expand Up @@ -695,7 +695,7 @@ def params(self):

res = self.__stub.GetParameters(self.msg)
padstack_instance = primitive.PadstackInstance(res.padstack_instance)
layer = Layer(res.layer).cast()
layer = Layer(res.layer.id).cast()
return padstack_instance, layer

@params.setter
Expand Down

0 comments on commit f87bf42

Please sign in to comment.