Esempio n. 1
0
    def traits_view(self):
        ident_grp = VGroup(Item('irradiation', editor=EnumEditor(name='irradiations')),
                           Item('level', editor=EnumEditor(name='levels')),
                           Item('identifier', editor=EnumEditor(name='identifiers')),
                           Item('aliquot_offset'),
                           Item('step_offset'),
                           Item('dry',
                                tooltip='Do a dry run. Do not save changes to database'),
                           Item('use_secondary', label='Use Secondary DB',
                                tooltip='Also modify the secondary db, e.g. a Mass Spec db.'))

        ogrp = UItem('analyses', editor=TabularEditor(adapter=AnalysisAdapter(),
                                                      editable=False))
        ngrp = UItem('modified_analyses', editor=TabularEditor(adapter=AnalysisAdapter(),
                                                               refresh='refresh',
                                                               multi_select=True,
                                                               selected='selected'))
        agrp = HGroup(ogrp, ngrp)
        v = View(VGroup(ident_grp, agrp),
                 resizable=True,
                 width=600,
                 kind='livemodal',
                 title='Edit Analyses',
                 buttons=['OK', 'Cancel'])
        return v
Esempio n. 2
0
 def traits_view(self):
     contour_grp = HGroup(Item('color_map_name',
                               label='Color Map',
                               editor=EnumEditor(values=sorted(color_map_name_dict.keys()))),
                          Item('levels'),
                          Item('marker_size'),
                          visible_when='plot_kind=="Contour"')
     monitor_grp = Item('monitor', editor=EnumEditor(name='monitors'))
     v = View(
         VGroup(HGroup(UItem('calculate_button'),
                       UItem('data_source', editor=EnumEditor(values=['database', 'file'])),
                       monitor_grp),
                HGroup(Item('save_mean_j', label='Save Mean J'),
                       Item('auto_clear_cache', label='Auto Clear Cache')),
                Item('mean_j_error_type', label='Mean J Error'),
                HGroup(Item('use_weighted_fit'),
                       Item('use_monte_carlo'),
                       Item('monte_carlo_ntrials',
                            enabled_when='object.use_monte_carlo')),
                Item('predicted_j_error_type', label='Predicted J Error',
                     enabled_when='not (object.use_weighted_fit or object.use_monte_carlo)'),
                HGroup(Item('group_positions'),
                       Item('object.monitor.sample',
                            style='readonly', label='Sample')),
                Item('show_labels',
                     label='Display Labels',
                     tooltip='Display hole labels on plot'),
                HGroup(UItem('plot_kind'),
                       Item('model_kind', label='Fit Model',
                            editor=EnumEditor(values=['Bowl', 'Plane']))),
                # UItem('plot_kind', editor=EnumEditor(values=['Contour', 'Hole vs J']))),
                contour_grp))
     return v
Esempio n. 3
0
    def traits_view(self):
        w_view = 350 if is_display_small() else 480

        parameters_group = VGroup(
            Item('_'),
            HGroup(
                VGroup(
                    Spring(),
                    Item('handler.omega_hinton_diagram',
                         style='custom',
                         resizable=False,
                         show_label=False,
                         width=w_view), Spring()), Spring(),
                VGroup(Spring(), Item('handler.view_omega', show_label=False),
                       Spring())), Spring(), Item('_'), Spring(),
            HGroup(
                VGroup(
                    UItem('handler.theta_views'),
                    UItem('handler.theta_view',
                          style='custom',
                          resizable=False,
                          width=w_view), Spring()), Spring(),
                VGroup(Spring(), UItem('handler.view_theta'), Spring())))

        body = VGroup(Include('info_group'), parameters_group)

        traits_view = View(body, buttons=[OKButton], resizable=True)
        return traits_view
Esempio n. 4
0
 def _get_toggle_group(self):
     g = HGroup(
         # UItem('global_fit',editor=EnumEditor(name='fit_types')),
         # UItem('global_error_type', editor=EnumEditor(name='error_types')),
         UItem('show_all_button',
               editor=ButtonEditor(label_value='show_all_label')),
         UItem('use_all_button'))
     return g
Esempio n. 5
0
    def traits_view(self):
        v = View(
            HGroup(UItem('use'), Item('center'), Item('threshold'),
                   UItem('color')))
        return v


#============= EOF =============================================
Esempio n. 6
0
 def traits_view(self):
     v = View(UItem('console',
                    style='custom',
                    editor=TextEditor(read_only=True)),
              UItem('message',
                    editor=TextEditor(enter_set=True, auto_set=False)),
              width=500,
              height=400,
              resizable=True)
     return v
Esempio n. 7
0
    def traits_view(self):
        l = VGroup(UItem('low_post_time'),
                   UItem('low_post_date', style='custom'))
        h = VGroup(UItem('high_post_time'),
                   UItem('high_post_date', style='custom'))

        v = okcancel_view(Item('pad', label='Pad (hrs)'),
                          HGroup(l, h),
                          width=500)
        return v
Esempio n. 8
0
 def traits_view(self):
     ctrl_grp = VGroup(
         # HGroup(UItem('add_band')),
         UItem('highlight_bands', height=115,editor=ListEditor(mutable=False,
                                                    style='custom',
                                                    editor=InstanceEditor())))
     v = View(
         VSplit(
         ctrl_grp,
         UItem('container',
               editor=ComponentEditor(height=700))))
     return v
    def traits_view(self):
        preview = CustomLabel('preview',
                              size_name='fontsize',
                              color_name='textcolor',
                              bgcolor_name='bgcolor')

        v = View(
            VGroup(HGroup(UItem('fontsize'), UItem('textcolor'),
                          UItem('bgcolor')),
                   preview,
                   show_border=True,
                   label=self.label))
        return v
Esempio n. 10
0
    def traits_view(self):
        l = VGroup(UItem('low_post_time'),
                   UItem('low_post_date', style='custom'))
        h = VGroup(UItem('high_post_time'),
                   UItem('high_post_date', style='custom'))

        v = View(UItem('pad'),
                 HGroup(l, h),
                 kind='livemodal',
                 width=500,
                 resizable=True,
                 buttons=['OK', 'Cancel'])
        return v
Esempio n. 11
0
 def _get_fit_group(self):
     cols = self._get_columns()
     editor = myTableEditor(columns=cols,
                            sortable=False,
                            on_command_key=self._update_command_key)
     grp = UItem('fits', style='custom', editor=editor)
     return grp
Esempio n. 12
0
 def traits_view(self):
     v = View(
         UItem('a', editor=VideoEditor()),
         # UItem('state'),
         width=1200,
         height=700)
     return v
Esempio n. 13
0
 def traits_view(self):
     contour_grp = VGroup(Item('color_map_name',
                               label='Color Map',
                               editor=EnumEditor(values=sorted(color_map_name_dict.keys()))),
                          Item('levels'),
                          visible_when='plot_kind=="Contour"')
     monitor_grp=Item('monitor', editor=EnumEditor(name='monitors'))
     v = View(
         VGroup(HGroup(UItem('calculate_button'),
                       UItem('data_source', editor=EnumEditor(values=['database', 'file'])),
                       monitor_grp),
                HGroup(Item('group_positions'), Item('object.monitor.sample', style='readonly',label='Sample')),
                HGroup(UItem('plot_kind'),
                       Item('model_kind', label='Fit Model',
                         editor=EnumEditor(values=['Bowl', 'Plane']))),
                       # UItem('plot_kind', editor=EnumEditor(values=['Contour', 'Hole vs J']))),
                contour_grp))
     return v
Esempio n. 14
0
class A(HasTraits):
    text = Str
    traits_view = View(UItem('text',
                             editor=myTextEditor(wrap=False,
                                                 editable=False,
                                                 tab_width=15,
                                                 bgcolor='#F7F6D0',
                                                 fontsize=10)),
                       resizable=True,
                       width=700)
Esempio n. 15
0
 def default_traits_view(self):
     return View(
         VGroup(
             UItem(
                 "resizable_readonly_item",
                 resizable=True,
                 style="readonly",
             ), ),
         height=_DIALOG_HEIGHT,
         width=_DIALOG_WIDTH,
     )
Esempio n. 16
0
    def traits_view(self):
        nclasses = self.beta.shape[1]
        w_table = WIDTH_CELL * nclasses
        h_table = HEIGHT_CELL * nclasses
        w_view = min(MAX_WIDTH, w_table + W_MARGIN)
        h_view = min(MAX_HEIGHT, h_table + HEIGHT_CELL + H_MARGIN)

        view = View(
            VGroup(
                Label('Beta parameters (prior over pi):'),
                UItem('beta',
                      editor=TabularEditor(
                          adapter=Array2DAdapter(ncolumns=nclasses,
                                                 format='%.4f',
                                                 show_index=True,
                                                 count_from_one=False),
                          ),
                      width = w_table,
                      height = HEIGHT_CELL,
                      padding = 10
                ),
                Label('Alpha parameters (prior over theta):'),
                UItem('alpha',
                      editor=TabularEditor(
                          adapter=Array2DAdapter(ncolumns=nclasses,
                                                 format='%.4f',
                                                 show_index=True,
                                                 count_from_one=False),
                          ),
                      width = w_table,
                      height = h_table,
                      padding = 10
                ),
            ),
            width = w_view,
            height = h_view,
            scrollable = True,
            resizable = True,
            buttons = ['OK', 'Cancel']
        )
        return view
Esempio n. 17
0
 def _get_auto_group(self):
     return VGroup(
         HGroup(
             icon_button_editor(
                 'plot_button',
                 'refresh',
                 tooltip='Replot the isotope evolutions. '
                 'This may take awhile if many analyses are selected'),
             icon_button_editor('save_event',
                                'database_save',
                                tooltip='Save fits to database'),
             Item(
                 'auto_update',
                 label='Auto Plot',
                 tooltip=
                 'Should the plot refresh after each change ie. "fit" or "show". '
                 'It is not advisable to use this option with many analyses'
             )),
         HGroup(
             UItem('global_fit', editor=EnumEditor(name='fit_types')),
             UItem('global_error_type',
                   editor=EnumEditor(name='error_types'))))
Esempio n. 18
0
 def _get_fit_group(self):
     cols = self._get_columns()
     editor = myTableEditor(columns=cols,
                            selected='selected',
                            selection_mode='rows',
                            sortable=False,
                            edit_on_first_click=False,
                            clear_selection_on_dclicked=True,
                            on_command_key=self._update_command_key,
                            cell_bg_color='red',
                            cell_font='modern 10')
     grp = UItem('fits', style='custom', editor=editor)
     return grp
Esempio n. 19
0
    def traits_view(self):
        self.visible = True
        editor = self.editor_klass(clear='clear_event',
                                   refresh='refresh',
                                   font_size='font_size',
                                   bgcolor='bgcolor',
                                   text_width='text_width',
                                   max_blocks=self.max_blocks)

        v = View(UItem('qmessage', editor=editor),
                 x=self.x,
                 y=self.y,
                 width=self.width,
                 height=self.height,
                 title=self.title)
        return v
Esempio n. 20
0
    def traits_view(self):
        ## Model view

        # adjust sizes to display size
        if is_display_small():
            # full view size
            w_view, h_view = 1024, 768
            w_data_create_group = 350
            w_data_info_group = 500
            h_annotations_stats = 270
        else:
            w_view, h_view = 1300, 850
            w_data_create_group = 400
            w_data_info_group = 700
            h_annotations_stats = 330

        model_create_group = (VGroup(HGroup(
            UItem(name='model_name', width=200),
            UItem(name='new_model', width=100),
            UItem(name='get_info_on_model', width=100, height=25),
        ),
                                     label='Create new model'))

        model_group = (VGroup(
            model_create_group,
            VGroup(
                Item('model_view', style='custom', show_label=False,
                     width=400),
                label='Model view',
            ),
        ), )

        ## Data view

        data_create_group = VGroup(
            #Label('Open annotation file:', width=800),
            HGroup(
                Item('annotations_file',
                     style='simple',
                     label='Open file:',
                     width=w_data_create_group,
                     height=25), UItem('new_annotations', height=25)),
            label='Load/create annotations',
            show_border=False,
        )

        data_info_group = VGroup(
            Item(
                'annotations_view',
                style='custom',
                show_label=False,
                visible_when='annotations_are_defined',
                width=w_data_info_group,
            ),
            Item('annotations_stats_view',
                 style='custom',
                 show_label=False,
                 visible_when='annotations_are_defined',
                 height=h_annotations_stats),
            label='Data view',
        )

        data_group = (VGroup(
            data_create_group,
            data_info_group,
        ), )

        ## (Model,Data) view

        model_data_group = (
            VGroup(
                #Item('info_string', show_label=False, style='readonly'),
                Item('log_likelihood',
                     label='Log likelihood',
                     style='readonly'),
                HGroup(
                    Item('ml_estimate',
                         enabled_when='annotations_are_defined'),
                    Item('map_estimate',
                         enabled_when='annotations_are_defined'),
                    Item('sample_posterior_over_accuracy',
                         enabled_when='annotations_are_defined'),
                    Item('estimate_labels',
                         enabled_when='annotations_are_defined'),
                    Spring(),
                    Item('add_to_database',
                         enabled_when='annotations_are_defined'),
                    Item('open_database'),
                    show_labels=False,
                ),
                label='Model-data view',
            ))

        ## Full view

        full_view = View(
            VGroup(
                HGroup(model_group, data_group),
                model_data_group,
            ),
            title='PyAnno - Models of data annotations by multiple curators',
            width=w_view,
            height=h_view,
            resizable=False)

        return full_view