Beispiel #1
0
    def effectsSummary(self, **kwArgs):
        """
        Returns an EffectsSummary object. If present, notes will be made in a
        provided memo kwArgs to allow elision of reprocessing, which should
        eliminate the combinatoric explosion.
        
        >>> obj = _testingValues[0]
        >>> memo = {}
        >>> es = obj.effectsSummary(memo=memo)
        >>> es.pprint()
        2:
          41
        >>> len(memo)  # will have obj *and* the single substitution subtable
        2
        """

        memo = kwArgs.pop('memo', {})

        if id(self) in memo:
            return memo[id(self)]

        r = EffectsSummary()

        for key, lkGroup in self.items():
            for lkRec in lkGroup:
                onlyWant = {key[lkRec.sequenceIndex]}

                for sub in lkRec.lookup:
                    if id(sub) not in memo:
                        memo[id(sub)] = sub.effectsSummary(**kwArgs)

                    r.updateSets(memo[id(sub)], onlyWant=onlyWant)

        memo[id(self)] = r
        return r
Beispiel #2
0
    def effectsSummary(self, **kwArgs):
        """
        Returns an EffectsSummary object. If present, notes will be made in a
        provided memo kwArgs to allow elision of reprocessing, which should
        eliminate the combinatoric explosion.
        
        >>> obj = _testingValues[2]
        >>> memo = {}
        >>> es = obj.effectsSummary(memo=memo)
        >>> es.pprint()
        4:
          10
        5:
          97
        6:
          18
        >>> id(obj) in memo
        True
        """

        memo = kwArgs.pop('memo', {})

        if id(self) in memo:
            return memo[id(self)]

        r = EffectsSummary()

        for gIn, gOut in self.items():
            r[gIn].add(gOut)

        memo[id(self)] = r
        return r
Beispiel #3
0
    def effectsSummary(self, **kwArgs):
        """
        Returns an EffectsSummary object. If present, notes will be made in a
        provided memo kwArgs to allow elision of reprocessing, which should
        eliminate the combinatoric explosion.
        
        >>> obj = _testingValues[0]
        >>> memo = {}
        >>> es = obj.effectsSummary(memo=memo)
        >>> es.pprint()
        50:
          60
        51:
          61
        53:
          63
        56:
          66
        57:
          67
        """

        memo = kwArgs.pop('memo', {})

        if id(self) in memo:
            return memo[id(self)]

        r = EffectsSummary()

        for key, tOut in self.items():
            for gIn, gOut in zip(sorted(key[1]), tOut):
                r[gIn].add(gOut)

        memo[id(self)] = r
        return r
Beispiel #4
0
 def effectsSummary(self, **kwArgs):
     """
     Returns an EffectsSummary object. If present, notes will be made in a
     provided memo kwArgs to allow elision of reprocessing, which should
     eliminate the combinatoric explosion.
     
     >>> obj = _testingValues[0]
     >>> memo = {}
     >>> es = obj.effectsSummary(memo=memo)
     >>> es.pprint()
     2:
       41
     4:
       42
     6:
       43
     >>> len(memo)  # will have obj *and* the single substitution subtable
     2
     """
     
     memo = kwArgs.pop('memo', {})
     
     if id(self) in memo:
         return memo[id(self)]
     
     r = EffectsSummary()
     revMap = utilities.invertDictFull(self.classDefInput, asSets=True)
     
     for key, lkGroup in self.items():
         for lkRec in lkGroup:
             ci = key[1][lkRec.sequenceIndex]
             
             if ci:
                 onlyWant = revMap[ci]
             else:
                 onlyWant = self.coverageExtras
             
             for sub in lkRec.lookup:
                 if id(sub) not in memo:
                     memo[id(sub)] = sub.effectsSummary(**kwArgs)
                 
                 r.updateSets(memo[id(sub)], onlyWant=onlyWant)
     
     memo[id(self)] = r
     return r