def fit(self):
        """
        Do the fitting. Does least square fitting. If you want to use custom
        fitting, must override this.
        """
        # the objective function that will be minimized in the least square
        # fitting
        objective_func = lambda pars, x, y: y - self._func(x, pars)
        self._params = self._initial_guess()
        self.eos_params, ierr = leastsq(
            objective_func, self._params, args=(self.volumes, self.energies))
        # e0, b0, b1, v0
        self._params = self.eos_params
        if ierr not in [1, 2, 3, 4]:
            raise EOSError("Optimal parameters not found")
def fit ( self ) : objective_func = lambda pars , x , y : y - self . _func ( x , pars ) self . _params = self . _initial_guess ( ) self . eos_params , ierr = leastsq ( objective_func , self . _params , args = ( self . volumes , self . energies ) ) self . _params = self . eos_params if ierr not in [ 1 , 2 , 3 , 4 ] : raise EOSError ( "Optimal parameters not found" )
Do the fitting. Does least square fitting. If you want to use custom
        fitting, must override this.