# - - - P r i I n d e x . _ h t m l O v e r l a p s def _htmlOverlaps(self, parent): '''Show circles that overlap self.circle. [ parent is an et.Element -> parent +:= "Overlaps" entries for self ] '''
For the generated XHTML, see Section 4.3.1, “Primary entry format”.
Our job is pretty easy, since
pycbc has a
method that finds all the overlapping circles for us, and it
even sorts them in descending order by degree of overlap.
#-- 1 # [ lapList := a list of tuples (pct, c) for all circles # c that overlap self.circle, where pct is the # percentage overlap in (0.0, 100.0) ] lapList = self.db.overlappers(self.circle)
Just because a circle ever overlapped does not mean it
overlapped in the years of interest. For the logic that
filters out outlying years, and formats the actual
“Overlaps” entry, see Section 22.10, “
PriIndex._overlapEntry(): Generate one
#-- 2 # [ parent +:= one div.as per element of lapList, containing # the percentage overlap and circle name, regions, # and years worked ] for pct, c in lapList: self._overlapEntry(parent, pct, c)