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

43.2. CensusTotal.add(): Accumulate one count of individuals

For a discussion of the states of self.total, see Section 43, “class CensusTotal: Number of individuals in one category”.

cbchistlib.py
# - - -   C e n s u s T o t a l . a d d

    def add(self, nInd):
        '''Accumulate one count of individuals to self.
        '''
        #-- 1
        if self.total > 0:
            if nInd > 0:
                self.total += nInd
            return

        #-- 2
        if nInd > 0:
            self.total = nInd
        else:
            self.total = -1