Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
desc_button16.style.button_color = 'tan'
desc_button17 = Button(description='', disabled=True, layout=desc_button_layout)
desc_button17.style.button_color = 'lightgreen'
desc_button18 = Button(description='', disabled=True, layout=desc_button_layout)
desc_button18.style.button_color = 'tan'
desc_button19 = Button(description='', disabled=True, layout=desc_button_layout)
desc_button19.style.button_color = 'lightgreen'
desc_button20 = Button(description='', disabled=True, layout=desc_button_layout)
desc_button20.style.button_color = 'tan'
desc_button21 = Button(description='', disabled=True, layout=desc_button_layout)
desc_button21.style.button_color = 'lightgreen'
desc_button22 = Button(description='', disabled=True, layout=desc_button_layout)
desc_button22.style.button_color = 'tan'
desc_button23 = Button(description='', disabled=True, layout=desc_button_layout)
desc_button23.style.button_color = 'lightgreen'
desc_button24 = Button(description='', disabled=True, layout=desc_button_layout)
desc_button24.style.button_color = 'tan'
row1 = [param_name1, self.random_seed, units_button1, desc_button1]
row2 = [param_name2, self.immune_activation_time, units_button2, desc_button2]
row3 = [param_name3, self.save_interval_after_therapy_start, units_button3, desc_button3]
row4 = [param_name4, self.immune_o2_relative_uptake, units_button4, desc_button4]
row5 = [param_name5, self.immune_apoptosis_rate, units_button5, desc_button5]
row6 = [param_name6, self.immune_motility_persistence_time, units_button6, desc_button6]
row7 = [param_name7, self.immune_migration_speed, units_button7, desc_button7]
row8 = [param_name8, self.immune_migration_bias, units_button8, desc_button8]
row9 = [param_name9, self.immune_relative_adhesion, units_button9, desc_button9]
row10 = [param_name10, self.immune_relative_repulsion, units_button10, desc_button10]
row11 = [param_name11, self.immune_kill_rate, units_button11, desc_button11]
row12 = [param_name12, self.immune_attachment_lifetime, units_button12, desc_button12]
row13 = [param_name13, self.immune_attachment_rate, units_button13, desc_button13]
row14 = [param_name14, self.elastic_coefficient, units_button14, desc_button14]
def aug_dash():
"""GUI for augmentation dashboard"""
aug_button = widgets.Button(description='Confirm', button_style='success')
tb = widgets.Button(description='Batch Image', disabled=True, button_style='')
aug_dash.bi = widgets.ToggleButtons(value='Multi', options=['Multi', 'Single'], description='', button_style='info',
style=style, layout=Layout(width='auto'))
tg = widgets.Button(description='Padding', disabled=True, button_style='')
aug_dash.pad = widgets.ToggleButtons(value='zeros', options=['zeros', 'reflection', 'border'], description='', button_style='info',
style=style, layout=Layout(width='auto'))
th = widgets.Button(description='Normalization', disabled=True, button_style='')
aug_dash.norm = widgets.ToggleButtons(value='Imagenet', options=['Imagenet', 'Mnist', 'Cifar', 'None'], description='', button_style='info',
style=style, layout=Layout(width='auto'))
tr = widgets.Button(description='Batch Size', disabled=True, button_style='warning')
aug_dash.bs = widgets.ToggleButtons(value='16', options=['8', '16', '32', '64'], description='', button_style='warning',
style=style, layout=Layout(width='auto'))
spj = widgets.Button(description='Presizing', disabled=True, button_style='primary')
te = widgets.Button(description='Item Size', disabled=True, button_style='primary')
aug_dash.imgsiz = widgets.ToggleButtons(value='194', options=['28', '64', '128', '194', '254'],
description='', button_style='primary', style=style, layout=Layout(width='auto'))
to = widgets.Button(description='Batch Size', disabled=True, button_style='primary')
aug_dash.imgbth = widgets.ToggleButtons(value='128', options=['28', '64', '128', '194', '254'],
description='', button_style='primary', style=style, layout=Layout(width='auto'))
tf = widgets.Button(description='Augmentation', disabled=True, button_style='danger')
aug_dash.aug = widgets.ToggleButtons(value='No', options=['No', 'Yes'], description='', button_style='info',
style=style, layout=Layout(width='auto'))
def _camera_folder(self):
"""Folder that houses controls for caching and setting cameras."""
ncams = max((len(scn.cameras) for scn
in self.scenes)) if self.scenes else 0
camera = Button(icon='camera', description=' Camera')
camopts = _ListDict([
('get', Button(icon='arrow-circle-down', description=' Save')),
('set', IntSlider(description='Load', min=-1,
max=ncams-1, value=-1, step=1))])
def _save_cam(b):
for scn in self.active():
scn.save_cam = not scn.save_cam
btn = self._controls['camera']._controls['set']
btn.max = len(scn.cameras)
camopts['get'].on_click(_save_cam)
for scn in self.scenes:
camopts['set'].observe(scn._set_camera, names='value')
if len(self.scenes) > 1:
camopts.insert(0, 'link', Button(icon='link', description=' Link'))
def _link(b):
self.linked = not self.linked
param_name6.style.button_color = 'tan'
self.cargo_relative_repulsion = FloatText(
value=5,
step=0.1,
style=style, layout=widget_layout)
param_name7 = Button(description='worker_o2_relative_uptake', disabled=True, layout=name_button_layout)
param_name7.style.button_color = 'lightgreen'
self.worker_o2_relative_uptake = FloatText(
value=0.1,
step=0.01,
style=style, layout=widget_layout)
param_name8 = Button(description='worker_apoptosis_rate', disabled=True, layout=name_button_layout)
param_name8.style.button_color = 'tan'
self.worker_apoptosis_rate = FloatText(
value=0,
step=0.01,
style=style, layout=widget_layout)
param_name9 = Button(description='worker_motility_persistence_time', disabled=True, layout=name_button_layout)
param_name9.style.button_color = 'lightgreen'
self.worker_motility_persistence_time = FloatText(
value=5.0,
step=0.1,
style=style, layout=widget_layout)
param_name10 = Button(description='worker_migration_speed', disabled=True, layout=name_button_layout)
def __init__(self):
super(RegistryConfig, self).__init__(display='flex', flex_flow='column')
self.repo_field = ipy.Text(description='Image repository')
self.version_field = ipy.Text(description='Image version')
self._reset_config_button = ipy.Button(description='Reset',
tooltip='Reset to current configuration')
self._apply_changes_button = ipy.Button(description='Apply',
tooltip='Apply for this session')
self._save_changes_button = ipy.Button(description='Make default',
tooltip='Make this the default for new sessions')
self._pull_button = ipy.Button(description='Pull images',
tooltip=
'Download all moldesign images to the compute engine')
self.children = (ipy.HBox([self.repo_field, self.version_field]),
ipy.HBox([self._reset_config_button,
self._apply_changes_button,
self._pull_button]))
self._reset_config_button.on_click(self.reset_config)
self._apply_changes_button.on_click(self.apply_config)
self._save_changes_button.on_click(self.save_config)
self._test_button.on_click(self.test_connection)
options={'Animation': 'animation', 'Static': 'static'},
value='animation', description='Iterations:', margin='0.15cm')
self.iterations_mode.observe(self._stop_animation, names='value',
type='change')
self.iterations_mode.observe(self._index_visibility, names='value',
type='change')
index = {'min': 0, 'max': 1, 'step': 1, 'index': 0}
self.index_animation = AnimationOptionsWidget(
index, description='', index_style='slider',
loop_enabled=False, interval=0.)
slice_options = {'command': 'range({})'.format(1),
'length': 1}
self.index_slicing = SlicingCommandWidget(
slice_options, description='', example_visible=True,
continuous_update=False, orientation='vertical')
self.plot_errors_button = ipywidgets.Button(
description='Errors', margin='0.1cm',
visible=has_gt_shape and errors_function is not None)
self.plot_displacements_button = ipywidgets.Button(
description='Displacements', margin='0.1cm',
visible=displacements_function is not None)
self.plot_costs_button = ipywidgets.Button(
description='Costs', margin='0.1cm', visible=has_costs)
self.buttons_box = ipywidgets.HBox(
children=[self.plot_errors_button, self.plot_costs_button,
self.plot_displacements_button])
self.index_buttons_box = ipywidgets.VBox(
children=[self.index_animation, self.index_slicing,
self.buttons_box])
self.mode_index_buttons_box = ipywidgets.HBox(
children=[self.iterations_mode, self.index_buttons_box],
margin='0.2cm', padding='0.2cm')
param_name19.style.button_color = 'lightgreen'
self.drug_death_rate = FloatText(
value=0.004167,
step=0.001,
style=style, layout=widget_layout)
param_name20 = Button(description='worker_fraction', disabled=True, layout=name_button_layout)
param_name20.style.button_color = 'tan'
self.worker_fraction = FloatText(
value=0.10,
step=0.01,
style=style, layout=widget_layout)
param_name21 = Button(description='number_of_injected_cells', disabled=True, layout=name_button_layout)
param_name21.style.button_color = 'lightgreen'
self.number_of_injected_cells = IntText(
value=500,
step=10,
style=style, layout=widget_layout)
param_name22 = Button(description='tumor_radius', disabled=True, layout=name_button_layout)
param_name22.style.button_color = 'tan'
self.tumor_radius = FloatText(
value=200,
step=10,
style=style, layout=widget_layout)
param_name23 = Button(description='max_elastic_displacement', disabled=True, layout=name_button_layout)
param_name2.style.button_color = 'tan'
self.save_interval_after_therapy_start = FloatText(
value=3,
step=0.1,
style=style, layout=widget_layout)
param_name3 = Button(description='cargo_o2_relative_uptake', disabled=True, layout=name_button_layout)
param_name3.style.button_color = 'lightgreen'
self.cargo_o2_relative_uptake = FloatText(
value=0.1,
step=0.01,
style=style, layout=widget_layout)
param_name4 = Button(description='cargo_apoptosis_rate', disabled=True, layout=name_button_layout)
param_name4.style.button_color = 'tan'
self.cargo_apoptosis_rate = FloatText(
value=4.065e-5,
step=1e-05,
style=style, layout=widget_layout)
param_name5 = Button(description='cargo_relative_adhesion', disabled=True, layout=name_button_layout)
param_name5.style.button_color = 'lightgreen'
self.cargo_relative_adhesion = FloatText(
value=0,
step=0.01,
style=style, layout=widget_layout)
param_name6 = Button(description='cargo_relative_repulsion', disabled=True, layout=name_button_layout)
def define_site_description_image(self):
'''Widgets for site description parameters'''
self.w_latBut = widgets.Button(description='Browse Latitude Image')
self.w_lat = widgets.Text(
description='(Decimal degrees)', value='0', width=500)
self.w_lonBut = widgets.Button(description='Browse Longitude Image')
self.w_lon = widgets.Text(
description='(Decimal degrees):', value='0', width=500)
self.w_altBut = widgets.Button(description='Browse Altitude Image')
self.w_alt = widgets.Text(
description='(m):', value='0', width=500)
self.w_stdlon_But = widgets.Button(description='Browse Standard Longitude Image')
self.w_stdlon = widgets.Text(
description='(Decimal degrees):', value='0', width=500)
self.w_z_u_But = widgets.Button(description='Wind meas. height')
self.w_z_u = widgets.Text(
description='(m):', value=str(self.zu), width=500)
self.w_z_T_But = widgets.Button(description='Air temp. meas. height')
self.w_z_T = widgets.Text(
def make_controls(self):
button_begin = Button(icon="fast-backward", layout=Layout(width='100%'))
button_prev = Button(icon="backward", layout=Layout(width='100%'))
button_next = Button(icon="forward", layout=Layout(width='100%'))
button_end = Button(icon="fast-forward", layout=Layout(width='100%'))
#button_prop = Button(description="Propagate", layout=Layout(width='100%'))
#button_train = Button(description="Train", layout=Layout(width='100%'))
self.button_play = Button(icon="play", description="Play", layout=Layout(width="100%"))
refresh_button = Button(icon="refresh", layout=Layout(width="25%"))
self.position_text = IntText(value=0, layout=Layout(width="100%"))
self.control_buttons = HBox([
button_begin,
button_prev,
#button_train,
self.position_text,
button_next,
button_end,
self.button_play,