You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should work. At the very minimum, there should be a sensible error message:
sage: DiGraph(graphs.PathGraph(4))
---------------------------------------------------------------------------
NetworkXError Traceback (most recent call last)
/home/grout/.sage/<ipython console> in <module>()
/home/grout/sage-3.2.3/local/lib/python2.5/site-packages/sage/graphs/graph.pyc in __init__(self, data, pos, loops, format, boundary, weighted, implementation, sparse, vertex_labels, **kwds)
8362 else:
8363 if implementation == 'networkx':
-> 8364 self._backend = NetworkXGraphBackend(networkx.XDiGraph(data, selfloops=loops, **kwds))
8365 elif implementation == 'c_graph':
8366 if data is None:
/home/grout/sage-3.2.3/local/lib/python/networkx/xdigraph.py in __init__(self, data, name, selfloops, multiedges)
118 self.multiedges=multiedges
119 if data is not None:
--> 120 convert.from_whatever(data,create_using=self)
121 self.name=name
122
/home/grout/sage-3.2.3/local/lib/python/networkx/convert.py in from_whatever(thing, create_using)
114
115 raise networkx.NetworkXError, \
--> 116 "Input is not a known data type for conversion."
117
118 return
NetworkXError: Input is not a known data type for conversion.
sage: Graph(DiGraph({0:[1,2],1:[0,3]}))
---------------------------------------------------------------------------
NetworkXError Traceback (most recent call last)
/home/grout/.sage/<ipython console> in <module>()
/home/grout/sage-3.2.3/local/lib/python2.5/site-packages/sage/graphs/graph.pyc in __init__(self, data, pos, loops, format, boundary, weighted, implementation, sparse, vertex_labels, **kwds)
7022 self.add_vertices(xrange(data))
7023 else:
-> 7024 self._backend = NetworkXGraphBackend(networkx.XGraph(data, selfloops=loops, **kwds))
7025 elif implementation == 'c_graph':
7026 if data is None:
/home/grout/sage-3.2.3/local/lib/python/networkx/xgraph.py in __init__(self, data, name, selfloops, multiedges)
111 self.multiedges=multiedges
112 if data is not None:
--> 113 self=convert.from_whatever(data,create_using=self)
114 self.name=name
115
/home/grout/sage-3.2.3/local/lib/python/networkx/convert.py in from_whatever(thing, create_using)
114
115 raise networkx.NetworkXError, \
--> 116 "Input is not a known data type for conversion."
117
118 return
NetworkXError: Input is not a known data type for conversion.
This should work. At the very minimum, there should be a sensible error message:
Component: graph theory
Issue created by migration from https://trac.sagemath.org/ticket/5046
The text was updated successfully, but these errors were encountered: