Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@on_trait_change('unknowns[]')
def _update_unknowns(self):
'''
TODO: find reference analyses using the current _unknowns
'''
self._make_unknowns()
self.rebuild_graph()
@on_trait_change('import_csv')
def _on_import(self):
"""
Import format: CSV, first column is filename, path relative to CSV.
others are conditions, type is autodetected. first row is header
with names.
"""
file_dialog = FileDialog()
file_dialog.wildcard = "CSV files (*.csv)|*.csv|"
file_dialog.action = 'open'
file_dialog.open()
if file_dialog.return_code != PyfaceOK:
return
csv = pandas.read_csv(file_dialog.path)
csv_folder = Path(file_dialog.path).parent
@on_trait_change('cells[]')
def _update_cell(self):
for ci in self.cells:
ci.bold = True
@on_trait_change("hide_tab_bar")
def _update_tab_bar(self):
if self.control is not None:
visible = self.control.count() > 1 if self.hide_tab_bar else True
self.control.tabBar().setVisible(visible)
@on_trait_change('servers[]')
def _servers_changed(self):
self.repeaters = [si.repeater for si in self.servers]
@on_trait_change('left, top, tmp_size')
def update_CC(self):
if self.ShowCC:
self.CC = cv_funcs.xcorr(self.sig.data[self.tmp_img_idx,self.top:self.top+self.tmp_size,
self.left:self.left+self.tmp_size],
self.sig.data[self.img_idx,:,:])
self.img_plotdata.set_data("imagedata",self.CC)
@on_trait_change("task.window.active_task")
def _update_checked(self):
if self.task:
window = self.task.window
self.checked = (
window is not None and window.active_task == self.task
)
@on_trait_change('suboptions:refresh_plot_needed')
def _handle_refresh(self):
self.refresh_plot_needed = True
@on_trait_change('manager:[save_event, executor:auto_save_event]')
def _save_queue(self):
self.save()
@on_trait_change('[x, y, z]')
def _xyz_changed(self):
x, y, z = self.x, self.y, self.z
dx = x[1, 0, 0] - x[0, 0, 0]
dy = y[0, 1, 0] - y[0, 0, 0]
dz = z[0, 0, 1] - z[0, 0, 0]
ds = self.dataset
ds.origin = [x.min(), y.min(), z.min()]
ds.spacing = [dx, dy, dz]
if self.m_data is not None:
self.m_data.trait_set(origin=ds.origin, spacing=ds.spacing)
self.update()