Skip to content

Commit

Permalink
GUI patch
Browse files Browse the repository at this point in the history
  • Loading branch information
degiacom committed Jul 18, 2023
1 parent 208bace commit 44aae1c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/molearn/analysis/GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ def update_trails(self):
try:
crd = self.get_samples(self.mybox.value, int(self.samplebox.value), self.drop_path.value)
self.samples = crd.copy()
except:
except Exception:
self.button_pdb.disabled = False
return

# update latent space plot
if self.samples == []:
if len(self.samples) == 0:
self.latent.data[2].x = self.waypoints[:, 0]
self.latent.data[2].y = self.waypoints[:, 1]
else:
Expand All @@ -88,17 +88,18 @@ def on_click(self, trace, points, selector):

# add new waypoint to list
pt = np.array([[points.xs[0], points.ys[0]]])

if len(self.waypoints) == 0:
self.waypoints = pt
else:
self.waypoints = np.concatenate((self.waypoints, pt))

# update textbox (triggering update of 3D representation)
try:
pt = self.waypoints.flatten().round(decimals=4).astype(str)
#pt = np.array([self.latent.data[3].x, self.latent.data[3].y]).T.flatten().round(decimals=4).astype(str)
self.mybox.value = " ".join(pt)
except:
except Exception:
return

self.update_trails()
Expand Down

0 comments on commit 44aae1c

Please sign in to comment.