Uninett / PyMetric

Network simulation and visualisation tool
GNU General Public License v2.0
4 stars 5 forks source link

Failure to start with newer networkx python module #1

Closed he32 closed 6 years ago

he32 commented 6 years ago

Pymetric fails to start when networkx version 2.1 is used.

The error is:


Initializing model....
Traceback (most recent call last):
  File "/home/he/pymetric/metrics.py", line 42, in <module>
    cli = MetricShell(filename=infile)
  File "/home/he/pymetric/command.py", line 47, in __init__
    self.model.refresh_from_file(self.filename)
  File "/home/he/pymetric/model.py", line 591, in refresh_from_file
    self.graph = read_pajek(filename)
  File "/home/he/pymetric/pajek.py", line 27, in read_pajek
    G=parse_pajek(lines)
  File "/home/he/pymetric/pajek.py", line 90, in parse_pajek
    G.add_edge(u,v,edge_data)
TypeError: add_edge() takes exactly 3 arguments (4 given)
%

The problem is apparently that the API of networkx has changed. I have a proposed fix, I'll submit it as a pull request and link it to this issue.

knumor commented 6 years ago

Thanks, closing issue.