summaryrefslogtreecommitdiff
path: root/analyze
diff options
context:
space:
mode:
Diffstat (limited to 'analyze')
-rwxr-xr-xanalyze13
1 files changed, 6 insertions, 7 deletions
diff --git a/analyze b/analyze
index 4140a58..506d801 100755
--- a/analyze
+++ b/analyze
@@ -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)