Skip to content

Commit

Permalink
black again
Browse files Browse the repository at this point in the history
  • Loading branch information
YufengXin committed Aug 1, 2023
1 parent 14c296f commit 9b950ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/sdx/pce/utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def biconnectivity(self):


def dijnew(graph, start_node, end_node):
""" use dijsktra to get the primary shortest path """
"""use dijsktra to get the primary shortest path"""
graph_new = graph_simplify(graph)
shortest_distance = {}
predecessor = {}
Expand Down Expand Up @@ -123,7 +123,7 @@ def dijnew(graph, start_node, end_node):


def graph_simplify(graph):
""" make the non-simple graph to be the simple graph """
"""make the non-simple graph to be the simple graph"""
for node in graph:
for endpoint in graph[node]:
try:
Expand All @@ -136,7 +136,7 @@ def graph_simplify(graph):


def backup_path(graph, start_node, end_node):
""" remove the primary shortest path and redo the dijsktra to get the backup path """
"""remove the primary shortest path and redo the dijsktra to get the backup path"""
backupstart_node = start_node
backupend_node = end_node
graphprimary = copy.deepcopy(graph)
Expand Down
6 changes: 3 additions & 3 deletions src/sdx/pce/utils/random_topology_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_latency_list(self):
return self.latency_list

def generate_graph(self, plot=True, g=None) -> nx.Graph:
""" generate a random graph """
"""generate a random graph"""
if g is None:
while True:
g = erdos_renyi_graph(self.num_node, self.link_probability, self.seed)
Expand Down Expand Up @@ -93,7 +93,7 @@ def generate_graph(self, plot=True, g=None) -> nx.Graph:
return self.graph

def link_property_assign(self):
""" set the random bw and latency per link """
"""set the random bw and latency per link"""

self.latency_list = []
for u, v, w in self.graph.edges(data=True):
Expand All @@ -106,7 +106,7 @@ def link_property_assign(self):
return self.latency_list

def nodes_connected(self, g, u, v):
""" if u and v connected """
"""if u and v connected"""
return u in g.neighbors(v)

def get_connectivity(self):
Expand Down

0 comments on commit 9b950ca

Please sign in to comment.