code: def _pack_output(self, ans):
          
          # Build infodic
          infodic = {
              'nfev': ans.nfev,
          }
  
          best_vals = []
          found = iter(np.atleast_1d(ans.x))
          for param in self.parameters:
              if param.fixed:
                  best_vals.append(param.value)
              else:
                  best_vals.append(next(found))
  
          fit_results = dict(
              model=DummyModel(params=self.parameters),
              popt=best_vals,
              covariance_matrix=None,
              infodic=infodic,
              mesg=ans.message,
              ier=ans.nit if hasattr(ans, 'nit') else None,
              objective_value=ans.fun,
          )
  
          if 'hess_inv' in ans:
              try:
                  fit_results['hessian_inv'] = ans.hess_inv.todense()
              except AttributeError:
                  fit_results['hessian_inv'] = ans.hess_inv
          return FitResults(**fit_results)
docs: Packs the output of a minimization in a
          :class:`~symfit.core.fit_results.FitResults`.
  
          :param ans: The output of a minimization as produced by
              :func:`scipy.optimize.minimize`
          :returns: :class:`~symfit.core.fit_results.FitResults`