Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
format='%0.6f', ),
ObjectColumn(name='weighted_mean_err',
format='%0.6f',
label=PLUSMINUS_ONE_SIGMA),
ObjectColumn(name='mswd',
format='%0.3f',
label='MSWD'),
ObjectColumn(name='displayn', label='N'),
ObjectColumn(name='mean', format='%0.6f', label='Mean'),
ObjectColumn(name='std', format='%0.6f', label='Std'),
ObjectColumn(name='min', format='%0.6f', label='Min'),
ObjectColumn(name='max', format='%0.6f', label='Max'),
ObjectColumn(name='dev', format='%0.6f', label='Dev.'),
ObjectColumn(name='percent_dev', format='%0.2f', label='% Dev.')]
button_grp = HGroup(UItem('save_button'), UItem('save_as_button'),
UItem('clear_button'), UItem('open_via_finder_button'),
UItem('add_record_button'),
UItem('calculate_button')),
repo_grp = VGroup(BorderVGroup(UItem('repo_filter'),
UItem('repositories',
width=200,
editor=ListStrEditor(selected='repository')),
label='Repositories'),
BorderVGroup(UItem('name_filter'),
UItem('names', editor=ListStrEditor(selected='name')),
label='DataSets'))
record_grp = VSplit(UItem('records', editor=TableEditor(columns=cols,
selected='selected',
sortable=False,
save_button : instance(`Button`)
Button to save the measure (see `MeasurementEditorHandler`)
save_template_button : instance(`Button`)
Button to save the measure as a template
(see `MeasurementEditorHandler`)
"""
measurement_view = Instance(MeasurementTreeView, ())
root_task = Property
save_button = Button('Save measure')
save_template_button = Button('Save as template')
traits_view = View(
VGroup(
UItem('measurement_view', style = 'custom'),
HGroup(
UItem('save_button'),
UItem('save_template_button'),
),
),
handler = MeasurementEditorHandler(),
resizable = True,
buttons = ['OK'],
)
def _get_root_task(self):
"""`root_task` getter method
"""
return self.measurement_view.root_task
def _set_root_task(self, value):
"""`root_task` setter method
def _results_group(self):
grp = VGroup(
CustomLabel(selector_name('id_string'), color='red'),
HGroup(
CustomLabel(selector_name('num_records')), spring,
Item(selector_name('limit'))),
Item(selector_name('records'),
style='custom',
width=600,
editor=myTabularEditor(adapter=ResultsAdapter(),
selected=selector_name('selected'),
scroll_to_row=selector_name('scroll_to_row'),
column_clicked=selector_name('column_clicked'),
multi_select=True,
operations=['move'],
editable=True,
drag_external=True,
dclicked=selector_name('dclicked'),
key_pressed=selector_name('key_pressed')),
show_label=False),
def traits_view(self):
v = View(UItem('graph', style='custom'),
VGroup(
HGroup(Item('nslope'), Item('nintercept'), Item('nnoise')),
HGroup(Item('dslope'), Item('dintercept'), Item('dnoise')),
Item('time_zero_offset'),
Item('intercept_ratio', style='readonly'),
Item('ratio_intercept', style='readonly'),
Item('percent_diff', style='readonly')))
return v
def _get_sample_group(self):
irrad_grp = BorderVGroup(HGroup(UItem('irradiation_enabled',
tooltip='Enable Irradiation filter'),
UItem('irradiation',
enabled_when='irradiation_enabled',
editor=EnumEditor(name='irradiations'))),
UItem('level',
enabled_when='irradiation_enabled',
editor=EnumEditor(name='levels')),
visible_when='irradiation_visible',
label='Irradiations')
project_grp = BorderVGroup(UItem('projects',
height=100,
editor=FilterTabularEditor(editable=False,
enabled_cb='project_enabled',
use_fuzzy=True,
column_index=-1,
def traits_view(self):
ngrp = HGroup(Item('fname',
tooltip='No spaces in name. Name is automatically prefixed with the number of steps'))
dgrp = HGroup(Item('root', label='Directory'))
v = View(VGroup(ngrp, dgrp),
kind='livemodal',
width=400,
title='Save Step Heat Template',
buttons=['OK', 'Cancel'],
resizable=True)
return v
def traits_view(self):
hgrp = VGroup(HGroup(Item('hpost_pad', label='Pad')),
UItem('hpost_date', style='custom'),
HGroup(UItem('hpost_time')),
show_border=True,
label='High')
lgrp = VGroup(HGroup(Item('lpost_pad', label='Pad')),
UItem('lpost_date', style='custom'),
HGroup(UItem('lpost_time')),
show_border=True,
label='Low')
atype_grp = HGroup(UItem('atypes',
style='custom',
editor=CheckListEditor(name='available_atypes', cols=3)),
show_border=True, label='Analysis Types')
mgrp = HGroup(UItem('mass_spectrometers',
style='custom',
editor=CheckListEditor(name='available_mass_spectrometers', cols=3)),
show_border=True, label='Mass Spectrometers')
v = View(VGroup(HGroup(lgrp, hgrp),
atype_grp,
def traits_view(self):
ee = HGroup(Item('error_info_fontname', label='Error Info'),
UItem('error_info_fontsize'))
ll = HGroup(Item('label_fontname', label='Labels'),
UItem('label_fontsize'))
pp = HGroup(Item('plateau_fontname', label='Plateau'),
UItem('plateau_fontsize'))
ii = HGroup(Item('integrated_fontname', label='Integrated'),
UItem('integrated_fontsize'))
fgrp = VGroup(UItem('fontname'),
ee, ll, pp, ii,
HGroup(self._get_xfont_group(),
self._get_yfont_group()),
label='Fonts', show_border=True)
g = VGroup(self._get_bg_group(),
self._get_padding_group(),
self._get_grid_group())
return self._make_view(VGroup(g, fgrp))
class Visualization(HasTraits):
"The class that contains the dialog"
scene = Instance(MlabSceneModel, ())
def __init__(self):
HasTraits.__init__(self)
x, y, z = curve(n_turns=2)
# Populating our plot
self.plot = self.scene.mlab.plot3d(x, y, z)
# Describe the dialog
view = View(Item('scene', height=300, show_label=False,
editor=SceneEditor()),
HGroup('n_turns'), resizable=True)
# Fire up the dialog
Visualization().configure_traits()
class OpenRecentPreferencesPane(PreferencesPane):
""" The preferences pane for the Framework application.
"""
#### 'PreferencesPane' interface ##########################################
# The factory to use for creating the preferences model object.
model_factory = OpenRecentPreferences
#### 'FrameworkPreferencesPane' interface ################################
view = View(
VGroup(HGroup(Item('list_length'),
Label('Number of recent files to remember'),
show_labels = False),
HGroup(Item('add_at_top'),
Label('Add new file to top of list'),
show_labels = False),
label='Open Recent'),
resizable=True)
# FIXME: RecentFiles doesn't work as a traits object! Weird.
#
#class RecentFiles(HasTraits):
# """Open a file from the list of recently opened files.
#
# Maintains a list of the most recently opened files so that the next time
# you start the application you can see what you were editing last time.
# This list is automatically maintained, so every time you open a new file,
# it is added to the list. This list is limited in size by the classpref
# 'list_length' in L{RecentFilesPlugin}.
# """