# - - - b u i l d E n t r i e s
def buildEntries(db, reg_code, firstYear, lastYear, isOverlap):
'''Build all the index entries as instances of BaseIndex.
[ (db is a pycbc.CBCDatabase instance) and
(reg_code is a region code) and
(firstYear is the first included year number in
year-number format) and
(lastYear is the last included year number in year-number
format) and
(isOverlap is True iff overlap report desired) ->
return a list of instances of BaseEntry representing index
elements from db for region code RegArgs().reg_code and
year numbers in the range [firstYear, lastYear] ]
'''
#-- 1
# [ circleList := a list of all pycbc.Circle instances from db
# that are wholly or partially in region (region)
# entryList := a new, empty list ]
circleList = [ circle
for circle in db.genRegionCircles(reg_code) ]
entryList = []
So far we have a list of candidate circles, all in the desired
region, but some of them may not have been worked in the
desired range of year numbers. See Section 8.10, “regx.cgi: buildCircle(): Build entries
for one circle center”.
#-- 2
# [ entryList +:= BaseEntry instances representing circles
# in circleList that have any effort in the year number
# range [firstYear, lastYear] ]
for circle in circleList:
#-- 2 body
# [ if circle has any effort in the year number range
# [firstYear, lastYear] ->
# entryList +:= (a PriIndex instance for the circle's
# current name) + (SecIndex instances for sets of
# efforts under names that have the same center as
# (circle) but different as-published names) ]
buildCircle(db, entryList, circle, firstYear, lastYear,
isOverlap)
#-- 3
return entryList