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