sk2 / ank_legacy_v2

Legacy edition of autonetkit. Please see https://github.com/sk2/autonetkit for latest version
www.autonetkit.org
BSD 3-Clause "New" or "Revised" License
10 stars 4 forks source link

PathDrawer throws ValueError for multias example #256

Open sk2 opened 12 years ago

sk2 commented 12 years ago

Possibly due to grid layout? Test on a networkx grid graph...

For now this is a placeholder for the error message.

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/sk2/Dropbox/PhD/Dev/ank/AutoNetkit/console_script.py", line 100, in <module>
    main()
  File "/Users/sk2/Dropbox/PhD/Dev/ank/AutoNetkit/console_script.py", line 85, in main
    inet.plot()      
  File "AutoNetkit/internet.py", line 171, in plot
    ank.plot(self.network)        
  File "AutoNetkit/plotting/plot.py", line 86, in plot
    node_color=cmap_index(network, graph))
  File "AutoNetkit/plotting/plot.py", line 151, in plot_graph
    PathDrawer.draw_many_paths(graph, pos, paths)
  File "AutoNetkit/plotting/PathDrawer.py", line 328, in draw_many_paths
    draw_path(G, pos, path, color=colors[i%len(colors)], linestyle=linestyles[i/len(colors) % len(linestyles)], linewidth=linewidth, shifts=shifts)
  File "AutoNetkit/plotting/PathDrawer.py", line 229, in draw_path
    c1 = crossing_point(p1a,p1b,p_node,p_middle_angle)  # crossing point of the shifted (i)th edge and the middle-angle-line
  File "AutoNetkit/plotting/PathDrawer.py", line 130, in crossing_point
    if tuple(p1a)==tuple(p1b) or tuple(p2a)==tuple(p2b): raise ValueError('Two points defining a line are identical!')
ValueError: Two points defining a line are identical!