|
|
@ -38,7 +38,7 @@ def difference_annotator(at, reference_src='reference', actual_src='actual'):
|
|
|
|
# Nodes currently cannot have discrepant information (provided the
|
|
|
|
# Nodes currently cannot have discrepant information (provided the
|
|
|
|
# Topology.is_valid())
|
|
|
|
# Topology.is_valid())
|
|
|
|
if data is topo.links:
|
|
|
|
if data is topo.links:
|
|
|
|
if k.metric < 0:
|
|
|
|
if v.metric < 0:
|
|
|
|
verdict = DifferenceStatus.DISCREPANCY
|
|
|
|
verdict = DifferenceStatus.DISCREPANCY
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: We should probably disallow mutating previous AnnotatedTopologies.
|
|
|
|
# TODO: We should probably disallow mutating previous AnnotatedTopologies.
|
|
|
@ -64,14 +64,14 @@ def extract_positions(at, directive='visualisation default'):
|
|
|
|
]:
|
|
|
|
]:
|
|
|
|
for k, v in data.items():
|
|
|
|
for k, v in data.items():
|
|
|
|
visu_directive = None
|
|
|
|
visu_directive = None
|
|
|
|
for details in k.all_details:
|
|
|
|
for details in v.all_details:
|
|
|
|
visu_directives = list(filter(lambda x: x[0] == directive, details))
|
|
|
|
visu_directives = list(filter(lambda x: x[0] == directive, details[1]))
|
|
|
|
if len(visu_directives) > 0:
|
|
|
|
if len(visu_directives) > 0:
|
|
|
|
visu_directive = visu_directives[-1] # Use the last one found.
|
|
|
|
visu_directive = visu_directives[-1] # Use the last one found.
|
|
|
|
position = None
|
|
|
|
position = None
|
|
|
|
if visu_directive is not None:
|
|
|
|
if visu_directive is not None:
|
|
|
|
for pos in visu_directive[1]:
|
|
|
|
for pos in visu_directive[1]:
|
|
|
|
m = re.match(r'position \[([0-9.]+) ([0-9.]+)\]', pos)
|
|
|
|
m = re.match(r'position \[([0-9.]+) ([0-9.]+)\]', pos[0])
|
|
|
|
if pos is not None:
|
|
|
|
if pos is not None:
|
|
|
|
x, y = m.groups()
|
|
|
|
x, y = m.groups()
|
|
|
|
position = Position(x = float(x), y = float(y))
|
|
|
|
position = Position(x = float(x), y = float(y))
|
|
|
@ -79,7 +79,7 @@ def extract_positions(at, directive='visualisation default'):
|
|
|
|
annot[k].append(position)
|
|
|
|
annot[k].append(position)
|
|
|
|
return at
|
|
|
|
return at
|
|
|
|
|
|
|
|
|
|
|
|
def random_posiiton(at):
|
|
|
|
def random_position(at):
|
|
|
|
# Fallback when no position could be extracted
|
|
|
|
# Fallback when no position could be extracted
|
|
|
|
# TODO: this should use some kind of heuristic or existing layout engine.
|
|
|
|
# TODO: this should use some kind of heuristic or existing layout engine.
|
|
|
|
topo = at.topology
|
|
|
|
topo = at.topology
|
|
|
|