From f87bf42e62e99dbca8970d165f8fd4bf3c10183a Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 10 Oct 2024 15:05:47 -0600 Subject: [PATCH] FIX: Miscellaneous fixes --- AUTHORS | 6 +++--- CONTRIBUTORS.md | 2 +- src/ansys/edb/core/hierarchy/pin_group.py | 13 ++++++++++-- src/ansys/edb/core/inner/messages.py | 2 +- src/ansys/edb/core/primitive/primitive.py | 2 +- .../core/simulation_setup/simulation_setup.py | 1 - .../siwave_simulation_settings.py | 20 +++++++++++++++++++ src/ansys/edb/core/terminal/terminals.py | 6 +++--- 8 files changed, 40 insertions(+), 12 deletions(-) diff --git a/AUTHORS b/AUTHORS index 2c4b483650..d1bbfd08f8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -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. \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ffcfd83556..f16e7c9963 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,4 +1,4 @@ -# Authors +# Contributors ## Project Lead diff --git a/src/ansys/edb/core/hierarchy/pin_group.py b/src/ansys/edb/core/hierarchy/pin_group.py index 727fac3993..663126248a 100644 --- a/src/ansys/edb/core/hierarchy/pin_group.py +++ b/src/ansys/edb/core/hierarchy/pin_group.py @@ -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 @@ -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)) diff --git a/src/ansys/edb/core/inner/messages.py b/src/ansys/edb/core/inner/messages.py index 6004508699..0ebf319c78 100644 --- a/src/ansys/edb/core/inner/messages.py +++ b/src/ansys/edb/core/inner/messages.py @@ -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): diff --git a/src/ansys/edb/core/primitive/primitive.py b/src/ansys/edb/core/primitive/primitive.py index a0a2aa8044..e661120302 100644 --- a/src/ansys/edb/core/primitive/primitive.py +++ b/src/ansys/edb/core/primitive/primitive.py @@ -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( diff --git a/src/ansys/edb/core/simulation_setup/simulation_setup.py b/src/ansys/edb/core/simulation_setup/simulation_setup.py index 14a0463fa6..8fc4a62cdc 100644 --- a/src/ansys/edb/core/simulation_setup/simulation_setup.py +++ b/src/ansys/edb/core/simulation_setup/simulation_setup.py @@ -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 ) diff --git a/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py b/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py index 1d12aba049..69ee412ccf 100644 --- a/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py +++ b/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py @@ -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.""" @@ -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.""" diff --git a/src/ansys/edb/core/terminal/terminals.py b/src/ansys/edb/core/terminal/terminals.py index 89cc7cde0c..d52e768862 100644 --- a/src/ansys/edb/core/terminal/terminals.py +++ b/src/ansys/edb/core/terminal/terminals.py @@ -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): @@ -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): @@ -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