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
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