-
-"""
-Map sites to adjacent sites in topology. Generated manually :-(
-A site is adjacent to itself.
-"""
-adjacencies = {
- 1: [1], 2: [2,12], 3: [3], 4: [4,5,6,7,9,10], 5: [4,5,6,8],
- 6: [4,5,6,10], 7: [4,7,8], 8: [5,7,8], 9: [4,9,10], 10: [4,6,9,10],
- 11: [11,13,15,16,17], 12: [2,12,13], 13: [11,12,13,15], 14: [14],
- 15: [11,13,15,19], 16: [11,16], 17: [11,17,19,22], 18: [18],
- 19: [15,17,19,20], 20: [19,20,21,22], 21: [20,21,22], 22: [17,20,21,22]
- }
-
-"""
-Test whether two sites are adjacent to each other in the adjacency graph.
-"""
-def is_adjacent(s1, s2):
- set1 = set(adjacencies[s1])
- set2 = set(adjacencies[s2])
-
- if s1 in set2 and s2 in set1:
- return True
- elif not s1 in set2 and not s2 in set1:
- return False
- else:
- raise Exception("Adjacency mismatch, sites %d and %d." % (s1, s2))
-
-
-"""
-Check the adjacency graph for discrepancies.
-"""
-def check_adjacencies():
- for site in adjacencies:
- for adj in adjacencies[site]:
- try:
- test = is_adjacent(site, adj)
- except Exception, e:
- print "Error: ", e, " Fix adjacencies!"
- return
-