Skip to content

Commit ee5ab1f

Browse files
Deal with SageMath DeprecationWarning
1 parent c6c8920 commit ee5ab1f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spherogram_src/links/invariants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ def white_graph(self):
486486

487487
# Build the graph.
488488
G = graph.Graph(edges, multiedges=True)
489-
components = G.connected_components()
489+
components = G.connected_components(sort=True)
490490
if len(components) > 2:
491491
raise ValueError('The link diagram is split.')
492492
return G.subgraph(components[1])

spherogram_src/links/jones_old.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def cut(G, T, e):
2323
raise ValueError("e must be an edge of T.")
2424
S = T.copy()
2525
S.delete_edge(e)
26-
(C1, C2) = S.connected_components()
26+
(C1, C2) = S.connected_components(sort=True)
2727
answer = list()
2828
for f in G.edges(sort=True, key=edge_index):
2929
if (f[0] in C1 and f[1] in C2) or (f[0] in C2 and f[1] in C1):
@@ -257,8 +257,8 @@ def _recursive_spanning_trees(G, forest):
257257
# e=xy links the CC (connected component) of forest containing x
258258
# with the CC containing y. Any other edge which does that
259259
# cannot be added to forest anymore, and B is the list of them
260-
c1 = forest.connected_component_containing_vertex(e[0])
261-
c2 = forest.connected_component_containing_vertex(e[1])
260+
c1 = forest.connected_component_containing_vertex(e[0], sort=True)
261+
c2 = forest.connected_component_containing_vertex(e[1], sort=True)
262262
G.delete_edge(e)
263263
B = G.edge_boundary(c1, c2, sort=False)
264264
G.add_edge(e)

0 commit comments

Comments
 (0)