@classmethod
def _get_pw_energy_value(cls, calc, energy_type, **kwargs):
    """Return the energy of defined type in eV."""
    parameters = calc.outputs.output_parameters
    if energy_type not in parameters.attrs():
        return None
    if energy_type + '_units' not in parameters.attrs():
        raise ValueError('energy units for {} are unknown'.format(energy_type))
    if parameters.get_attr(energy_type + '_units') != 'eV':
        raise ValueError(
            'energy units for {} are {} instead of eV -- unit conversion is not possible yet'
            .format(energy_type, parameters.get_attr(energy_type + '_units')))
    return parameters.get_attr(energy_type)
