Commit ae83716e authored by Damien Naudet's avatar Damien Naudet
Browse files

python3 support

parent 50dd12cc
......@@ -124,7 +124,6 @@ def H5NodeFactory(h5File, h5Path):
with h5py.File(h5File, mode='r') as h5f:
itemClass, itemLink, attrs = _getNodeInfo(h5f, h5Path)
except KeyError:
print 'ERROR'
klass = Hdf5ErrorNode
if klass is None:
......@@ -224,7 +223,6 @@ class Hdf5ErrorNode(H5Base):
Reimplementation of H5Base._loadChildren to return an empty list.
:return:
"""
print 'LOAD'
return []
......
......@@ -40,7 +40,7 @@ def h5NodeToProjectItem(h5Node, mode='r', cast=True):
try:
item = ProjectItem(h5Node.h5File, nodePath=h5Node.h5Path, mode=mode)
except Exception as ex:
print 'EXCEPTION', ex
print('EXCEPTION', ex)
raise
if cast:
......
......@@ -391,8 +391,6 @@ def _get_free_shifted_indices(entry,
diff_0 = np.zeros(shape=(n_images, n_images), dtype=ref_mtx_0.dtype)
diff_1 = np.zeros(shape=(n_images, n_images), dtype=ref_mtx_1.dtype)
print 'toto1'
idx_counts = np.zeros(n_images, dtype=np.int32)
pos = xsocs_h5.scan_positions(entry)
......@@ -400,29 +398,19 @@ def _get_free_shifted_indices(entry,
p0 = pos.pos_0 + shifts[entry].dx
p1 = pos.pos_1 + shifts[entry].dy
print 'totob'
to_mtx_0[-1, :] = p0
to_mtx_1[-1, :] = p1
np.dot(ref_mtx_0, to_mtx_0, out=diff_0)
print 'toto2'
np.dot(ref_mtx_1, to_mtx_1, out=diff_1)
print 'toto3'
np.square(diff_0, out=diff_0)
np.square(diff_1, out=diff_1)
print 'toto3'
np.add(diff_0, diff_1, out=diff_0)
np.sqrt(diff_0, out=diff_0)
print 'toto4'
idx = np.argmin(diff_0, axis=1)
np.add.at(idx_counts, idx, 1)
......
Supports Markdown
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