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

48.1. SplitLayout.__init__()

cbchistlib.py
# - - -   S p l i t L a y o u t . _ _ i n i t _ _

    def __init__(self, effKeyList):
        '''Constructor.
        '''

First sort the set of effort keys. The resulting list provides the column labels, and the cardinality of this list is the number of columns.

cbchistlib.py
        #-- 1
        # [ self._keyList  :=  as invariant ]
        self._keyList = sorted(effKeyList)
        self._nCols = len(self._keyList)

Invert this list to get the mapping of effort keys to column numbers.

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