original_docstring: 
          Parses the datafolder, stores results.
          
docstring: Parses the datafolder, stores results.
docstring_tokens: Parses the datafolder stores results .
code: def parse_with_retrieved(self, retrieved):
          """
          Parses the datafolder, stores results.
          """
  
          # suppose at the start that the job is successful
          successful = True
  
          # select the folder object
          # Check that the retrieved folder is there
          try:
              out_folder = retrieved[self._calc._get_linkname_retrieved()]
          except KeyError:
              self.logger.error("No retrieved folder found")
              return False, ()
  
          # check what is inside the folder
          list_of_files = out_folder.get_folder_list()
  
          # OUTPUT file should exist
          if not self._calc._OUTPUT_FILE_NAME in list_of_files:
              successful = False
              self.logger.error("Output file not found")
              return successful, ()
  
          # Get file and do the parsing
          outfile = out_folder.get_abs_path( self._calc._OUTPUT_FILE_NAME)
          ouput_trajectory = out_folder.get_abs_path( self._calc._OUTPUT_TRAJECTORY_FILE_NAME)
  
          output_data, cell, stress_tensor = read_log_file(outfile)
          positions, forces, symbols, cell2 = read_lammps_positions_and_forces(ouput_trajectory)
  
          # look at warnings
          warnings = []
          with open(out_folder.get_abs_path( self._calc._SCHED_ERROR_FILE )) as f:
              errors = f.read()
          if errors:
              warnings = [errors]
  
          # ====================== prepare the output node ======================
  
          # save the outputs
          new_nodes_list = []
  
          # save optimized structure into node
          structure = StructureData(cell=cell)
  
          for i, position in enumerate(positions[-1]):
              structure.append_atom(position=position.tolist(),
                                    symbols=symbols[i])
  
          new_nodes_list.append(('output_structure', structure))
  
          # save forces into node
          array_data = ArrayData()
          array_data.set_array('forces', forces)
          array_data.set_array('stress', stress_tensor)
  
          new_nodes_list.append(('output_array', array_data))
  
          # add the dictionary with warnings
          output_data.update({'warnings': warnings})
  
          parameters_data = ParameterData(dict=output_data)
          new_nodes_list.append((self.get_linkname_outparams(), parameters_data))
  
          # add the dictionary with warnings
          # new_nodes_list.append((self.get_linkname_outparams(), ParameterData(dict={'warnings': warnings})))
  
          return successful, new_nodes_list
code_tokens: def parse_with_retrieved ( self , retrieved ) : successful = True try : out_folder = retrieved [ self . _calc . _get_linkname_retrieved ( ) ] except KeyError : self . logger . error ( "No retrieved folder found" ) return False , ( ) list_of_files = out_folder . get_folder_list ( ) if not self . _calc . _OUTPUT_FILE_NAME in list_of_files : successful = False self . logger . error ( "Output file not found" ) return successful , ( ) outfile = out_folder . get_abs_path ( self . _calc . _OUTPUT_FILE_NAME ) ouput_trajectory = out_folder . get_abs_path ( self . _calc . _OUTPUT_TRAJECTORY_FILE_NAME ) output_data , cell , stress_tensor = read_log_file ( outfile ) positions , forces , symbols , cell2 = read_lammps_positions_and_forces ( ouput_trajectory ) warnings = [ ] with open ( out_folder . get_abs_path ( self . _calc . _SCHED_ERROR_FILE ) ) as f : errors = f . read ( ) if errors : warnings = [ errors ] new_nodes_list = [ ] structure = StructureData ( cell = cell ) for i , position in enumerate ( positions [ - 1 ] ) : structure . append_atom ( position = position . tolist ( ) , symbols = symbols [ i ] ) new_nodes_list . append ( ( 'output_structure' , structure ) ) array_data = ArrayData ( ) array_data . set_array ( 'forces' , forces ) array_data . set_array ( 'stress' , stress_tensor ) new_nodes_list . append ( ( 'output_array' , array_data ) ) output_data . update ( { 'warnings' : warnings } ) parameters_data = ParameterData ( dict = output_data ) new_nodes_list . append ( ( self . get_linkname_outparams ( ) , parameters_data ) ) return successful , new_nodes_list
short_docstring: Parses the datafolder, stores results.
short_docstring_tokens: Parses the datafolder stores results .
comment: """
          Parses the datafolder, stores results.
          """$SEP$# suppose at the start that the job is successful$SEP$# select the folder object$SEP$# Check that the retrieved folder is there$SEP$# check what is inside the folder$SEP$# OUTPUT file should exist$SEP$# Get file and do the parsing$SEP$# look at warnings$SEP$# ====================== prepare the output node ======================$SEP$# save the outputs$SEP$# save optimized structure into node$SEP$# save forces into node$SEP$# add the dictionary with warnings$SEP$# add the dictionary with warnings$SEP$# new_nodes_list.append((self.get_linkname_outparams(), ParameterData(dict={'warnings': warnings})))