File: test_read_text_output.py

package info (click to toggle)
python-ase 3.26.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (24 lines) | stat: -rw-r--r-- 664 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# fmt: off
from ase import io
from ase.calculators.singlepoint import SinglePointDFTCalculator


def test_read_gpaw_out(datadir):
    """Test reading of gpaw text output"""

    # read input

    output_file_name = datadir / 'gpaw_expected_text_output'
    atoms = io.read(output_file_name)

    # test calculator

    calc = atoms.calc
    assert isinstance(calc, SinglePointDFTCalculator)
    assert calc.name == 'vdwtkatchenko09prl'
    assert calc.parameters['calculator'] == 'gpaw'

    for contribution in [
            'kinetic', 'potential', 'external', 'xc',
            'entropy (-st)', 'local']:
        assert contribution in calc.energy_contributions