diff options
-rwxr-xr-x | analyze | 13 | ||||
-rwxr-xr-x | runtest | 5 |
2 files changed, 8 insertions, 10 deletions
@@ -1,6 +1,5 @@ #!/usr/bin/python -from __future__ import print_function import argparse import math @@ -69,10 +68,10 @@ class Dataset(object): if type(y) == Dataset: return self.binary_values(y, float.__mul__) return self.binary_constant(y, float.__mul__) - def __div__(self, y): + def __truediv__(self, y): if type(y) == Dataset: - return self.binary_values(y, float.__div__) - return self.binary_constant(y, float.__div__) + return self.binary_values(y, float.__truediv__) + return self.binary_constant(y, float.__truediv__) def builtin_read(filename): """Read a space-separated table of runs into a dictionary. @@ -234,14 +233,14 @@ for name in args.name: for data in datas: try: env[data[0]] = eval(data[1], env) - except Exception, e: + except Exception as e: print('ERROR in data expression "%s"' % data[1]) raise e values[name] = {} for item in items: try: data = eval(item[1], env) - except Exception, e: + except Exception as e: print('ERROR in item expression "%s"' % item[1]) raise e if len(data.runs) != 1: @@ -266,7 +265,7 @@ for item in items: old = float(values[args.name[0]][item[0]]) new = float(values[name][item[0]]) delta = (new - old) / (old + 1) * 100 - cell = '%.2f (%+7.2f%%)' % (values[name][item[0]], delta) + cell = '%.2f (%+9.2f%%)' % (values[name][item[0]], delta) row.append(cell) if len(cell) > widths[i]: widths[i] = len(cell) @@ -1,6 +1,5 @@ -#!/usr/bin/python2 +#!/usr/bin/python -from __future__ import print_function import subprocess import argparse import ctypes @@ -182,7 +181,7 @@ for w in works.values(): while workers: try: pid, status, rusage = os.wait3(0) - except OSError, e: + except OSError as e: if e.errno == errno.ECHILD: print('warning: os.wait() missed children!') break |