def print_true_partition(self): print ' true partition' print ' clonal? ids' true_partition = utils.get_true_partition(self.reco_info) for cluster in true_partition: print ' %d %s' % (utils.from_same_event(self.reco_info, cluster), ':'.join([str(uid) for uid in cluster]))
def print_true_partition(self): print ' true partition' print ' clonal? ids' true_partition = utils.get_true_partition(self.reco_info) for cluster in true_partition: print ' %d %s' % (utils.from_same_event( self.reco_info, cluster), ':'.join( [str(uid) for uid in cluster]))
def print_true_partition(self): print ' true partition' print ' clonal? ids' true_partition = utils.get_true_partition(self.reco_info) for cluster in true_partition.values(): same_event = utils.from_same_event(self.reco_info is None, self.reco_info, cluster) if same_event is None: same_event = -1 print ' %d %s' % (int(same_event), ':'.join([str(uid) for uid in cluster]))
def calculate_missing_values(self, reco_info, only_ip=None): for ip in range(len(self.partitions)): if only_ip is not None and ip != only_ip: continue if self.ccfs[ip][0] is not None and self.ccfs[ip][1] is not None: # already have them continue true_partition = utils.get_true_partition(reco_info, ids=[uid for cluster in self.partitions[ip] for uid in cluster]) self.ccfs[ip] = utils.new_ccfs_that_need_better_names(self.partitions[ip], true_partition, reco_info, seed_unique_id=self.seed_unique_id) self.we_have_a_ccf = True
def calculate_missing_values(self, reco_info, only_ip=None): for ip in range(len(self.partitions)): if only_ip is not None and ip != only_ip: continue if self.ccfs[ip][0] is not None and self.ccfs[ip][1] is not None: # already have them continue true_partition = utils.get_true_partition(reco_info, ids=[uid for cluster in self.partitions[ip] for uid in cluster]) # can't use the true partition we might already have in the calling function, since we need this to only have uids from this partition (i.e. this isn't really the true partition) new_vals = utils.new_ccfs_that_need_better_names(self.partitions[ip], true_partition, reco_info, seed_unique_id=self.seed_unique_id) if None not in new_vals: # if the function finds messed up partitions, it returns None, None (at this point, this seems to just happens when a uid was found in multiple clusters, which happens for earlier partitions (n_procs > 1) when seed_unique_id is set, since we pass seed_unique_id to all the subprocs) self.ccfs[ip] = new_vals self.we_have_a_ccf = True
def calculate_missing_values(self, reco_info, only_ip=None): for ip in range(len(self.partitions)): if only_ip is not None and ip != only_ip: continue if self.adj_mis[ip] is not None: # already have it/them assert self.ccfs[ip][0] is not None and self.ccfs[ip][1] is not None continue true_partition = utils.get_true_partition(reco_info, ids=[uid for cluster in self.partitions[ip] for uid in cluster]) self.adj_mis[ip] = utils.adjusted_mutual_information(self.partitions[ip], true_partition) assert self.ccfs[ip] == [None, None] self.ccfs[ip] = utils.correct_cluster_fractions(self.partitions[ip], reco_info) self.we_have_an_adj_mi = True
def calculate_missing_values(self, reco_info, only_ip=None): for ip in range(len(self.partitions)): if only_ip is not None and ip != only_ip: continue if self.ccfs[ip][0] is not None and self.ccfs[ip][ 1] is not None: # already have them continue true_partition = utils.get_true_partition( reco_info, ids=[ uid for cluster in self.partitions[ip] for uid in cluster ]) self.ccfs[ip] = utils.new_ccfs_that_need_better_names( self.partitions[ip], true_partition, reco_info, seed_unique_id=self.seed_unique_id) self.we_have_a_ccf = True