Skip to content

Commit 3c18c7c

Browse files
author
Release Manager
committed
gh-36899: some ruff fixes and error links in the graphs folder this fixes some ruff warnings and add some ilnks for errors in the doc in the graphs folder ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36899 Reported by: Frédéric Chapoton Reviewer(s): David Coudert
2 parents 220208d + d0b7bae commit 3c18c7c

27 files changed

+39
-53
lines changed

src/sage/graphs/base/c_graph.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,8 @@ cdef class CGraph:
624624
625625
OUTPUT:
626626
627-
- Raise a ``NotImplementedError``. This method is not implemented in
628-
this base class. A child class should provide a suitable
627+
- Raise a :class:`NotImplementedError`. This method is not implemented
628+
in this base class. A child class should provide a suitable
629629
implementation.
630630
631631
.. SEEALSO::
@@ -1267,7 +1267,7 @@ cdef class CGraph:
12671267
12681268
OUTPUT:
12691269
1270-
- Raise ``NotImplementedError``. This method is not implemented at
1270+
- Raise :class:`NotImplementedError`. This method is not implemented at
12711271
the :class:`CGraph` level. A child class should provide a suitable
12721272
implementation.
12731273

src/sage/graphs/base/graph_backends.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This module implements :class:`GenericGraphBackend` (the base class for
66
backends).
77
88
Any graph backend must redefine the following methods (for which
9-
:class:`GenericGraphBackend` raises a ``NotImplementedError``)
9+
:class:`GenericGraphBackend` raises a :class:`NotImplementedError`)
1010
1111
.. csv-table::
1212
:class: contentstable

src/sage/graphs/bipartite_graph.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# autopep8: off
2-
# -*- coding: utf-8 -*-
32
r"""
43
Bipartite graphs
54

src/sage/graphs/bliss.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,10 @@ cpdef canonical_form(G, partition=None, return_graph=False, use_edge_labels=True
396396
canonical graph of ``G`` or its set of edges
397397
398398
- ``use_edge_labels`` -- boolean (default: ``True``); whether to consider
399-
edge labels. The edge labels are assumed to be hashable and sortable. If
400-
this is not the case (ie a ``TypeError`` is raised), the algorithm will
401-
consider the string representations of the labels instead of the labels.
399+
edge labels. The edge labels are assumed to be hashable and
400+
sortable. If this is not the case (ie a :class:`TypeError` is
401+
raised), the algorithm will consider the string representations
402+
of the labels instead of the labels.
402403
403404
- ``certificate`` -- boolean (default: ``False``); when set to ``True``,
404405
returns the labeling of G into a canonical graph

src/sage/graphs/digraph.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Directed graphs
43
@@ -3187,9 +3186,9 @@ def topological_sort(self, implementation="default"):
31873186
"""
31883187
Return a topological sort of the digraph if it is acyclic.
31893188
3190-
If the digraph contains a directed cycle, a ``TypeError`` is raised. As
3191-
topological sorts are not necessarily unique, different implementations
3192-
may yield different results.
3189+
If the digraph contains a directed cycle, a :class:`TypeError`
3190+
is raised. As topological sorts are not necessarily unique,
3191+
different implementations may yield different results.
31933192
31943193
A topological sort is an ordering of the vertices of the digraph such
31953194
that each vertex comes before all of its successors. That is, if `u`
@@ -3269,7 +3268,8 @@ def topological_sort_generator(self):
32693268
Return an iterator over all topological sorts of the digraph if
32703269
it is acyclic.
32713270
3272-
If the digraph contains a directed cycle, a ``TypeError`` is raised.
3271+
If the digraph contains a directed cycle, a :class:`TypeError`
3272+
is raised.
32733273
32743274
A topological sort is an ordering of the vertices of the digraph such
32753275
that each vertex comes before all of its successors. That is, if u comes

src/sage/graphs/digraph_generators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
from sage.graphs.graph import Graph
7575

7676

77-
class DiGraphGenerators():
77+
class DiGraphGenerators:
7878
r"""
7979
A class consisting of constructors for several common digraphs,
8080
including orderly generation of isomorphism class representatives.

src/sage/graphs/domination.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Domination
43

src/sage/graphs/generators/basic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Basic graphs
43
@@ -400,7 +399,7 @@ def CompleteGraph(n):
400399
G.set_pos({0: (0, 0)})
401400
else:
402401
G._circle_embedding(list(range(n)), angle=pi/2)
403-
G.add_edges(((i, j) for i in range(n) for j in range(i + 1, n)))
402+
G.add_edges((i, j) for i in range(n) for j in range(i + 1, n))
404403
return G
405404

406405
def CorrelationGraph(seqs, alpha, include_anticorrelation):

src/sage/graphs/generators/chessboard.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Chessboard graphs
43

src/sage/graphs/generators/degree_sequence.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
r"""
32
Graphs with a given degree sequence
43
@@ -98,8 +97,8 @@ def DegreeSequenceBipartite(s1, s2):
9897
True
9998
10099
Some sequences being incompatible if, for example, their sums are different,
101-
the functions raises a ``ValueError`` when no graph corresponding to the
102-
degree sequences exists::
100+
the functions raises a :class:`ValueError` when no graph corresponding
101+
to the degree sequences exists::
103102
104103
sage: g = graphs.DegreeSequenceBipartite([2,2,2,2,1],[5,5]) # needs sage.combinat sage.modules
105104
Traceback (most recent call last):

0 commit comments

Comments
 (0)