Skip to content

Commit 5875178

Browse files
committed
PR #36275: remove rst syntax from error messages
1 parent f508bc3 commit 5875178

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/sage/graphs/generic_graph.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,13 +1716,13 @@ def igraph_graph(self, vertex_list=None, vertex_attrs={}, edge_attrs={}):
17161716
sage: G.igraph_graph(vertex_list=[]) # optional - python_igraph
17171717
Traceback (most recent call last):
17181718
...
1719-
ValueError: ``vertex_list`` must be a permutation of the vertices
1719+
ValueError: parameter vertex_list must be a permutation of the vertices
17201720
"""
17211721
if vertex_list is None:
17221722
vertex_list = self
17231723
elif (len(vertex_list) != self.order() or
17241724
set(vertex_list) != set(self)):
1725-
raise ValueError("``vertex_list`` must be a permutation of the vertices")
1725+
raise ValueError("parameter vertex_list must be a permutation of the vertices")
17261726

17271727
v_to_int = {v: i for i, v in enumerate(vertex_list)}
17281728
edges = [(v_to_int[v], v_to_int[w]) for v, w in self.edge_iterator(labels=False)]
@@ -2031,11 +2031,11 @@ def adjacency_matrix(self, sparse=None, vertices=None, *, base_ring=None, **kwds
20312031
sage: graphs.PathGraph(5).adjacency_matrix(vertices=[0,0,0,0,0]) # needs sage.modules
20322032
Traceback (most recent call last):
20332033
...
2034-
ValueError: ``vertices`` must be a permutation of the vertices
2034+
ValueError: parameter vertices must be a permutation of the vertices
20352035
sage: graphs.PathGraph(5).adjacency_matrix(vertices=[1,2,3]) # needs sage.modules
20362036
Traceback (most recent call last):
20372037
...
2038-
ValueError: ``vertices`` must be a permutation of the vertices
2038+
ValueError: parameter vertices must be a permutation of the vertices
20392039
sage: Graph ([[0, 42, 'John'], [(42, 'John')]]).adjacency_matrix()
20402040
Traceback (most recent call last):
20412041
...
@@ -2060,7 +2060,7 @@ def adjacency_matrix(self, sparse=None, vertices=None, *, base_ring=None, **kwds
20602060
"``vertices``")
20612061
elif (len(vertices) != n or
20622062
set(vertices) != set(self.vertex_iterator())):
2063-
raise ValueError("``vertices`` must be a permutation of the vertices")
2063+
raise ValueError("parameter vertices must be a permutation of the vertices")
20642064

20652065
new_indices = {v: i for i, v in enumerate(vertices)}
20662066
D = {}
@@ -2258,11 +2258,11 @@ def incidence_matrix(self, oriented=None, sparse=True, vertices=None, edges=None
22582258
sage: P5.incidence_matrix(vertices=[1] * P5.order()) # needs sage.modules
22592259
Traceback (most recent call last):
22602260
...
2261-
ValueError: ``vertices`` must be a permutation of the vertices
2261+
ValueError: parameter vertices must be a permutation of the vertices
22622262
sage: P5.incidence_matrix(edges=[(0, 1)] * P5.size()) # needs sage.modules
22632263
Traceback (most recent call last):
22642264
...
2265-
ValueError: ``edges`` must be a permutation of the edges
2265+
ValueError: parameter edges must be a permutation of the edges
22662266
sage: P5.incidence_matrix(edges=P5.edges(sort=False, labels=True)) # needs sage.modules
22672267
[1 0 0 0]
22682268
[1 1 0 0]
@@ -2277,13 +2277,13 @@ def incidence_matrix(self, oriented=None, sparse=True, vertices=None, edges=None
22772277
vertices = self.vertices(sort=False)
22782278
elif (len(vertices) != self.num_verts() or
22792279
set(vertices) != set(self.vertex_iterator())):
2280-
raise ValueError("``vertices`` must be a permutation of the vertices")
2280+
raise ValueError("parameter vertices must be a permutation of the vertices")
22812281

22822282
verts = {v: i for i, v in enumerate(vertices)}
22832283
if edges is None:
22842284
edges = self.edge_iterator(labels=False)
22852285
elif len(edges) != self.size():
2286-
raise ValueError("``edges`` must be a permutation of the edges")
2286+
raise ValueError("parameter edges must be a permutation of the edges")
22872287
else:
22882288
# We check that we have the same set of unlabeled edges
22892289
if oriented:
@@ -2295,7 +2295,7 @@ def reorder(u, v):
22952295
i_edges = [reorder(verts[e[0]], verts[e[1]]) for e in edges]
22962296
s_edges = [reorder(verts[u], verts[v]) for u, v in self.edge_iterator(labels=False)]
22972297
if sorted(i_edges) != sorted(s_edges):
2298-
raise ValueError("``edges`` must be a permutation of the edges")
2298+
raise ValueError("parameter edges must be a permutation of the edges")
22992299

23002300
from sage.matrix.constructor import matrix
23012301
if base_ring is None:
@@ -2425,7 +2425,7 @@ def distance_matrix(self, vertices=None, *, base_ring=None, **kwds):
24252425
vertices = self.vertices(sort=True)
24262426
elif (len(vertices) != self.order() or
24272427
set(vertices) != set(self.vertex_iterator())):
2428-
raise ValueError("``vertices`` must be a permutation of the vertices")
2428+
raise ValueError("parameter vertices must be a permutation of the vertices")
24292429

24302430
# We extract from **kwds the arguments for distance_all_pairs
24312431
keys = ['by_weight', 'algorithm', 'weight_function', 'check_weight']
@@ -2559,7 +2559,7 @@ def weighted_adjacency_matrix(self, sparse=True, vertices=None,
25592559
vertices = self.vertices(sort=True)
25602560
elif (len(vertices) != self.num_verts() or
25612561
set(vertices) != set(self.vertex_iterator())):
2562-
raise ValueError("``vertices`` must be a permutation of the vertices")
2562+
raise ValueError("parameter vertices must be a permutation of the vertices")
25632563

25642564
# Method for checking edge weights and setting default weight
25652565
if default_weight is None:
@@ -24501,7 +24501,7 @@ def katz_matrix(self, alpha, nonedgesonly=False, vertices=None):
2450124501
vertices = self.vertices(sort=True)
2450224502
elif (len(vertices) != n or
2450324503
set(vertices) != set(self)):
24504-
raise ValueError("``vertices`` must be a permutation of the vertices")
24504+
raise ValueError("parameter vertices must be a permutation of the vertices")
2450524505

2450624506
A = self.adjacency_matrix(vertices=vertices)
2450724507

0 commit comments

Comments
 (0)