Skip to content

Commit

Permalink
Rename networkx_from_file to network_from_spice
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosavola committed Apr 4, 2024
1 parent 3272c7c commit 09e750f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions gplugins/klayout/netlist_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def netlist_to_networkx(
next(c for c in top_circuits if c.name.casefold() == top_cell.casefold()),
)

# unique_net_counter = Counter()
all_used_nets = set()
for circuit in top_circuits:
for device in circuit.each_device():
Expand Down Expand Up @@ -77,11 +76,7 @@ def netlist_to_networkx(
# Create NetworkX representation
G.add_node(device_name, **parameters)
for net in nets:
# unique_net_counter.update([net.expanded_name()])
# net_name = (
# f"{net.expanded_name()}_{unique_net_counter[net.expanded_name()]}"
# )
net_name = f"{net.expanded_name()}"
net_name = net.expanded_name()
G.add_edge(device_name, net_name)
all_used_nets.add(net_name)

Expand All @@ -94,7 +89,7 @@ def netlist_to_networkx(
return G


def networkx_from_file(
def network_from_spice(
filepath: PathType,
include_labels: bool = True,
top_cell: str | None = None,
Expand Down
4 changes: 2 additions & 2 deletions gplugins/klayout/plot_nets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import networkx as nx
from gdsfactory.typings import PathType

from gplugins.klayout.netlist_graph import networkx_from_file
from gplugins.klayout.netlist_graph import network_from_spice


def plot_nets(
Expand All @@ -27,7 +27,7 @@ def plot_nets(
Helpful for reducing trivial waveguide elements.
"""

G_connectivity = networkx_from_file(**locals())
G_connectivity = network_from_spice(**locals())

if nodes_to_reduce:

Expand Down

0 comments on commit 09e750f

Please sign in to comment.