def __init__(self, volumes, energies, eos="vinet"):
        """Init method.

        volumes : array_like
            Unit cell volumes where energies are obtained.
            shape=(volumes, ), dtype='double'.
        energies : array_like
            Energies obtained at volumes.
            shape=(volumes, ), dtype='double'.
        eos : str
            Identifier of equation of states function.

        """
        self._volumes = volumes
        if np.array(energies).ndim == 1:
            self._energies = energies
        else:
            self._energies = energies[0]
        self._eos = get_eos(eos)

        self._energy = None
        self._bulk_modulus = None
        self._b_prime = None

        try:
            (
                self._energy,
                self._bulk_modulus,
                self._b_prime,
                self._volume,
            ) = fit_to_eos(volumes, self._energies, self._eos)
        except TypeError:
            msg = ['Failed to fit to "%s" equation of states.' % eos]
            if len(volumes) < 4:
                msg += ["At least 4 volume points are needed for the fitting."]
            msg += ["Careful choice of volume points is recommended."]
            raise RuntimeError("\n".join(msg))