-
Notifications
You must be signed in to change notification settings - Fork 62
/
settings.py
35 lines (28 loc) · 1.15 KB
/
settings.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
33
34
35
import importlib
from typing import Dict, List, Optional
from pydantic import Field, validator
from emmet.core.settings import EmmetSettings
from emmet.core.vasp.calc_types import RunType
class EmmetBuilderSettings(EmmetSettings):
default_input_sets: Dict[str, type] = Field(
{
"GGA Structure Optimization": "pymatgen.io.vasp.sets.MPRelaxSet",
"GGA+U Structure Optimization": "pymatgen.io.vasp.sets.MPRelaxSet",
},
description="Default input sets for task validation",
)
kpts_tolerance: float = Field(
0.9, description="Default tolerance for task validation"
)
ldau_fields: List[str] = Field(
["LDAUU", "LDAUJ", "LDAUL"], description="LDAU fields to validate for tasks"
)
@validator("default_input_sets", pre=True)
def load_input_sets(cls, values):
input_sets = {}
for name, inp_set in values.items():
if isinstance(inp_set, str):
_module = ".".join(inp_set.split(".")[:-1])
_class = inp_set.split(".")[-1]
input_sets[name] = getattr(importlib.import_module(_module), _class)
return input_sets