Skip to content

Commit

Permalink
add new task doc base
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamd committed May 13, 2021
1 parent 2a6b9c3 commit 88fcc26
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions emmet-core/emmet/core/task.py
@@ -0,0 +1,35 @@
""" Core definition of a Task Document which represents a calculation from some program"""
from datetime import datetime
from typing import ClassVar, List

from pydantic import BaseModel, Field

from emmet.core.mpid import MPID


class TaskDocument(BaseModel):
"""
Definition of Task Document
"""

calc_code: ClassVar[str] = Field(
..., description="The calculation code used to compute this task"
)
version: str = Field(..., description="The version of the calculation code")
dir_name: str = Field(None, description="The directory for this task")
task_id: MPID = Field(None, description="the Task ID For this document")

completed: bool = Field(False, description="Whether this calcuation completed")
completed_at: datetime = Field(
None, description="Timestamp for when this task was completed"
)
last_updated: datetime = Field(
default_factory=datetime.utcnow,
description="Timestamp for this task document was last updateed",
)

tags: List[str] = Field([], description="Metadata tags for this task document")

warnings: List[str] = Field(
None, description="Any warnings related to this property"
)

0 comments on commit 88fcc26

Please sign in to comment.