original_docstring: 
          Load the scan energies from the file. Returns arrays containing the
          angles (in radians) and energies (in J/mol).
          
docstring: Load the scan energies from the file. Returns arrays containing the
  angles (in radians) and energies (in J/mol).
docstring_tokens: Load the scan energies from the file . Returns arrays containing the angles ( in radians ) and energies ( in J / mol ) .
code: def load(self):
          """
          Load the scan energies from the file. Returns arrays containing the
          angles (in radians) and energies (in J/mol).
          """
          angles = []; energies = []
          angleUnits = None; energyUnits = None
          angleFactor = None; energyFactor = None
          
          with open(self.path, 'r') as stream:
              for line in stream:
                  line = line.strip()
                  if line == '': continue
                  
                  tokens = line.split()
                  if angleUnits is None or energyUnits is None:
                      angleUnits = tokens[1][1:-1]
                      energyUnits = tokens[3][1:-1]
                      
                      try:
                          angleFactor = ScanLog.angleFactors[angleUnits]
                      except KeyError:
                          raise ValueError('Invalid angle units {0!r}.'.format(angleUnits))
                      try:
                          energyFactor = ScanLog.energyFactors[energyUnits]
                      except KeyError:
                          raise ValueError('Invalid energy units {0!r}.'.format(energyUnits))
              
                  else:
                      angles.append(float(tokens[0]) / angleFactor)
                      energies.append(float(tokens[1]) / energyFactor)
          
          angles = numpy.array(angles)
          energies = numpy.array(energies)
          energies -= energies[0]
          
          return angles, energies
code_tokens: def load ( self ) : angles = [ ] ; energies = [ ] angleUnits = None ; energyUnits = None angleFactor = None ; energyFactor = None with open ( self . path , 'r' ) as stream : for line in stream : line = line . strip ( ) if line == '' : continue tokens = line . split ( ) if angleUnits is None or energyUnits is None : angleUnits = tokens [ 1 ] [ 1 : - 1 ] energyUnits = tokens [ 3 ] [ 1 : - 1 ] try : angleFactor = ScanLog . angleFactors [ angleUnits ] except KeyError : raise ValueError ( 'Invalid angle units {0!r}.' . format ( angleUnits ) ) try : energyFactor = ScanLog . energyFactors [ energyUnits ] except KeyError : raise ValueError ( 'Invalid energy units {0!r}.' . format ( energyUnits ) ) else : angles . append ( float ( tokens [ 0 ] ) / angleFactor ) energies . append ( float ( tokens [ 1 ] ) / energyFactor ) angles = numpy . array ( angles ) energies = numpy . array ( energies ) energies -= energies [ 0 ] return angles , energies
short_docstring: Load the scan energies from the file.
short_docstring_tokens: Load the scan energies from the file .
comment: """
          Load the scan energies from the file. Returns arrays containing the
          angles (in radians) and energies (in J/mol).
          """