Skip to content

Traceback with isolated node or one-way link in pajek schema

Created by: runborg

When loading a config with a isolated nodes (or one way link to a isolated node) a traceback is generated and pymetric fails.

--> $ python metrics.py ../../drift.uninett.no/htdocs/nett/ip-nett/isis-uninett.net

Initializing model....
Traceback (most recent call last):
  File "metrics.py", line 42, in <module>
    cli = MetricShell(filename=infile)
  File "/Users/runarb/src/metric/pymetric/command.py", line 47, in __init__
    self.model.refresh_from_file(self.filename)
  File "/Users/runarb/src/metric/pymetric/model.py", line 605, in refresh_from_file
    self._refresh_all_paths()
  File "/Users/runarb/src/metric/pymetric/model.py", line 627, in _refresh_all_paths
    self.nodes_and_paths_using_edge(edge[0], edge[1], self.G)
  File "/Users/runarb/src/metric/pymetric/model.py", line 102, in nodes_and_paths_using_edge
    for path in paths[1]:
TypeError: 'NoneType' object is not iterable