Index: src/sas/qtgui/Calculators/DataOperationUtilityPanel.py
===================================================================
--- src/sas/qtgui/Calculators/DataOperationUtilityPanel.py	(revision f0bb71111cd83022768469968b3891e8656d0417)
+++ src/sas/qtgui/Calculators/DataOperationUtilityPanel.py	(revision 0c468bf6b4ba74af507bdcabc388e3094ca3e790)
@@ -126,28 +126,26 @@
     def onCompute(self):
         """ perform calculation """
-        # check compatibility of datasets before calculation
-        if self.onCheckChosenData():
-            # set operator to be applied
-            operator = self.cbOperator.currentText()
-            # calculate and send data to DataExplorer
-            output = None
-            try:
-                data1 = self.data1
-                data2 = self.data2
-                exec "output = data1 %s data2" % operator
-            except:
-                raise
-
-            self.output = output
-
-            # if outputname was unused, write output result to it
-            # and display plot
-            if self.onCheckOutputName():
-                # add outputname to self.filenames
-                self.list_data_items.append(str(self.txtOutputData.text()))
-                # send result to DataExplorer
-                self.onPrepareOutputData()
-                # plot result
-                self.updatePlot(self.graphOutput, self.layoutOutput, self.output)
+        # set operator to be applied
+        operator = self.cbOperator.currentText()
+        # calculate and send data to DataExplorer
+        output = None
+        try:
+            data1 = self.data1
+            data2 = self.data2
+            exec "output = data1 %s data2" % operator
+        except:
+            raise
+
+        self.output = output
+
+        # if outputname was unused, write output result to it
+        # and display plot
+        if self.onCheckOutputName():
+            # add outputname to self.filenames
+            self.list_data_items.append(str(self.txtOutputData.text()))
+            # send result to DataExplorer
+            self.onPrepareOutputData()
+            # plot result
+            self.updatePlot(self.graphOutput, self.layoutOutput, self.output)
 
     def onPrepareOutputData(self):
@@ -207,13 +205,9 @@
             self.data1 = None
             self.data1OK = False
-            self.cmdCompute.setEnabled(False)
-            self.onCheckChosenData()
+            self.cmdCompute.setEnabled(False) # self.onCheckChosenData())
             return
 
         else:
-            # Enable Compute button only if Data2 is defined
-            self.cmdCompute.setEnabled(self.data2OK)
             self.data1OK = True
-            self.onCheckChosenData()
             # get Data1
             key_id1 = self._findId(choice_data1)
@@ -223,5 +217,6 @@
             # plot default for output graph
             self.newPlot(self.graphOutput, self.layoutOutput)
-
+            # Enable Compute button only if Data2 is defined and data compatible
+            self.cmdCompute.setEnabled(self.onCheckChosenData())
 
     def onSelectData2(self):
@@ -235,4 +230,5 @@
             self.data2OK = False
             self.onCheckChosenData()
+            self.cmdCompute.setEnabled(False)
             return
 
@@ -242,6 +238,6 @@
             self.data2 = float(self.txtNumber.text())
 
-            # Enable Compute button only if Data1 is defined
-            self.cmdCompute.setEnabled(self.data1OK)
+            # Enable Compute button only if Data1 defined and compatible data
+            self.cmdCompute.setEnabled(self.onCheckChosenData())
             # Display value of coefficient in graphData2
             self.updatePlot(self.graphData2, self.layoutData2, self.data2)
@@ -251,14 +247,14 @@
 
         else:
-            self.cmdCompute.setEnabled(self.data1OK)
+            self.txtNumber.setEnabled(False)
             self.data2OK = True
-            self.txtNumber.setEnabled(False)
             key_id2 = self._findId(choice_data2)
             self.data2 = self._extractData(key_id2)
+            self.cmdCompute.setEnabled(self.onCheckChosenData())
+
             # plot Data2
             self.updatePlot(self.graphData2, self.layoutData2, self.data2)
             # plot default for output graph
             self.newPlot(self.graphOutput, self.layoutOutput)
-            self.onCheckChosenData()
 
     def onInputCoefficient(self):
@@ -285,42 +281,46 @@
 
     def onCheckChosenData(self):
-        """ Before running compute, check that data1 and 2 are compatible """
-
-        if self.cbData2.currentText() == 'Number':
-            self.cbData1.setStyleSheet(QtCore.QString(BG_WHITE))
-            self.cbData2.setStyleSheet(QtCore.QString(BG_WHITE))
-            return True
-
-        elif self.data1.__class__.__name__ != self.data2.__class__.__name__:
-            self.cbData1.setStyleSheet(QtCore.QString(BG_RED))
-            self.cbData2.setStyleSheet(QtCore.QString(BG_RED))
-            logging.info('Cannot compute data of different dimensions')
+        """ check that data1 and data2 are compatible """
+
+        if not all([self.data1OK, self.data2OK]):
             return False
-
-        elif self.data1.__class__.__name__ == 'Data1D'\
-                and (len(self.data2.x) != len(self.data1.x) or
-                         not all(i == j for i, j in zip(self.data1.x, self.data2.x))):
-            logging.info('Cannot compute 1D data of different lengths')
-            self.cbData1.setStyleSheet(QtCore.QString(BG_RED))
-            self.cbData2.setStyleSheet(QtCore.QString(BG_RED))
-            return False
-
-        elif self.data1.__class__.__name__ == 'Data2D' \
-                and (len(self.data2.qx_data) != len(self.data1.qx_data) \
-                or len(self.data2.qy_data) != len(self.data1.qy_data)
-                or not all(i == j for i, j in
-                                 zip(self.data1.qx_data, self.data2.qx_data))
-                or not all(i == j for i, j in
-                            zip(self.data1.qy_data, self.data2.qy_data))
-                     ):
-            self.cbData1.setStyleSheet(QtCore.QString(BG_RED))
-            self.cbData2.setStyleSheet(QtCore.QString(BG_RED))
-            logging.info('Cannot compute 2D data of different lengths')
-            return False
-
         else:
-            self.cbData1.setStyleSheet(QtCore.QString(BG_WHITE))
-            self.cbData2.setStyleSheet(QtCore.QString(BG_WHITE))
-            return True
+            if self.cbData2.currentText() == 'Number':
+                self.cbData1.setStyleSheet(QtCore.QString(BG_WHITE))
+                self.cbData2.setStyleSheet(QtCore.QString(BG_WHITE))
+                return True
+
+            elif self.data1.__class__.__name__ != self.data2.__class__.__name__:
+                self.cbData1.setStyleSheet(QtCore.QString(BG_RED))
+                self.cbData2.setStyleSheet(QtCore.QString(BG_RED))
+                print self.data1.__class__.__name__ != self.data2.__class__.__name__
+                logging.info('Cannot compute data of different dimensions')
+                return False
+
+            elif self.data1.__class__.__name__ == 'Data1D'\
+                    and (len(self.data2.x) != len(self.data1.x) or
+                             not all(i == j for i, j in zip(self.data1.x, self.data2.x))):
+                logging.info('Cannot compute 1D data of different lengths')
+                self.cbData1.setStyleSheet(QtCore.QString(BG_RED))
+                self.cbData2.setStyleSheet(QtCore.QString(BG_RED))
+                return False
+
+            elif self.data1.__class__.__name__ == 'Data2D' \
+                    and (len(self.data2.qx_data) != len(self.data1.qx_data) \
+                    or len(self.data2.qy_data) != len(self.data1.qy_data)
+                    or not all(i == j for i, j in
+                                     zip(self.data1.qx_data, self.data2.qx_data))
+                    or not all(i == j for i, j in
+                                zip(self.data1.qy_data, self.data2.qy_data))
+                         ):
+                self.cbData1.setStyleSheet(QtCore.QString(BG_RED))
+                self.cbData2.setStyleSheet(QtCore.QString(BG_RED))
+                logging.info('Cannot compute 2D data of different lengths')
+                return False
+
+            else:
+                self.cbData1.setStyleSheet(QtCore.QString(BG_WHITE))
+                self.cbData2.setStyleSheet(QtCore.QString(BG_WHITE))
+                return True
 
     def onCheckOutputName(self):
Index: src/sas/qtgui/Calculators/UnitTesting/DataOperationUtilityTest.py
===================================================================
--- src/sas/qtgui/Calculators/UnitTesting/DataOperationUtilityTest.py	(revision d5c5d3dac558e84d4de22e41b9d47bbbcd007de1)
+++ src/sas/qtgui/Calculators/UnitTesting/DataOperationUtilityTest.py	(revision 0c468bf6b4ba74af507bdcabc388e3094ca3e790)
@@ -135,5 +135,4 @@
 
 
-    # @patch('DataOperationUtilityPanel.')
     def testOnCompute(self):
         """ Test onCompute function """
@@ -163,6 +162,4 @@
 
         self.assertTrue(self.widget.onPrepareOutputData.called_once())
-
-        # GuiManager.updateModelFromDataOperationPanel
 
     def testOnSelectData1(self):
@@ -283,4 +280,9 @@
     def testCheckChosenData(self):
         """ Test check of data compatibility """
+        # set the 2 following to True since we want to check
+        # the compatibility of dimensions
+        self.widget.data1OK = True
+        self.widget.data2OK = True
+
         # Case 1: incompatible dimensions
         self.widget.data1 = Data1D(x=[1.0, 2.0, 3.0], y=[11.0, 12.0, 13.0],
