class_docstr: Base class for evaluating multiple methods for an ED/Optimisation task. 
class_docstr_tok: ["Base","class","for","evaluating","multiple","methods","for","an","ED\/Optimisation","task","."]
docstr: Saves results in save_file_full_name. 
docstr_tok: ["Saves","results","in","save_file_full_name","."]
code: def save_results(self):
      """Saves results in save_file_full_name."""
      self.reporter.write(
          "Saving results (trial-iter:%d) to %s ...  "
          % (self.trial_iter, self.save_file_full_name)
      )
      try:
          if self.save_file_extension == "mat":
              dict_to_be_saved = vars(self.to_be_saved)
              dict_to_be_mat_saved = {
                  key: val
                  for key, val in dict_to_be_saved.items()
                  if key not in self.data_not_to_be_mat_saved
              }
              # Fix for crash in single fidelity case -- replacing None with 'xx'.
              for i in range(
                  dict_to_be_mat_saved["query_eval_times"].shape[0]
              ):
                  if isinstance(
                      dict_to_be_mat_saved["query_eval_times"][i, -1],
                      str,
                  ):
                      continue
                  query_eval_times = [
                      val if val is not None else "xx"
                      for val in dict_to_be_mat_saved[
                          "query_eval_times"
                      ][i, -1]
                  ]
                  dict_to_be_mat_saved["query_eval_times"][
                      i, -1
                  ] = query_eval_times
              sio_savemat(
                  self.save_file_full_name, mdict=dict_to_be_mat_saved
              )
          else:
              raise NotImplementedError(
                  "Only implemented saving mat files so far."
              )
          save_successful = True
      except IOError:
          save_successful = False
      # Report saving status
      if save_successful:
          self.reporter.writeln("successful.")
      else:
          self.reporter.writeln("unsuccessful!!")
  
file_path: dragonfly/dragonfly/utils/method_evaluator.py
imports: from argparse import Namespace
  import random
  from time import time
  import pickle
  from scipy.io import savemat
  import numpy
  from .reporters import get_reporter
label_desc: Use image node_id 2 for calling the BaseMethodEvaluator obj's underlying member method code with example usage: obj.save_results() without return types