Skip to content

Commit

Permalink
Search and XAS to emmet core models
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed May 27, 2021
1 parent 8157fc0 commit a4085cb
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 434 deletions.
12 changes: 0 additions & 12 deletions src/mp_api/routes/materials/models/__init__.py

This file was deleted.

121 changes: 0 additions & 121 deletions src/mp_api/routes/materials/models/core.py

This file was deleted.

177 changes: 0 additions & 177 deletions src/mp_api/routes/materials/models/doc.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/mp_api/routes/materials/query_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from fastapi import Query
from mp_api.core.query_operator import STORE_PARAMS, QueryOperator
from mp_api.routes.materials.utils import formula_to_criteria
from mp_api.routes.materials.models.core import CrystalSystem
from emmet.core.symmetry import CrystalSystem
from pymatgen.core.periodic_table import Element
from collections import defaultdict

Expand Down
7 changes: 3 additions & 4 deletions src/mp_api/routes/materials/resources.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from fastapi import HTTPException
from mp_api.core.resource import GetResource
from mp_api.routes.materials.models.core import Structure

from emmet.core.material import MaterialsDoc

Expand All @@ -21,7 +20,7 @@
)

from pymatgen.analysis.structure_matcher import StructureMatcher, ElementComparator
from pymatgen.core import Structure as PS
from pymatgen.core import Structure
from pymatgen.core import Composition
from pymongo import MongoClient # type: ignore
from itertools import permutations
Expand Down Expand Up @@ -101,7 +100,7 @@ async def find_structure(
"""

try:
s = PS.from_dict(structure.dict())
s = Structure.from_dict(structure.dict())
except Exception:
raise HTTPException(
status_code=404,
Expand All @@ -128,7 +127,7 @@ async def find_structure(
criteria=crit, properties=["structure", "task_id"]
):

s2 = PS.from_dict(r["structure"])
s2 = Structure.from_dict(r["structure"])
matched = m.fit(s, s2)

if matched:
Expand Down
3 changes: 1 addition & 2 deletions src/mp_api/routes/phonon/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from monty.json import MontyDecoder

from pydantic import BaseModel, Field, validator

from mp_api.routes.materials.models.core import Structure
from pymatgen.core import Structure
from pymatgen.phonon.bandstructure import PhononBandStructureSymmLine


Expand Down

0 comments on commit a4085cb

Please sign in to comment.