Skip to content

Commit

Permalink
Update tasks endpoint to use pymatgen models
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhorton committed Mar 15, 2021
1 parent 7e16fd2 commit 16d793a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/mp_api/tasks/client.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from typing import List, Optional
from mp_api.tasks.models import TaskDoc


class TaskRester:
def query_by_task_id(
self, task_id, fields: Optional[List[str]] = None, monty_decode: bool = True
) -> TaskDoc:
...
3 changes: 2 additions & 1 deletion src/mp_api/tasks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from typing import List

from monty.json import MontyDecoder
from mp_api.materials.models import Structure, Composition
from pydantic import BaseModel, Field, validator

from pymatgen.core.structure import Structure
from pymatgen.core.composition import Composition
from pymatgen.core.periodic_table import Element

monty_decoder = MontyDecoder()
Expand Down

0 comments on commit 16d793a

Please sign in to comment.