parameters: (self, instance, value)
docstring: Set up incident energy or range of energies in various formats
              or define autoEi
docstring_summary: Set up incident energy or range of energies in various formats
              or define autoEi
docstring_tokens: Set up incident energy or range of energies in various formats or define autoEi
function: def __set__(self, instance, value):
          """ Set up incident energy or range of energies in various formats
              or define autoEi"""
          if value is not None:
              if isinstance(value, str):
                  # Check autoEi
                  if value.lower() == 'auto':
                      self._use_autoEi = True
                      currentRun = instance.sample_run
                      if isinstance(currentRun, api.Workspace):
                          currentRun = currentRun.getRunNumber()
                      if currentRun != self._autoEiRunNumber or currentRun is None:
                          self._autoEiRunNumber = currentRun
                          self._autoEiCalculated = False
                          self._incident_energy = 0
                      self._cur_iter_en = 0
                      return
                  # Ei in string form is provided
                  else:
                      if value.find('[') > -1:
                          energy_list = True
                          value = value.replace('[', '').replace(']', '').strip()
                      else:
                          energy_list = False
                      en_list = value.split(',')
                      if len(en_list) > 1:
                          rez = []
                          for en_str in en_list:
                              val = float(en_str)
                              rez.append(val)
                          self._incident_energy = rez
                      else:
                          if energy_list:
                              self._incident_energy = [float(value)]
                          else:
                              self._incident_energy = float(value)
              else:
                  if isinstance(value, list):
                      rez = []
                      for val in value:
                          en_val = float(val)
                          if en_val <= 0:
                              raise KeyError("Incident energy has to be positive, but is: {0} ".format(en_val))
                          else:
                              rez.append(en_val)
                      self._incident_energy = rez
                  else:
                      self._incident_energy = float(value)
          else:
              raise KeyError("Incident energy have to be positive number of list of positive numbers. Got None")
          # here we have set specific energy or range of incident energies
          self._use_autoEi = False
  
          if isinstance(self._incident_energy, list):
              self._num_energies = len(self._incident_energy)
          else:
              self._num_energies = 1
          self._cur_iter_en = 0
          # pylint: disable=unused-variable
          ok, sev, message = self.validate(instance)
          if not ok:
              raise KeyError(message)
function_tokens: def __set__ ( self , instance , value ) : if value is not None : if isinstance ( value , str ) : # Check autoEi if value . lower ( ) == 'auto' : self . _use_autoEi = True currentRun = instance . sample_run if isinstance ( currentRun , api . Workspace ) : currentRun = currentRun . getRunNumber ( ) if currentRun != self . _autoEiRunNumber or currentRun is None : self . _autoEiRunNumber = currentRun self . _autoEiCalculated = False self . _incident_energy = 0 self . _cur_iter_en = 0 return # Ei in string form is provided else : if value . find ( '[' ) > - 1 : energy_list = True value = value . replace ( '[' , '' ) . replace ( ']' , '' ) . strip ( ) else : energy_list = False en_list = value . split ( ',' ) if len ( en_list ) > 1 : rez = [ ] for en_str in en_list : val = float ( en_str ) rez . append ( val ) self . _incident_energy = rez else : if energy_list : self . _incident_energy = [ float ( value ) ] else : self . _incident_energy = float ( value ) else : if isinstance ( value , list ) : rez = [ ] for val in value : en_val = float ( val ) if en_val <= 0 : raise KeyError ( "Incident energy has to be positive, but is: {0} " . format ( en_val ) ) else : rez . append ( en_val ) self . _incident_energy = rez else : self . _incident_energy = float ( value ) else : raise KeyError ( "Incident energy have to be positive number of list of positive numbers. Got None" ) # here we have set specific energy or range of incident energies self . _use_autoEi = False if isinstance ( self . _incident_energy , list ) : self . _num_energies = len ( self . _incident_energy ) else : self . _num_energies = 1 self . _cur_iter_en = 0 # pylint: disable=unused-variable ok , sev , message = self . validate ( instance ) if not ok : raise KeyError ( message )