예제 #1
0
    def print_percentage(self, prefix='', postfix=''):
        if self.percent_read:
            sys.stderr.write('\r%s %.2d%% -- (num pairs processed: %s) %s' %
                             (prefix, self.percent_read,
                              big_number_pretty_print(self.pos), postfix))
        else:
            sys.stderr.write(
                '\r%s (num pairs processed: %s) %s' %
                (prefix, big_number_pretty_print(self.pos), postfix))

        sys.stderr.flush()
        self.p_available = False
예제 #2
0
def print_merging_progress(
    dataset_index,
    total_dataset_count,
    num_pairs_total,
    num_pairs,
    next_percentage,
    passed_prefix_total,
    num_merged_pairs_passed,
    num_zero_mismatches):
    next_percentage.acquire()
    if num_pairs.value * 100 / num_pairs_total >= next_percentage.value:
        next_percentage.value += 1
        next_percentage.release()
        percent_pairs = num_pairs.value * 100 // num_pairs_total
        try:
            sys.stderr.write(
                '\r[Merging %d of %d] %.2d%% -- (num pairs processed: %s) POK: %.1f%% :: ZM: %.1f%%'
                % (dataset_index,
                total_dataset_count,
                percent_pairs,
                big_number_pretty_print(num_pairs.value),
                passed_prefix_total.value * 100 / num_pairs.value,
                num_zero_mismatches.value * 100 / num_merged_pairs_passed.value))
        except ZeroDivisionError:
            pass
        sys.stderr.flush()
    else:
        next_percentage.release()
    return
예제 #3
0
 def print_percentage(self, prefix = '', postfix = ''):
     if self.percent_read:
         sys.stderr.write('\r%s %.2d%% -- (num pairs processed: %s) %s' % (prefix, self.percent_read, big_number_pretty_print(self.pos), postfix))
     else:
         sys.stderr.write('\r%s (num pairs processed: %s) %s' % (prefix, big_number_pretty_print(self.pos), postfix))
     
     sys.stderr.flush()
     self.p_available = False
 def print_percentage(self, prefix = ''):
     if self.percent_read:
         sys.stderr.write('\r%s %.2d%% -- (approximate number of entries have been processed so far: %s)' % (prefix, self.percent_read, big_number_pretty_print(self.pos)))
     else:
         sys.stderr.write('\r%s (approximate number of entries have been processed so far: %s)' % (prefix, big_number_pretty_print(self.pos)))
     
     sys.stderr.flush()
     self.p_available = False