'Do an optimization run for basinhopping'

def run_basinhopping(self):

    kwargs = self.minimizer_kwargs
    if hasattr(self.fun, 'temperature'):
        kwargs['T'] = self.function.temperature
    if hasattr(self.fun, 'stepsize'):
        kwargs['stepsize'] = self.function.stepsize
    minimizer_kwargs = {'method': 'L-BFGS-B'}
    x0 = self.function.initial_vector()
    minimizer_kwargs['jac'] = False
    self.function.nfev = 0
    t0 = time.time()
    res = basinhopping(self.fun, x0, accept_test=self.accept_test, minimizer_kwargs=minimizer_kwargs, **kwargs)
    t1 = time.time()
    res.success = self.function.success(res.x)
    res.nfev = self.function.nfev
    self.add_result(res, (t1 - t0), 'basinh.')
