Skip to content

Commit 74e9570

Browse files
fixed bug that occured when driftfile was not present
1 parent ce01363 commit 74e9570

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

distribution/picasso.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Setup]
22
AppName=Picasso
33
AppPublisher=Jungmann Lab, Max Planck Institute of Biochemistry
4-
AppVersion=0.2.0
4+
AppVersion=0.2.1
55
DefaultDirName={pf}\Picasso
66
DefaultGroupName=Picasso
77
OutputBaseFilename="Picasso-Windows-64bit"

picasso/gui/render.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,23 +1759,24 @@ def add(self, path, render=True):
17591759
drift = None
17601760
#Try to load a driftfile:
17611761
if 'Last driftfile' in info[-1]:
1762-
path = info[-1]['Last driftfile']
1763-
try:
1764-
with open(path, 'r') as f:
1765-
drifttxt = np.loadtxt(f)
1766-
drift_x = drifttxt[:,0]
1767-
drift_y = drifttxt[:,1]
1768-
1769-
if drifttxt.shape[1] == 3:
1770-
drift_z = drifttxt[:,2]
1771-
drift = (drift_x, drift_y,drift_z)
1772-
drift = np.rec.array(drift, dtype=[('x', 'f'), ('y', 'f'),('z', 'f')])
1773-
else:
1774-
drift = (drift_x, drift_y)
1775-
drift = np.rec.array(drift, dtype=[('x', 'f'), ('y', 'f')])
1776-
except:
1777-
#drift already initialized before
1778-
pass
1762+
driftpath = info[-1]['Last driftfile']
1763+
if driftpath is not None:
1764+
try:
1765+
with open(driftpath, 'r') as f:
1766+
drifttxt = np.loadtxt(f)
1767+
drift_x = drifttxt[:,0]
1768+
drift_y = drifttxt[:,1]
1769+
1770+
if drifttxt.shape[1] == 3:
1771+
drift_z = drifttxt[:,2]
1772+
drift = (drift_x, drift_y,drift_z)
1773+
drift = np.rec.array(drift, dtype=[('x', 'f'), ('y', 'f'),('z', 'f')])
1774+
else:
1775+
drift = (drift_x, drift_y)
1776+
drift = np.rec.array(drift, dtype=[('x', 'f'), ('y', 'f')])
1777+
except:
1778+
#drift already initialized before
1779+
pass
17791780

17801781
self._drift.append(drift)
17811782
self._driftfiles.append(None)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='picasso',
5-
version='0.2.0',
5+
version='0.2.1',
66
author='Joerg Schnitzbauer, Maximilian T. Strauss',
77
author_email='joschnitzbauer (at) gmail.com, straussmaximilian (at) gmail.com',
88
url='https://gitlab.com/jungmannlab/picasso',

0 commit comments

Comments
 (0)