-
Notifications
You must be signed in to change notification settings - Fork 62
/
spectrum.py
35 lines (27 loc) · 1.05 KB
/
spectrum.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
""" Core definition of Spectrum document """
from datetime import datetime
from functools import partial
from typing import ClassVar, Dict, List, Union
from pydantic import Field
from emmet.core.mpid import MPID
from emmet.core.structure import StructureMetadata
class SpectrumDoc(StructureMetadata):
"""
Base model definition for any spectra document. This should contain
metadata on the structure the spectra pertains to
"""
material_id: Union[MPID, int] = Field(
...,
description="The ID of the material, used as a universal reference across proeprty documents."
"This comes in the form: mp-******",
)
spectrum_id: str = Field(
...,
title="Spectrum Document ID",
description="The unique ID for this spectrum document",
)
last_updated: datetime = Field(
description="Timestamp for the most recent calculation update for this property",
default_factory=datetime.utcnow,
)
warnings: List[str] = Field([], description="Any warnings related to this property")