Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamd committed Oct 2, 2020
1 parent e304af3 commit 4eca0c1
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion emmet-core/emmet/core/structure.py
Expand Up @@ -2,7 +2,7 @@
from typing import List, Optional, Type, TypeVar, overload

from pydantic import BaseModel, Field
from pymatgen import Element
from pymatgen.core.periodic_table import Element

from emmet.core.symmetry import SymmetryData
from emmet.stubs import Composition, Structure
Expand Down
2 changes: 1 addition & 1 deletion emmet-core/emmet/core/utils.py
Expand Up @@ -9,7 +9,7 @@
from monty.json import MSONable
from monty.serialization import loadfn
from pydantic import BaseModel
from pymatgen import Structure
from pymatgen.core.structure import Structure
from pymatgen.analysis.structure_matcher import ElementComparator, StructureMatcher
from typing_extensions import Literal

Expand Down
2 changes: 1 addition & 1 deletion emmet-core/emmet/core/vasp/calc_types.py
Expand Up @@ -10,7 +10,7 @@
from monty.json import MSONable
from monty.serialization import loadfn
from pydantic import BaseModel
from pymatgen import Structure
from pymatgen.core.structure import Structure
from pymatgen.analysis.structure_matcher import ElementComparator, StructureMatcher
from typing_extensions import Literal

Expand Down
2 changes: 1 addition & 1 deletion emmet-core/emmet/core/xas.py
Expand Up @@ -3,7 +3,7 @@
from typing import List, Optional

from pydantic import BaseModel, Field, root_validator
from pymatgen import Element
from pymatgen.core.periodic_table import Element

from emmet.core.spectrum import SpectrumDoc
from emmet.stubs import XAS, Structure
Expand Down
2 changes: 1 addition & 1 deletion emmet-core/emmet/stubs/__init__.py
Expand Up @@ -4,7 +4,7 @@
"""

from pymatgen import Composition, Structure
from pymatgen.core.structure import Composition, Structure
from pymatgen.analysis.xas.spectrum import XAS
from pymatgen.entries.computed_entries import ComputedEntry

Expand Down
2 changes: 1 addition & 1 deletion emmet-core/emmet/stubs/misc.py
@@ -1,7 +1,7 @@
from typing import Dict, List, Optional, Tuple, Union

from pydantic import BaseModel, Field
from pymatgen import Element
from pymatgen.core.periodic_table import Element


class Composition(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion emmet-core/emmet/stubs/structure.py
@@ -1,7 +1,7 @@
from typing import Dict, List, Optional, Tuple, Union

from pydantic import BaseModel, Field
from pymatgen import Element
from pymatgen.core.periodic_table import Element

from emmet.stubs import Vector3D

Expand Down
5 changes: 3 additions & 2 deletions emmet-core/emmet/stubs/utils.py
Expand Up @@ -152,6 +152,7 @@ def MSONable_to_pydantic(monty_cls: type, pydantic_model=None):
for field_name, field_type in _type_hints
}

model = create_model(monty_cls.__name__, **monty_props, **props)
model.__doc__ = monty_cls.__doc__
model = create_model(monty_cls.__name__,field_definitions={**monty_props, **props})
if hasattr(monty_cls,"__doc__"):
setattr(model,"__doc__",monty_cls.__doc__)
return model
2 changes: 1 addition & 1 deletion emmet-core/emmet/stubs/xas.py
Expand Up @@ -2,7 +2,7 @@
from typing import Dict, List, Optional, Tuple, Union

from pydantic import BaseModel, Field
from pymatgen import Element
from pymatgen.core.periodic_table import Element

from emmet.stubs import Structure

Expand Down

0 comments on commit 4eca0c1

Please sign in to comment.