def replaceCompWithExpansion(self, uid=0, xSS=None,
keysToSetNonExtraZero=['sumLogPiRemVec']):
''' Replace existing component with expanded set of statistics.
Post Condition
--------------
Values associated with uid are removed.
All entries of provided xSS are added last in index order.
'''
if not np.intersect1d(xSS.uids, self.uids).size == 0:
raise ValueError("Cannot expand with same uids.")
for key in self._Fields._FieldDims:
if key in keysToSetNonExtraZero:
arr = getattr(self._Fields, key)
arr.fill(0)
if hasattr(xSS, 'mUIDPairs'):
assert not self.hasMergeTerms()
self.setMergeUIDPairs(xSS.mUIDPairs)
self.insertComps(xSS)
self.removeComp(uid=uid)
评论列表
文章目录