File: test_bzplot.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (25 lines) | stat: -rw-r--r-- 598 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
25
import pytest

from ase import Atoms
from ase.build import bulk, fcc111
from ase.io import write


@pytest.fixture(
    params=[
        bulk('Ti'),
        fcc111('Au', size=(1, 1, 1)),
        pytest.param(Atoms('H', cell=[0, 0, 1], pbc=[0, 0, 1]),
                     marks=pytest.mark.xfail),  # Please investigate failure
    ],
    ids=lambda atoms: f'{atoms.cell.rank}-dim',
)
def file(request):
    atoms = request.param
    file = f'atoms.{atoms.cell.rank}dim.traj'
    write(file, atoms)
    return file


def test_bzplot(cli, file, plt):
    cli.ase('reciprocal', file, 'bandpath.svg')