class_docstr: a framework for benchmarking the optimizer
  
  Parameters
  ----------
  function_name : string
  fun : callable
  der : callable
      function that returns the derivative (jacobian, gradient) of fun
  hess : callable
      function that returns the hessian of fun
  minimizer_kwargs : kwargs
      additional keywords passed to the minimizer.  e.g. tol, maxiter
class_docstr_tok: ["a","framework","for","benchmarking","the","optimizer","Parameters","--","--","--","--","--","function_name",":","string","fun",":","callable","der",":","callable","function","that","returns","the","derivative","(","jacobian",",","gradient",")","of","fun","hess",":","callable","function","that","returns","the","hessian","of","fun","minimizer_kwargs",":","kwargs","additional","keywords","passed","to","the","minimizer",".","e.g",".","tol",",","maxiter"]
docstr: do an optimization test starting at x0 for all the optimizers
docstr_tok: ["do","an","optimization","test","starting","at","x0","for","all","the","optimizers"]
code: def bench_run(self, x0, methods=None, **minimizer_kwargs):
      """do an optimization test starting at x0 for all the optimizers"""
      kwargs = self.minimizer_kwargs
  
      if methods is None:
          methods = MINIMIZE_METHODS
  
      # L-BFGS-B, BFGS, trust-constr, SLSQP can use gradients, but examine
      # performance when numerical differentiation is used.
      fonly_methods = [
          "COBYLA",
          "Powell",
          "nelder-mead",
          "L-BFGS-B",
          "BFGS",
          "trust-constr",
          "SLSQP",
      ]
      for method in fonly_methods:
          if method not in methods:
              continue
          t0 = time.time()
          res = scipy.optimize.minimize(
              self.fun, x0, method=method, **kwargs
          )
          t1 = time.time()
          self.add_result(res, t1 - t0, method)
  
      gradient_methods = [
          "L-BFGS-B",
          "BFGS",
          "CG",
          "TNC",
          "SLSQP",
          "trust-constr",
      ]
      if self.der is not None:
          for method in gradient_methods:
              if method not in methods:
                  continue
              t0 = time.time()
              res = scipy.optimize.minimize(
                  self.fun, x0, method=method, jac=self.der, **kwargs
              )
              t1 = time.time()
              self.add_result(res, t1 - t0, method)
  
      hessian_methods = [
          "Newton-CG",
          "dogleg",
          "trust-ncg",
          "trust-exact",
          "trust-krylov",
          "trust-constr",
      ]
      if self.hess is not None:
          for method in hessian_methods:
              if method not in methods:
                  continue
              t0 = time.time()
              res = scipy.optimize.minimize(
                  self.fun,
                  x0,
                  method=method,
                  jac=self.der,
                  hess=self.hess,
                  **kwargs,
              )
              t1 = time.time()
              self.add_result(res, t1 - t0, method)
  
imports: import os
  import time
  import inspect
  import json
  import traceback
  from collections import defaultdict
  import numpy
  from .None import test_functions
  from .None import go_benchmark_functions
  from .common import Benchmark, is_xslow, safe_import
  from .lsq_problems import extract_lsq_problems
label_desc: Use image node_id 15 for calling the _BenchOptimizers obj's underlying member method code with example usage: obj.bench_run(x0, methods) without return types