PyMetric issueshttps://scm.uninett.no/verktoy/PyMetric/-/issues2020-01-16T14:49:10+01:00https://scm.uninett.no/verktoy/PyMetric/-/issues/20No node %s in current topology.2020-01-16T14:49:10+01:00Runar BorgeNo node %s in current topology.```
(sim) (9c/105:105:20n) >>> routerfail nyal-amsterdam-gw
No node %s in current topology.
``````
(sim) (9c/105:105:20n) >>> routerfail nyal-amsterdam-gw
No node %s in current topology.
```https://scm.uninett.no/verktoy/PyMetric/-/issues/19linkinfo-problem2023-09-15T10:19:25+02:00Otto Jonassen Wittnerlinkinfo-problemHer smalt det gitt:
```
(sim) >>> linkinfo notodden-gw2 drammen-gw1
Information for link (notodden-gw2,drammen-gw1):
Traceback (most recent call last):
File "/home/wittner/sw/PyMetric/metrics.py", line 45, in <module>
cli.cmdloop(...Her smalt det gitt:
```
(sim) >>> linkinfo notodden-gw2 drammen-gw1
Information for link (notodden-gw2,drammen-gw1):
Traceback (most recent call last):
File "/home/wittner/sw/PyMetric/metrics.py", line 45, in <module>
cli.cmdloop()
File "/home/wittner/sw/PyMetric/command.py", line 65, in cmdloop
Cmd.cmdloop(self)
File "/usr/lib/python3.6/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python3.6/cmd.py", line 217, in onecmd
return func(arg)
File "/home/wittner/sw/PyMetric/command.py", line 502, in do_linkinfo
infohash = model.get_link_info(u,v)
File "/home/wittner/sw/PyMetric/model.py", line 781, in get_link_info
retinfo['capacity'] = utils.cap2str(capacity)
File "/home/wittner/sw/PyMetric/utils.py", line 67, in cap2str
if capacity < 1000:
TypeError: '<' not supported between instances of 'str' and 'int'
```
Kjører networkx2.4 og python3.6https://scm.uninett.no/verktoy/PyMetric/-/issues/18Traceback when isolating nodes in simulated topology (partitioned net)2019-12-03T13:19:18+01:00Runar BorgeTraceback when isolating nodes in simulated topology (partitioned net)When creating a "brain-split"/"net-split" where one or more nodes are isolated in the topology the application does a traceback.
The issue appears to be triggered then the last path to a node is removed
```
Initializing model....
PyMe...When creating a "brain-split"/"net-split" where one or more nodes are isolated in the topology the application does a traceback.
The issue appears to be triggered then the last path to a node is removed
```
Initializing model....
PyMetric interactive shell, type 'help' for help
>>> sim
Simulation mode active, type 'stop' or 'simulation stop' to end it
(sim) >>> simplot
(sim) >>> linkfail narvik-gw2
narvik-gw2
(sim) >>> linkfail narvik-gw2
bodo-gw3 ma2-gw narvik-gw1 oslo-gw1 trd-gw utsjok-gw1
(sim) >>> linkfail narvik-gw2 utsjok-gw1
(sim) (1c/0:0:0n/0.13L/1r/1d) >>> linkfail hammerfest-gw1 ma2-gw
(sim) (2c/113:0:0n/0.25L/1r/2d) >>>
(sim) (2c/113:0:0n/0.25L/1r/2d) >>> linkfail tromso-gw alta-gw3
Traceback (most recent call last):
File "metrics.py", line 45, in <module>
cli.cmdloop()
File "/home/runarb/devel/PyMetric-scm/command.py", line 65, in cmdloop
Cmd.cmdloop(self)
File "/usr/lib/python3.6/cmd.py", line 139, in cmdloop
stop = self.postcmd(stop, line)
File "/home/runarb/devel/PyMetric-scm/command.py", line 85, in postcmd
difflen = nx.average_shortest_path_length(self.simulation.graph)\
File "/usr/local/lib/python3.6/dist-packages/networkx/algorithms/shortest_paths/generic.py", line 403, in average_shortest_path_length
raise nx.NetworkXError("Graph is not weakly connected.")
networkx.exception.NetworkXError: Graph is not weakly connected.
```https://scm.uninett.no/verktoy/PyMetric/-/issues/17matplotlib DeprecationWarnings on version 3.1.12019-12-02T11:57:35+01:00Runar Borgematplotlib DeprecationWarnings on version 3.1.1```--> $ ./metrics.py ../drift.uninett.no/htdocs/nett/ip-nett/isis-uninett.net
Initializing model....
PyMetric interactive shell, type 'help' for help
>>> plot
/usr/local/lib/python3.6/dist-packages/networkx/drawing/nx_pylab.py:563: Mat...```--> $ ./metrics.py ../drift.uninett.no/htdocs/nett/ip-nett/isis-uninett.net
Initializing model....
PyMetric interactive shell, type 'help' for help
>>> plot
/usr/local/lib/python3.6/dist-packages/networkx/drawing/nx_pylab.py:563: MatplotlibDeprecationWarning:
The iterable function was deprecated in Matplotlib 3.1 and will be removed in 3.3. Use np.iterable instead.
if not cb.iterable(width):
/usr/local/lib/python3.6/dist-packages/networkx/drawing/nx_pylab.py:569: MatplotlibDeprecationWarning:
The iterable function was deprecated in Matplotlib 3.1 and will be removed in 3.3. Use np.iterable instead.
and cb.iterable(edge_color) \
/usr/local/lib/python3.6/dist-packages/networkx/drawing/nx_pylab.py:611: MatplotlibDeprecationWarning:
The is_numlike function was deprecated in Matplotlib 3.0 and will be removed in 3.2. Use isinstance(..., numbers.Number) instead.
if cb.is_numlike(alpha):```https://scm.uninett.no/verktoy/PyMetric/-/issues/16python3 : module 'networkx' has no attribute 'connected_component_subgraphs'...2019-12-02T11:59:54+01:00Runar Borgepython3 : module 'networkx' has no attribute 'connected_component_subgraphs' on linkfail```(sim) >>> linkfail oslo-gw1 gjovik-gw2
Traceback (most recent call last):
File "/home/runarb/devel/PyMetric-scm/metrics.py", line 45, in <module>
cli.cmdloop()
File "/home/runarb/devel/PyMetric-scm/command.py", line 65, in cmd...```(sim) >>> linkfail oslo-gw1 gjovik-gw2
Traceback (most recent call last):
File "/home/runarb/devel/PyMetric-scm/metrics.py", line 45, in <module>
cli.cmdloop()
File "/home/runarb/devel/PyMetric-scm/command.py", line 65, in cmdloop
Cmd.cmdloop(self)
File "/usr/lib/python3.6/cmd.py", line 139, in cmdloop
stop = self.postcmd(stop, line)
File "/home/runarb/devel/PyMetric-scm/command.py", line 88, in postcmd
components = list(nx.connected_component_subgraphs(
AttributeError: module 'networkx' has no attribute 'connected_component_subgraphs'```
on networkx-2.4https://scm.uninett.no/verktoy/PyMetric/-/issues/15speed to string only supports some specific speeds2019-12-02T13:38:23+01:00Morten Knutsenspeed to string only supports some specific speeds*Created by: runborg*
https://github.com/Uninett/PyMetric/blob/b32bdde81308fdb0baf28c3a194ee58a1d2bd1ee/utils.py#L56-L72
cap2str does only support some specific speeds , comming with a 20Gbit/s link will result in an speed of "Unknown...*Created by: runborg*
https://github.com/Uninett/PyMetric/blob/b32bdde81308fdb0baf28c3a194ee58a1d2bd1ee/utils.py#L56-L72
cap2str does only support some specific speeds , comming with a 20Gbit/s link will result in an speed of "Unknown". this must be made more dynamic to allow for more custom speeds.
An example implementation:
```
def cap2str(capacity):
if capacity < 1000:
s, i = "K", float(capacity)
elif capacity < 1000000:
s, i = "M", round(float(capacity)/1000.0, 1)
elif capacity < 1000000000:
s, i = "G", round(float(capacity)/1000000.0, 1)
elif capacity < 1000000000000:
s, i = "T", round(float(capacity)/1000000000.0,1)
if i % 1 == 0:
return "{:0.0f}{}bit/s".format(i, s)
else:
return "{:0.1f}{}bit/s".format(i, s)
```
This will produce:
```
600 : 600Kbit/s
1500 : 1.5Mbit/s
1984 : 2Mbit/s
34000 : 34Mbit/s
34010 : 34Mbit/s
100000 : 100Mbit/s
155000 : 155Mbit/s
1000000 : 1Gbit/s
2488000 : 2.5Gbit/s
2500000 : 2.5Gbit/s
5000000 : 5Gbit/s
10000000 : 10Gbit/s
20000000 : 20Gbit/s
25000000 : 25Gbit/s
40000000 : 40Gbit/s
50000000 : 50Gbit/s
100000000 : 100Gbit/s
200000000 : 200Gbit/s
400000000 : 400Gbit/s
800000000 : 800Gbit/s
1000000000 : 1Tbit/s
1200000000 : 1.2Tbit/s
```https://scm.uninett.no/verktoy/PyMetric/-/issues/12No valid path text2019-12-02T14:31:00+01:00Morten KnutsenNo valid path text*Created by: runborg*
The print statements for `print "No valid path from %s to %s in model"` are lacking the formatting parameters, node names are displayed as %s instead of real names*Created by: runborg*
The print statements for `print "No valid path from %s to %s in model"` are lacking the formatting parameters, node names are displayed as %s instead of real nameshttps://scm.uninett.no/verktoy/PyMetric/-/issues/14"Special" links speeds are not supported.2019-12-03T14:40:03+01:00Morten Knutsen"Special" links speeds are not supported.*Created by: runborg*
Link speeds other than some special speeds are not supported. eg. 2,2.5,5,20,25,40gbit++ is not supported in the current implementation and failes with this error:
```
(sim) >>> plot with-load
Traceback (most r...*Created by: runborg*
Link speeds other than some special speeds are not supported. eg. 2,2.5,5,20,25,40gbit++ is not supported in the current implementation and failes with this error:
```
(sim) >>> plot with-load
Traceback (most recent call last):
File "/home/he/Desktop/pymetric/metrics.py", line 45, in <module>
cli.cmdloop()
File "/home/he/Desktop/pymetric/command.py", line 64, in cmdloop
Cmd.cmdloop(self)
File "/usr/pkg/lib/python2.7/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/usr/pkg/lib/python2.7/cmd.py", line 221, in onecmd
return func(arg)
File "/home/he/Desktop/pymetric/command.py", line 424, in do_plot
self.gui.plot(G, graphdata, edge_cmap=cmap, edge_capa=capa)
File "/home/he/Desktop/pymetric/plotting.py", line 248, in plot
for i in range(len(edges))]
KeyError: 40000000
```
This comes by the line-width array be'ing a static mapping and not allows for dynamic scaling.
se: https://github.com/Uninett/PyMetric/blob/b32bdde81308fdb0baf28c3a194ee58a1d2bd1ee/plotting.py#L53
New speeds needs to be added as a short fix, and as a permanent fix this scaling needs to be done dynamically to allow for whatever speed is available
https://scm.uninett.no/verktoy/PyMetric/-/issues/7One-way-link between two nodes in pajek rases keyError on load2019-02-14T14:53:02+01:00Morten KnutsenOne-way-link between two nodes in pajek rases keyError on load*Created by: runborg*
When loading a pajek with a one-way link networkx failes computation with a keyError
```
Traceback (most recent call last):
File "metrics.py", line 45, in <module>
cli.cmdloop()
File "/Users/runarb/src...*Created by: runborg*
When loading a pajek with a one-way link networkx failes computation with a keyError
```
Traceback (most recent call last):
File "metrics.py", line 45, in <module>
cli.cmdloop()
File "/Users/runarb/src/metric/pymetric/command.py", line 64, in cmdloop
Cmd.cmdloop(self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cmd.py", line 221, in onecmd
return func(arg)
File "/Users/runarb/src/metric/pymetric/command.py", line 424, in do_plot
self.gui.plot(G, graphdata, edge_cmap=cmap, edge_capa=capa)
File "/Users/runarb/src/metric/pymetric/plotting.py", line 292, in plot
pos=data['pos'])
File "/Users/runarb/src/metric/pymetric/plotting.py", line 350, in _plot_edge_labels
if d < 70 and G[v][u]['weight'] == w['weight']:
File "/Library/Python/2.7/site-packages/networkx/classes/coreviews.py", line 54, in __getitem__
return self._atlas[key]
KeyError: 'ifi2-gw4'
```https://scm.uninett.no/verktoy/PyMetric/-/issues/9info [router] longest paths lists weigth values as float2019-12-02T14:41:09+01:00Morten Knutseninfo [router] longest paths lists weigth values as float*Created by: runborg*
not as integers.
example:
```
longest paths : stolav-gw3 <-> karasjok-gw1 (91.0), stolav-gw3 <-> evenstad-gw3
(85.0), stolav-gw3 <-> evenstad-gw2 (84.0),
stolav-gw3 <-> for...*Created by: runborg*
not as integers.
example:
```
longest paths : stolav-gw3 <-> karasjok-gw1 (91.0), stolav-gw3 <-> evenstad-gw3
(85.0), stolav-gw3 <-> evenstad-gw2 (84.0),
stolav-gw3 <-> forde-gw2 (80.0), stolav-gw3
<-> kake-gw1 (80.0), stolav-gw3 <-> sogndal-
gw1 (79.0), stolav-gw3 <-> sogndal-gw2 (78.0),
stolav-gw3 <-> longyear-gw4 (73.0)
```https://scm.uninett.no/verktoy/PyMetric/-/issues/6Traceback with isolated node or one-way link in pajek schema2019-02-14T12:42:14+01:00Morten KnutsenTraceback 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.ne...*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
```https://scm.uninett.no/verktoy/PyMetric/-/issues/5Isolating a node in sim mode rases exception2019-12-03T13:19:17+01:00Morten KnutsenIsolating a node in sim mode rases exception*Created by: runborg*
When a node is isolated with the linkfail command command pymetric throws a traceback and fail
```
(sim) >>> linkfail kake-gw2 stolav-gw3
Traceback (most recent call last):
File "metrics.py", line 45, in <mo...*Created by: runborg*
When a node is isolated with the linkfail command command pymetric throws a traceback and fail
```
(sim) >>> linkfail kake-gw2 stolav-gw3
Traceback (most recent call last):
File "metrics.py", line 45, in <module>
cli.cmdloop()
File "/Users/runarb/src/metric/pymetric/command.py", line 64, in cmdloop
Cmd.cmdloop(self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cmd.py", line 143, in cmdloop
stop = self.postcmd(stop, line)
File "/Users/runarb/src/metric/pymetric/command.py", line 86, in postcmd
difflen = nx.average_shortest_path_length(self.simulation.graph)\
File "/Library/Python/2.7/site-packages/networkx/algorithms/shortest_paths/generic.py", line 391, in average_shortest_path_length
raise nx.NetworkXError("Graph is not weakly connected.")
networkx.exception.NetworkXError: Graph is not weakly connected.
```https://scm.uninett.no/verktoy/PyMetric/-/issues/3Traceback on info [router] and when clicking on a node when in sim-mode2019-12-02T13:57:28+01:00Morten KnutsenTraceback on info [router] and when clicking on a node when in sim-mode*Created by: runborg*
When in sim mode the application presents a traceback when pressing a node in the plot-tree:
```
(sim) (1c/107:5:0n) >>> Information for node kjeller-gw1:
Exception in Tkinter callback
Traceback (most recent ...*Created by: runborg*
When in sim mode the application presents a traceback when pressing a node in the plot-tree:
```
(sim) (1c/107:5:0n) >>> Information for node kjeller-gw1:
Exception in Tkinter callback
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1536, in __call__
return self.func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backends/backend_tkagg.py", line 395, in button_press_event
FigureCanvasBase.button_press_event(self, x, y, num, dblclick=dblclick, guiEvent=event)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backend_bases.py", line 1785, in button_press_event
self.callbacks.process(s, mouseevent)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/cbook.py", line 527, in process
proxy(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/cbook.py", line 405, in __call__
return mtd(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backend_bases.py", line 1671, in pick
self.figure.pick(mouseevent)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/artist.py", line 354, in pick
a.pick(mouseevent)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axes.py", line 3154, in pick
martist.Artist.pick(self, args[0])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/artist.py", line 354, in pick
a.pick(mouseevent)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/artist.py", line 343, in pick
self.figure.canvas.pick_event(mouseevent, self, **prop)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backend_bases.py", line 1751, in pick_event
self.callbacks.process(s, event)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/cbook.py", line 527, in process
proxy(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/cbook.py", line 405, in __call__
return mtd(*args, **kwargs)
File "/Users/runarb/src/metric/pymetric/plotting.py", line 123, in picktest
self.command.fromui(nodes[i])
File "/Users/runarb/src/metric/pymetric/command.py", line 71, in fromui
self.do_info(node)
File "/Users/runarb/src/metric/pymetric/command.py", line 543, in do_info
infohash = model.get_node_info(args)
File "/Users/runarb/src/metric/pymetric/model.py", line 744, in get_node_info
G.edges(node, data=True))
File "/Users/runarb/src/metric/pymetric/model.py", line 743, in <lambda>
+ " (" + str(int(x[2])) + ")",
TypeError: int() argument must be a string or a number, not 'dict'
```https://scm.uninett.no/verktoy/PyMetric/-/issues/4Info [router] does not list neighbors2019-12-02T14:02:43+01:00Morten KnutsenInfo [router] does not list neighbors*Created by: runborg*
when executing the `info [router]` command (or pressing a node in the plot) the neighbors statement only lists: `<dictionary-keyiterator object at 0x11462b158>`
full listing:
```
>>> info trd-gw
Information f...*Created by: runborg*
when executing the `info [router]` command (or pressing a node in the plot) the neighbors statement only lists: `<dictionary-keyiterator object at 0x11462b158>`
full listing:
```
>>> info trd-gw
Information for node trd-gw:
name : trd-gw
degree : 9
eccentricity : 6
betweenness : 0.477 (100.00% of max, 1139.03% of avg)
neighbors : <dictionary-keyiterator object at 0x11462b158>
links : trd-narvik (15), trd-teknobyen2 (1), trd-stjordal (14), trd-
teknobyen (4), trd-oslo-100 (10), trd-gw.trd-
gw7-2 (1), trd-tromso (28), trd-gw.trd-gw2
(1), trd-hovedbygget (5)
longest paths : trd-gw <-> kake-gw1 (110.0), trd-gw <-> kake-gw2 (70.0), trd-gw
<-> rena-gw1 (62.0), trd-gw <-> evenstad-gw2
(62.0), trd-gw <-> karasjok-gw1 (61.0), trd-gw
<-> rena-gw2 (61.0), trd-gw <-> evenstad-gw3
(61.0), trd-gw <-> sogndal-gw2 (61.0)
```
Running on networkx 2.2https://scm.uninett.no/verktoy/PyMetric/-/issues/1Failure to start with newer networkx python module2018-10-17T10:25:53+02:00Morten KnutsenFailure to start with newer networkx python module*Created by: he32*
Pymetric fails to start when networkx version 2.1 is used.
The error is:
```% pymetric isis-nordunet.net
Initializing model....
Traceback (most recent call last):
File "/home/he/pymetric/metrics.py", lin...*Created by: he32*
Pymetric fails to start when networkx version 2.1 is used.
The error is:
```% pymetric isis-nordunet.net
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.