def restore_clustering(self):
# A window pops up asking the user to specify the path of a *.ANobj (Analysis Object) file
# and attempts to restore it using the Analysis.restore classmethod. Then opens a ClusteringWindow
# which gives the user the option to plot clusters, save the object, or close the window.
fname = askopenfilename(initialdir=IRIS_CSCRATCH_DIR,
filetypes=(("Analysis File Object", "*.ANobj"), ("All Files", "*.*")))
if fname == "" or fname == (): return None
try:
self.AN = analysis.Analysis.restore(fname)
self._restore_settings_from_loaded_object()
self.root.event_generate("<<clustering_restored>>", when="tail")
self.using_analysis_var.set("Using analysis object from\n{}".format(jt.break_path(fname, 24)))
self.using_analysis_label.config(fg="dark green")
except:
ErrorWindow(self.root, "Incorrect file format.")
return None
评论列表
文章目录