diff --git a/src/pyedb/dotnet/edb_core/components.py b/src/pyedb/dotnet/edb_core/components.py index 1d79c0f532..24672d66d0 100644 --- a/src/pyedb/dotnet/edb_core/components.py +++ b/src/pyedb/dotnet/edb_core/components.py @@ -2408,20 +2408,20 @@ def get_pin_position(self, pin): return [pin_xy.X.ToDouble(), pin_xy.Y.ToDouble()] @pyedb_function_handler() - def get_pins_name_from_net(self, pin_list, net_name): + def get_pins_name_from_net(self, net_name, pin_list=None): """Retrieve pins belonging to a net. Parameters ---------- - pin_list : list - List of pins to check. + pin_list : list of EDBPadstackInstance, optional + List of pins to check. The default is ``None``, in which case all pins are checked net_name : str Name of the net. Returns ------- - list - List of pins belong to the net. + list of str names: + Pins belonging to the net. Examples -------- @@ -2431,11 +2431,16 @@ def get_pins_name_from_net(self, pin_list, net_name): >>> edbapp.components.get_pins_name_from_net(pin_list, net_name) """ - pinlist = [] + pin_names = [] + if not pin_list: + pin_list = [] + for i in [*self.components.values()]: + for j in [*i.pins.values()]: + pin_list.append(j) for pin in pin_list: if pin.GetNet().GetName() == net_name: - pinlist.append(pin.GetName()) - return pinlist + pin_names.append(self.get_aedt_pin_name(pin)) + return pin_names @pyedb_function_handler() def get_nets_from_pin_list(self, PinList): diff --git a/tests/legacy/system/test_edb_components.py b/tests/legacy/system/test_edb_components.py index 71afbdb542..6f9d4f80c7 100644 --- a/tests/legacy/system/test_edb_components.py +++ b/tests/legacy/system/test_edb_components.py @@ -181,8 +181,8 @@ def test_components_get_pin_name_and_position(self): def test_components_get_pins_name_from_net(self): """Retrieve pins belonging to a net.""" cmp_pinlist = self.edbapp.components.get_pin_from_component("U6") - assert len(self.edbapp.components.get_pins_name_from_net(cmp_pinlist, "GND")) > 0 - assert len(self.edbapp.components.get_pins_name_from_net(cmp_pinlist, "5V")) == 0 + assert len(self.edbapp.components.get_pins_name_from_net("GND", cmp_pinlist)) > 0 + assert len(self.edbapp.components.get_pins_name_from_net("5V", cmp_pinlist)) == 0 def test_components_delete_single_pin_rlc(self): """Delete all RLC components with a single pin."""