Skip to content

Commit 2d79307

Browse files
committed
fix some details in graphs (found by lgtm)
1 parent 6d31aad commit 2d79307

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/sage/graphs/graph_input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ def from_oriented_incidence_matrix(G, M, loops=False, multiedges=False, weighted
371371
- ``loops``, ``multiedges``, ``weighted`` -- booleans (default: ``False``);
372372
whether to consider the graph as having loops, multiple edges, or weights
373373
374+
.. NOTE:: ``weighted`` is currently ignored.
375+
374376
EXAMPLES::
375377
376378
sage: from sage.graphs.graph_input import from_oriented_incidence_matrix
@@ -426,8 +428,6 @@ def from_oriented_incidence_matrix(G, M, loops=False, multiedges=False, weighted
426428
positions.append(tuple(NZ))
427429
else:
428430
positions.append((NZ[1], NZ[0]))
429-
if weighted is None:
430-
weighted = False
431431
if multiedges is None:
432432
total = len(positions)
433433
multiedges = len(set(positions)) < total

src/sage/graphs/partial_cube.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ def depth_first_traversal(G, start):
166166
sage: t = list(sage.graphs.partial_cube.depth_first_traversal(H, '00'))
167167
sage: len(t)
168168
16
169-
170169
"""
171170
neighbors = G.neighbor_out_iterator
172171
seen = set()
@@ -286,7 +285,7 @@ def is_partial_cube(G, certificate=False):
286285
# Initial sanity check: are there few enough edges?
287286
# Needed so that we don't try to use union-find on a dense
288287
# graph and incur superquadratic runtimes.
289-
if 1 << (2*G.size()//n) > n:
288+
if 1 << (2 * G.size() // n) > n:
290289
return fail
291290

292291
# Check for bipartiteness.
@@ -399,13 +398,13 @@ def is_partial_cube(G, certificate=False):
399398

400399
# Rest of data structure: point from states to list and list to states
401400
state_to_active_token = {v: -1 for v in g}
402-
token_to_states = [[] for i in activeTokens] # (i.e. vertices on which each token acts)
401+
token_to_states = [[] for _ in activeTokens] # (i.e. vertices on which each token acts)
403402

404403
def scan(v):
405404
"""
406405
Find the next token that is effective for v.
407406
"""
408-
a = next(i for i in range(state_to_active_token[v]+1, len(activeTokens))
407+
a = next(i for i in range(state_to_active_token[v] + 1, len(activeTokens))
409408
if activeTokens[i] is not None and activeTokens[i] in action[v])
410409
state_to_active_token[v] = a
411410
token_to_states[a].append(v)

src/sage/graphs/schnyder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ def _normal_label(g, comb_emb, external_face):
213213
except Exception:
214214
raise RuntimeError('Contractible list is empty but graph still has %d vertices. (Expected 3.)' % g.order())
215215

216-
break
217216
# going to contract v
218217
v_neighbors = Set(g.neighbors(v))
219218
contracted.append((v, v_neighbors,

0 commit comments

Comments
 (0)