1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
import pytest
from ase.build import bulk
def verify(calc):
assert calc.get_fermi_level() is not None
assert calc.get_ibz_k_points() is not None
assert calc.get_eigenvalues(spin=0, kpt=0) is not None
assert calc.get_number_of_spins() is not None
assert calc.get_k_point_weights() is not None
@pytest.mark.calculator_lite
def test_main(espresso_factory):
atoms = bulk('Si')
atoms.calc = espresso_factory.calc()
atoms.get_potential_energy()
verify(atoms.calc)
@pytest.mark.calculator_lite
def test_smearing(espresso_factory):
atoms = bulk('Cu')
input_data = {'system':{'occupations': 'smearing',
'smearing': 'fermi-dirac',
'degauss': 0.02}}
atoms.calc = espresso_factory.calc(input_data=input_data)
atoms.get_potential_energy()
verify(atoms.calc)
|