### 47.1. `LumpedLayout.__init__()`

:
Constructor

cbchistlib.py

# - - - L u m p e d L a y o u t . _ _ i n i t _ _
def __init__(self, effKeyList):
'''Constructor.
'''

The first order of business is to determine the set of
keys. The cardinality of this set is the number of
logical columns.

cbchistlib.py

#-- 1
# [ self._keyList := list of the unique year numbers
# in effKeyList, in ascending order
# self._nCols := cardinality of that list ]
self._keyList = sorted(set([ effKey.year_no
for effKey in effKeyList ]))
self._nCols = len(self._keyList)

The length of that list is the number of columns. Next,
build the dictionary that maps effort keys to column
numbers. This is essentially an inversion of the key
list.

cbchistlib.py

#-- 2
# [ self._keyColxMap := as invariant ]
self._keyColxMap = {}
for colx in range(len(self._keyList)):
self._keyColxMap[self._keyList[colx]] = colx

Count the number of years lumped into each column.

cbchistlib.py

#-- 3
# [ self._yearCounts := a list such that element [k]
# contains the number of effKeyList members whose
# year number goes into logical column [k] ]
self._yearCounts = [0] * len(self._keyList)
for effKey in effKeyList:
colx = self._keyColxMap[effKey.year_no]
self._yearCounts[colx] += 1