parameters: (self, mappable)
return_statement: return mappable
docstring: Disable the Log option if no positive value can be found from given data (image)
docstring_summary: Disable the Log option if no positive value can be found from given data (image)
docstring_tokens: Disable the Log option if no positive value can be found from given data ( image )
function: def _validate_mappable(self, mappable):
          """Disable the Log option if no positive value can be found from given data (image)"""
          index = NORM_OPTS.index("Log")
          if mappable.get_array() is not None:
              if np.all(mappable.get_array() <= 0):
                  self.norm.model().item(index, 0).setEnabled(False)
                  self.norm.setItemData(index, "Log scale is disabled for non-positive data",
                                        Qt.ToolTipRole)
                  if isinstance(mappable.norm, LogNorm):
                      mappable.norm = self._create_linear_normalize_object()
                      self.norm.blockSignals(True)
                      self.norm.setCurrentIndex(0)
                      self.norm.blockSignals(False)
              else:
                  if not self.norm.model().item(index, 0).isEnabled():
                      self.norm.model().item(index, 0).setEnabled(True)
                      self.norm.setItemData(index, "", Qt.ToolTipRole)
  
          return mappable
function_tokens: def _validate_mappable ( self , mappable ) : index = NORM_OPTS . index ( "Log" ) if mappable . get_array ( ) is not None : if np . all ( mappable . get_array ( ) <= 0 ) : self . norm . model ( ) . item ( index , 0 ) . setEnabled ( False ) self . norm . setItemData ( index , "Log scale is disabled for non-positive data" , Qt . ToolTipRole ) if isinstance ( mappable . norm , LogNorm ) : mappable . norm = self . _create_linear_normalize_object ( ) self . norm . blockSignals ( True ) self . norm . setCurrentIndex ( 0 ) self . norm . blockSignals ( False ) else : if not self . norm . model ( ) . item ( index , 0 ) . isEnabled ( ) : self . norm . model ( ) . item ( index , 0 ) . setEnabled ( True ) self . norm . setItemData ( index , "" , Qt . ToolTipRole ) return mappable