-
Notifications
You must be signed in to change notification settings - Fork 62
/
entries.py
44 lines (33 loc) · 1.31 KB
/
entries.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
36
37
38
39
40
41
42
43
44
from typing import Dict, List, Optional, Tuple, Union
from pydantic import BaseModel, Field
from pymatgen.core.periodic_table import Element
from emmet.stubs.structure import Structure
class Composition(BaseModel):
"""A dictionary mapping element to total quantity"""
__root__: Dict[Element, float]
class ComputedEntry(BaseModel):
"""
A entry of thermodynamic information for a particular composition
"""
composition: Composition = Field(
None, description="Full composition for this entry"
)
energy: float = Field(None, description="DFT total energy in eV")
correction: float = Field(None, description="Energy correction in eV")
energy_adjustments: List = Field(
None,
description="An optional list of EnergyAdjustment to be applied to the energy."
" This is used to modify the energy for certain analyses."
" Defaults to None.",
)
parameters: Dict = Field(
None,
description="Dictionary of extra parameters for the underlying calculation",
)
data: Dict = Field(None, description="Dictionary of extra data")
entry_id: str = Field(None, description="Entry ID")
class ComputedStructureEntry(ComputedEntry):
"""
A entry of thermodynamic information for a particular structure
"""
structure: Structure