code: def opt(self, x_init, f_fp=None, f=None, fp=None):
          
  
          statuses = ['Converged', 'Maximum number of function evaluations made', 'Maximum number of iterations reached']
  
          opt_dict = {}
          if self.xtol is not None:
              opt_dict['xtol'] = self.xtol
          if self.ftol is not None:
              opt_dict['ftol'] = self.ftol
          if self.gtol is not None:
              print("WARNING: simplex doesn't have an gtol arg, so I'm going to ignore it")
  
          opt_result = optimize.fmin(f, x_init, (), disp=self.messages,
                     maxfun=self.max_f_eval, full_output=True, **opt_dict)
  
          self.x_opt = opt_result[0]
          self.f_opt = opt_result[1]
          self.funct_eval = opt_result[3]
          self.status = statuses[opt_result[4]]
          self.trace = None
docs: The simplex optimizer does not require gradients.