class_docstr: Powell Direction Search optimization,
  adapted from scipy.optimize.fmin_powell.
      
class_docstr_tok: ["Powell","Direction","Search","optimization",",","adapted","from","scipy.optimize.fmin_powell","."]
docstr: cleanup upon exiting the main optimization loop
docstr_tok: ["cleanup","upon","exiting","the","main","optimization","loop"]
code: def Finalize(self):
      """cleanup upon exiting the main optimization loop"""
      if self.energy_history != None and self._live:
          self.energy_history = None  # resync with 'best' energy
          self._stepmon(self.bestSolution, self.bestEnergy, self.id)
          # if savefrequency matches, then save state
          self._AbstractSolver__save_state()
      self._live = False
      return
  
imports: from mystic.tools import wrap_function, unpair, wrap_nested
  from mystic.tools import wrap_bounds, wrap_penalty, reduced
  import numpy
  from numpy import eye, zeros, shape, asarray, absolute, asfarray
  from numpy import clip, squeeze
  from mystic._scipy060optimize import brent
  from mystic.abstract_solver import AbstractSolver
label_desc: Use image node_id 5 for calling the PowellDirectionalSolver obj's underlying member method code with example usage: obj.Finalize() without return types