1. Flashpoint
  2. orange-bioinformatics3

Commits

Flashpoint  committed ad79a4b

Added error catching for data with discrete attributes and only 1 feature.

  • Participants
  • Parent commits 9be60f3
  • Branches default

Comments (0)

Files changed (1)

File _bioinformatics/widgets/OWHeatMap.py

View file
         self.BSpotVar = self.meta[0] if self.meta else None
         self.BAnnotationIndx = 0
         self.BAnnotationVar = self.meta[0] if self.meta else None
-
+        
     def get_candidate_splits(self):
         """ Return candidate labels on which we can split the data. 
         """
         self.annotationCombo.clear()
         self.splitLB.clear()
         self.meta = []
-        
         self.clear_scene()
         
     def clear_scene(self):
         
         self.selection_rects = []
         
-        
     def saveFig(self):
         sizeDlg = OWChooseImageSizeDlg(self.scene, parent=self)
         sizeDlg.exec_()
         
     def handleNewSignals(self):
         self.send('Examples', None)
+        self.error(0)
         if self.data:
-            self.update_heatmaps()
+            if self.data.domain.has_discrete_attributes(): 
+                self.error(0, "Data contains discrete attributes")
+            elif len(self.data.domain.features) == 1:
+                self.error(0, "Cannot construct heatmap with only a single feature")
+            else:
+                self.update_heatmaps()
         else:
             self.clear()
-        
+
         if self.data:
             self.openContext("Selection", self.data)