summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Borassi <michele.borassi@imtlucca.it>2015-08-07 13:01:18 +0200
committerMichele Borassi <michele.borassi@imtlucca.it>2015-08-07 13:01:18 +0200
commitc4685c504bc1603e44b3493213c7545baf415497 (patch)
tree97f48bd5fa7cfbc6d39a7c3c3e637a233094b024
parentCorrected merge error (diff)
Corrected doc and error message if igraph is not installedu/borassi/include_igraph_library
-rw-r--r--src/sage/graphs/generic_graph.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
index 099fb53..932d3b3 100644
--- a/src/sage/graphs/generic_graph.py
+++ b/src/sage/graphs/generic_graph.py
@@ -1314,8 +1314,13 @@ class GenericGraph(GenericGraph_pyx):
Optionally, it is possible to add vertex attributes and edge attributes
to the output graph.
- For more information on the Python version of igraph, see
- http://igraph.org/python/.
+ .. NOTE::
+
+ This routine needs the optional package igraph to be installed:
+ to do so, it is enough to
+ run ``sage -i igraph`` followed by ``sage -i python_igraph``. For
+ more information on the Python version of igraph, see
+ http://igraph.org/python/.
INPUT:
@@ -1426,8 +1431,8 @@ class GenericGraph(GenericGraph_pyx):
import igraph
except ImportError:
raise ImportError("The package igraph is not available. To " +
- "install it, run Sage with option -i " +
- "python_igraph.")
+ "install it, run 'sage -i igraph' followed by " +
+ "'sage -i python_igraph'.")
v_to_int = {v:i for i,v in enumerate(self.vertices())}
edges = [(v_to_int[v], v_to_int[w]) for v,w in self.edge_iterator(labels=False)]