File: test_fdf_io.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-- 546 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
import pytest

from ase.build import bulk
from ase.io.siesta import _read_fdf_lines


@pytest.mark.calculator_lite()
@pytest.mark.calculator('siesta')
def test_fdf_io(factory):

    atoms = bulk('Ti')
    calc = factory.calc()
    atoms.calc = calc
    calc.write_input(atoms, properties=['energy'])
    # Should produce siesta.fdf but really we should be more explicit

    fname = 'siesta.fdf'

    with open(fname) as fd:
        thing = _read_fdf_lines(fd)
    print(thing)

    assert thing[0].split() == ['SystemName', 'siesta']