def _set_gruneisen_parameter(self):
    gamma = [0]
    for i in range(1, (self._num_elems - 1)):
        v = self._equiv_volumes[i]
        kt = self._equiv_bulk_modulus[i]
        beta = self._thermal_expansions[i]
        try:
            parameters = np.polyfit(self._volumes, self._cv[i], 4)
        except np.lib.polynomial.RankWarning:
            msg = ['Failed to fit heat capacities to polynomial of degree 4.']
            if (len(self._volumes) < 5):
                msg += ['At least 5 volume points are needed for the fitting.']
            raise RuntimeError('\n'.join(msg))
        cv = ((((np.dot(parameters, [(v ** 4), (v ** 3), (v ** 2), v, 1]) / v) / 1000) / EvTokJmol) * EVAngstromToGPa)
        if (cv < 1e-10):
            gamma.append(0.0)
        else:
            gamma.append(((beta * kt) / cv))
    self._gruneisen_parameters = gamma
def _set_gruneisen_parameter(self):
    gamma = [0]
    for i in range(1, (self._num_elems - 1)):
        v = self._equiv_volumes[i]
        kt = self._equiv_bulk_modulus[i]
        beta = self._thermal_expansions[i]
        try:
            parameters = np.polyfit(self._volumes, self._cv[i], 4)
        except np.lib.polynomial.RankWarning:
            msg = ['Failed to fit heat capacities to polynomial of degree 4.']
            if (len(self._volumes) < 5):
                msg += ['At least 5 volume points are needed for the fitting.']
            raise RuntimeError('\n'.join(msg))
        cv = ((((np.dot(parameters, [(v ** 4), (v ** 3), (v ** 2), v, 1]) / v) / 1000) / EvTokJmol) * EVAngstromToGPa)
        if (cv < 1e-10):
            gamma.append(0.0)
        else:
            gamma.append(((beta * kt) / cv))
    self._gruneisen_parameters = gamma