From d02891e76ba411ffca09487447ab8321455f15e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20Horv=C3=A1t?= Date: Tue, 23 Jul 2024 00:03:40 +0200 Subject: [PATCH 1/2] Fix typos and outdated links in `igraph_graph()` docs --- src/sage/graphs/generic_graph.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index 063931ae274..891f1551d29 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -1569,13 +1569,13 @@ def igraph_graph(self, vertex_list=None, vertex_attrs={}, edge_attrs={}): This routine needs the optional package igraph to be installed: to do so, it is enough to run ``sage -i python_igraph``. For more information on the Python version of igraph, see - http://igraph.org/python/. + https://python.igraph.org/. INPUT: - ``vertex_list`` -- list (default: ``None``); defines a mapping from the vertices of the graph to consecutive integers in ``(0, \ldots, - n-1)`. Otherwise, the result of :meth:`vertices` will be used + n-1)``. Otherwise, the result of :meth:`vertices` will be used instead. Because :meth:`vertices` only works if the vertices can be sorted, using ``vertex_list`` is useful when working with possibly non-sortable objects in Python 3. @@ -1585,25 +1585,25 @@ def igraph_graph(self, vertex_list=None, vertex_attrs={}, edge_attrs={}): containing in position `i` the label of the `i`-th vertex in the list ``vertex_list`` if it is given or in :meth:`vertices` when ``vertex_list == None`` (see - http://igraph.org/python/doc/igraph.Graph-class.html#__init__ for more + https://python.igraph.org/en/stable/api/igraph.Graph.html#__init__ for more information) - ``edge_attrs`` -- dictionary (default: ``{}``); a dictionary where the key is a string (the attribute name), and the value is an iterable containing in position `i` the label of the `i`-th edge in the list outputted by :meth:`edge_iterator` (see - http://igraph.org/python/doc/igraph.Graph-class.html#__init__ for more + https://python.igraph.org/en/stable/api/igraph.Graph.html#__init__ for more information) .. NOTE:: - In ``igraph``, a graph is weighted if the edge labels have attribute - ``weight``. Hence, to create a weighted graph, it is enough to add - this attribute. + In ``igraph``, a graph is weighted if the edge attribute ``weight`` is + present. Hence, to create a weighted graph, it is enough to add this + attribute. .. NOTE:: - Often, Sage uses its own defined types for integer/floats. These + Often, Sage uses its own defined types for integers/floats. These types may not be igraph-compatible (see example below). EXAMPLES: @@ -1654,7 +1654,7 @@ def igraph_graph(self, vertex_list=None, vertex_attrs={}, edge_attrs={}): sage: H.vs()['name'] == V # optional - python_igraph True - Sometimes, Sage integer/floats are not compatible with igraph:: + Sometimes, Sage integers/floats are not compatible with igraph:: sage: G = Graph([(0, 1, 2)]) sage: E = list(G.edge_iterator()) From 50ff868c4ce4d28d3286b3d911eb2d15358962a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20Horv=C3=A1t?= Date: Tue, 23 Jul 2024 12:13:57 +0200 Subject: [PATCH 2/2] Convert code span to math in igraph_graph() documentation --- src/sage/graphs/generic_graph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index 891f1551d29..483b5c301c3 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -1574,8 +1574,8 @@ def igraph_graph(self, vertex_list=None, vertex_attrs={}, edge_attrs={}): INPUT: - ``vertex_list`` -- list (default: ``None``); defines a mapping from - the vertices of the graph to consecutive integers in ``(0, \ldots, - n-1)``. Otherwise, the result of :meth:`vertices` will be used + the vertices of the graph to consecutive integers in `(0, \ldots, + n-1)`. Otherwise, the result of :meth:`vertices` will be used instead. Because :meth:`vertices` only works if the vertices can be sorted, using ``vertex_list`` is useful when working with possibly non-sortable objects in Python 3.