Commit 3149d10a authored by Daniel Brown's avatar Daniel Brown
Browse files

more py3 bug fixes

parent 3e1718f3
......@@ -1186,14 +1186,18 @@ class kat(object):
[out,errpipe] = p.communicate()
_out = str(out).split("\n")
if six.PY2:
_out = str(out).split("\n")
else:
_out = str(out).split("\\n")
for line in _out[::-1]:
if line.lstrip().startswith('computation time:'):
try:
r.runtime = float(line.split(":")[1].replace("s",""))
except:
r.runtime = 0.0
if printout == 1:
print (out)
else:
......@@ -1317,6 +1321,9 @@ class kat(object):
rtn = [r]
if sys.version > '3':
long = int
if self.__time_code:
perffile = open(root[0] + ".perf",'r')
......
......@@ -577,7 +577,7 @@ def read_map(filename):
f.readline()
name = f.readline().split(':')[1].strip()
maptype = f.readline().split(':')[1].strip()
size = tuple(map(lambda x: int(x), f.readline().split(':')[1].strip().split()))
size = tuple(map(lambda x: float(x), f.readline().split(':')[1].strip().split()))
center = tuple(map(lambda x: float(x), f.readline().split(':')[1].strip().split()))
step = tuple(map(lambda x: float(x), f.readline().split(':')[1].strip().split()))
scaling = float(f.readline().split(':')[1].strip())
......
......@@ -686,7 +686,7 @@ def MakeROMFromHDF5(hdf5Filename, greedyFilename=None, EIFilename=None, tol=1e-1
Names = range(NProcesses)
procs = [Process(name="process_%i" % l[0], target=_worker_ROM,
args=(hdf5Filename, queue, l[1], l[2], l[3])) for l in itertools.izip(Names, result_err, result_idx, locks)]
args=(hdf5Filename, queue, l[1], l[2], l[3])) for l in zip(Names, result_err, result_idx, locks)]
max_res = np.zeros((NProcesses), dtype='d')
max_idx = np.zeros((NProcesses), dtype='i')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment