[Networkit] Error on writing

Christian Staudt christian.staudt at kit.edu
Mon Jul 6 15:24:42 CEST 2015


Apparently a typo in the file path leads to an error like this, which should not happen. What is the best way to check the path and throw a meaningful error?


On 06 Jul 2015, at 15:07, Christian Staudt <christian.staudt at kit.edu> wrote:

> Hi NetworKit developers,
> now I have a support question too: I want to write a weighted graph to an edge list of the format
> 	u	v 	w
> where u and v are the end nodes and w is an edge weight. If I try to do that graphio.EdgeListWriter throws an error with empty text:
> 
> 
> 
> 
> In [2]: G = readGraph("/Users/cls/Downloads/opsahl-usairport/out.opsahl-usairport", Format.KONECT)
> 
> In [3]: U = G.toUndirected()
> 
> In [4]: writeGraph(U, "airtraffic.graph", Format.EdgeListTabZero)
> ---------------------------------------------------------------------------
> RuntimeError                              Traceback (most recent call last)
> <ipython-input-4-3f775e968492> in <module>()
> ----> 1 writeGraph(U, "/Users/cls/workspace/AlgoIProgrammieraufgabe/data/airtraffic.graph", Format.EdgeListTabZero)
> 
> /Users/cls/workspace/NetworKit/networkit/graphio.py in writeGraph(G, path, fileformat, **kwargs)
>     209 	"""
>     210         writer = getWriter(fileformat, **kwargs)
> --> 211         writer.write(G, path)
>     212         logging.info("wrote graph {0} to file {1}".format(G, path))
>     213
> 
> _NetworKit.pyx in _NetworKit.EdgeListWriter.write (networkit/_NetworKit.cpp:21233)()
> 
> RuntimeError:
> 
> I’ve also modified the writer so that it writes the desired format, but I keep getting the error.
> 
> Best,
> Chris
> 
> <signature.asc><ATT00001.c>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20150706/9b28f4e2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20150706/9b28f4e2/attachment.sig>


More information about the NetworKit mailing list