def __init__(self, registry): _LOG.info('Initializing Phycas') Phycas.__init__(self) self.data_source = 'memory' SimpleServer.__init__(self, registry) self.registry = registry self.trees = [] self.treesLock = threading.Lock() self.curr_tree_pos = None self.phycasIDLishMatrix = None self.ntax = 0 self.leafSet = [] self.serverRefCount = 1 self.settings = {}
def recordSample(self, cycle, lnL = 0.0): #---+----|----+----|----+----|----+----|----+----|----+----|----+----| """ Calls base class version, then stores tree description in list so that trees can be supplied when requested. """ Phycas.recordSample(self, cycle, lnL) t = (cycle + 1, lnL, self.tree.makeNewick()) _LOG.debug(str(t)) self.treesLock.acquire() try: self.trees.append(t) if not self.curr_tree_pos: self.curr_tree_pos = 0 finally: self.treesLock.release()