parameters: (self)
return_statement: return issues
docstring: Validate input properties
          (virtual method)
docstring_summary: Validate input properties
          (virtual method)
docstring_tokens: Validate input properties ( virtual method )
function: def validateInputs(self):
          """Validate input properties
          (virtual method)
          """
          issues = dict()
  
          wkspParamName = 'InputWorkspace'
          # FIXME - need to find out the unit of the workspace
          allowedUnits = ['Degrees']
  
          # check for units
          wksp = self.getProperty(wkspParamName).value
          units = wksp.getAxis(0).getUnit().unitID()
          if units not in allowedUnits:
              allowedUnits = ["'%s'" % unit for unit in allowedUnits]
              allowedUnits = ', '.join(allowedUnits)
              issues[wkspParamName] = "Only support units %s" % allowedUnits
              print(f'[ERROR] Workspace {wksp.name()} with unit {units} is not supported.'
                    f'Allowed units are {allowedUnits}')
  
          # check output file name: whether user can access and write files
          output_file_name_property = 'OutputFilename'
          gsas_name = self.getProperty(output_file_name_property).value
  
          try:
              temp_file = open(gsas_name, 'w')
          except PermissionError as per_err:
              # error message
              issues[output_file_name_property] = f'User is not allowed to write file {gsas_name} due to ' \
                                                  f'{per_err}'
          else:
              # delete the temp file
              temp_file.close()
              os.remove(gsas_name)
  
          return issues
function_tokens: def validateInputs ( self ) : issues = dict ( ) wkspParamName = 'InputWorkspace' # FIXME - need to find out the unit of the workspace allowedUnits = [ 'Degrees' ] # check for units wksp = self . getProperty ( wkspParamName ) . value units = wksp . getAxis ( 0 ) . getUnit ( ) . unitID ( ) if units not in allowedUnits : allowedUnits = [ "'%s'" % unit for unit in allowedUnits ] allowedUnits = ', ' . join ( allowedUnits ) issues [ wkspParamName ] = "Only support units %s" % allowedUnits print ( f'[ERROR] Workspace {wksp.name()} with unit {units} is not supported.' f'Allowed units are {allowedUnits}' ) # check output file name: whether user can access and write files output_file_name_property = 'OutputFilename' gsas_name = self . getProperty ( output_file_name_property ) . value try : temp_file = open ( gsas_name , 'w' ) except PermissionError as per_err : # error message issues [ output_file_name_property ] = f'User is not allowed to write file {gsas_name} due to ' f'{per_err}' else : # delete the temp file temp_file . close ( ) os . remove ( gsas_name ) return issues