Next / Previous / Contents / TCC Help System / NM Tech homepage

22.9. PriIndex._htmlOverlaps(): Generate primary “Overlaps” index entries
# - - -   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

          [ 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, where pct is the
        #       percentage overlap in (0.0, 100.0) ]
        lapList = self.db.overlappers(

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 overlap line”.
        #-- 2
        # [ parent  +:=  one 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)