Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Extend create port with name #505

Merged
merged 2 commits into from
May 23, 2024
Merged
Changes from 1 commit
Commits
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
8 changes: 5 additions & 3 deletions src/pyedb/dotnet/edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3987,7 +3987,7 @@ def _get_connected_ports_from_multizone_cutout(self, terminal_info_dict):
return connected_ports_list

@pyedb_function_handler
def create_port(self, terminal, ref_terminal=None, is_circuit_port=False):
def create_port(self, terminal, ref_terminal=None, is_circuit_port=False, name=None):
"""Create a port.

Parameters
Expand All @@ -4005,7 +4005,8 @@ def create_port(self, terminal, ref_terminal=None, is_circuit_port=False):
Negative terminal of the port.
is_circuit_port : bool, optional
Whether it is a circuit port. The default is ``False``.

name: str, optional
Name of the created port. The default is None, a random name is generated.
Returns
-------
list: [:class:`pyedb.dotnet.edb_core.edb_data.ports.GapPort`,
Expand All @@ -4018,7 +4019,8 @@ def create_port(self, terminal, ref_terminal=None, is_circuit_port=False):
if ref_terminal:
ref_terminal.boundary_type = "PortBoundary"
terminal.ref_terminal = ref_terminal

if name:
terminal.name = name
return self.ports[terminal.name]

@pyedb_function_handler
Expand Down
Loading