Skip to content

Commit

Permalink
updates for zoomag
Browse files Browse the repository at this point in the history
  • Loading branch information
sk2 committed Mar 28, 2012
1 parent 6ddc3e5 commit 5d2f2f4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
Binary file modified TopZooTools/cache.data
Binary file not shown.
Binary file removed TopZooTools/cache/composed.pickle
Binary file not shown.
Binary file removed TopZooTools/cache/interconnect.pickle
Binary file not shown.
Binary file removed TopZooTools/cache/output.pickle
Binary file not shown.
Binary file removed TopZooTools/cache/peering_graph.pickle
Binary file not shown.
14 changes: 9 additions & 5 deletions TopZooTools/diff.py
Expand Up @@ -37,7 +37,7 @@ def main():
pairs = [(a, b) for (a, b) in zip(files, files[1:])]
for fileA, fileB in pairs:
compare(fileA, fileB)
print "---------------"

# See if A is a wildcard -> glob

Expand Down Expand Up @@ -94,18 +94,22 @@ def compare(fileA, fileB):
for label in labels_common:
nodeA = label_mappingA[label]
nodeB = label_mappingB[label]
dataA = graphA[nodeA]
dataB = graphB[nodeB]
dataA = graphA.node[nodeA]
dataB = graphB.node[nodeB]
keysA = set(dataA.keys())
keysB = set(dataB.keys())
#print dataA, dataB
added = keysB - keysA
removed = keysA - keysB
same = keysA & keysB
modified = [key for key in same if dataA[key] != dataB[key]]
modified = [key for key in same if dataA[key] != dataB[key] and key != 'id']
if len(added) or len(removed) or len(modified):
#TODO: check handling for multi-edge
print "modified", label
pprint.pprint(dataA)
pprint.pprint(dataB)
labels_modified.add(label)
print "Nodes modified:", ", ".join(sorted(labels_modified))

# need common nodes for edge comparisons

Expand Down Expand Up @@ -237,7 +241,7 @@ def compare(fileA, fileB):
line_width = 3,
node_size = 150,
edge_font_size=8,
basemap_resolution_level = 3,
basemap_resolution_level = 1,
pdf=True,
country_color="#cccccc",
user_default_edge_color = "k",
Expand Down
9 changes: 6 additions & 3 deletions TopZooTools/geoplot.py
Expand Up @@ -784,14 +784,17 @@ def plot_graph(G, output_path, title=False, use_bluemarble=False,
if data.get('inferred'):
linestyle = 'dotted'

if 'delta' in data:
edge_color = delta_colors[data['delta']]
linestyle = delta_styles[data['delta']]


if 'zorder' in data:
zorder = data['zorder']
else:
zorder = 1

if 'delta' in data:
edge_color = delta_colors[data['delta']]
linestyle = delta_styles[data['delta']]
zorder = zorder + 0.1 #ensure diffs go on top of solid lines

if 'edge_width' in data:
# Multiplier not absolute width
Expand Down
2 changes: 1 addition & 1 deletion TopZooTools/yed2zoo.py
Expand Up @@ -416,7 +416,7 @@ def main():

# extract edge data
for src, dst, key, data in graph.edges(data=True, keys=True):
if 'label' in data:
if data.get("label"):
label = data['label']
extracted_data = extract_edge_data(label)
# Replace the edge data with extracted
Expand Down

0 comments on commit 5d2f2f4

Please sign in to comment.