-
Notifications
You must be signed in to change notification settings - Fork 62
/
test_vasp_calcs.py
32 lines (24 loc) · 1.01 KB
/
test_vasp_calcs.py
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
30
31
32
from emmet.core.vasp.calc_types import run_type, task_type, RunType, TaskType
def test_task_tye():
# TODO: Switch this to actual inputs?
input_types = [
("NSCF Line", {"incar": {"ICHARG": 11}, "kpoints": {"labels": ["A"]}}),
("NSCF Uniform", {"incar": {"ICHARG": 11}}),
("Dielectric", {"incar": {"LEPSILON": True}}),
("DFPT Dielectric", {"incar": {"LEPSILON": True, "IBRION": 7}}),
("DFPT Dielectric", {"incar": {"LEPSILON": True, "IBRION": 8}}),
("DFPT", {"incar": {"IBRION": 7}}),
("DFPT", {"incar": {"IBRION": 8}}),
("Static", {"incar": {"NSW": 0}}),
]
for _type, inputs in input_types:
assert task_type(inputs) == TaskType(_type)
def test_run_type():
params_sets = [
("GGA", {"GGA": "--"}),
("GGA+U", {"GGA": "--", "LDAU": True}),
("SCAN", {"METAGGA": "Scan"}),
("SCAN+U", {"METAGGA": "Scan", "LDAU": True}),
]
for _type, params in params_sets:
assert run_type(params) == RunType(_type)