def _update_data_table(self):        
     '''Fill in 2x2 table from other entries in the table '''
     
     self.raw_data_table.blockSignals(True)
     
     params = self._get_table_vals()
     computed_params = calc_fncs.compute_2x2_table(params)
     print "Computed Params", computed_params
     if computed_params:
         self._set_vals(computed_params)  # computed --> table widget
         
     self.raw_data_table.blockSignals(False)
Ejemplo n.º 2
0
    def _update_data_table(self):
        '''Fill in 2x2 table from other entries in the table '''

        self.raw_data_table.blockSignals(True)

        params = self._get_table_vals()
        computed_params = calc_fncs.compute_2x2_table(params)
        print "Computed Params", computed_params
        if computed_params:
            self._set_vals(computed_params)  # computed --> table widget

        self.raw_data_table.blockSignals(False)
 def _update_data_table(self):
     '''Try to calculate rest of 2x2 table from existing cells'''
     
     calc_fncs.block_signals(self.entry_widgets, True)
     
     params = self._get_table_vals()
     computed_params = calc_fncs.compute_2x2_table(params)
     print "Computed Params", computed_params
     if computed_params:
         self._set_vals(computed_params) # computed --> table widget
     
     # Compute prevalence if possible
     if (not computed_params['c1sum'] in EMPTY_VALS) and (not computed_params['total'] in EMPTY_VALS):
         prevalence = float(computed_params['c1sum'])/float(computed_params['total'])
         prev_str = str(prevalence)[:7]
         self.prevalence_txt_box.setText("%s" % prev_str)
         self.enable_txt_box_input()
     
     calc_fncs.block_signals(self.entry_widgets, False)