From ba879e846648d08e85270ac9b0b1d0745b782cb4 Mon Sep 17 00:00:00 2001 From: Shyam D Date: Fri, 16 Oct 2020 12:33:31 -0700 Subject: [PATCH] imports cleanup --- emmet-core/emmet/core/material.py | 2 +- emmet-core/emmet/core/utils.py | 5 ++++- emmet-core/emmet/core/vasp/__init__.py | 2 +- emmet-core/emmet/core/vasp/calc_types.py | 2 +- emmet-core/emmet/core/vasp/task.py | 10 ++++------ emmet-core/emmet/core/vasp/task2.py | 4 ++-- emmet-core/emmet/core/vasp/validation.py | 1 + emmet-core/emmet/stubs/__init__.py | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/emmet-core/emmet/core/material.py b/emmet-core/emmet/core/material.py index 1a1dcc6fa7..4869723180 100644 --- a/emmet-core/emmet/core/material.py +++ b/emmet-core/emmet/core/material.py @@ -1,7 +1,7 @@ """ Core definition of a Materials Document """ from datetime import datetime from functools import partial -from typing import ClassVar, Optional, Union, Sequence, Mapping +from typing import ClassVar, Mapping, Optional, Sequence, Union from pydantic import BaseModel, Field, create_model from pymatgen.analysis.magnetism import CollinearMagneticStructureAnalyzer, Ordering diff --git a/emmet-core/emmet/core/utils.py b/emmet-core/emmet/core/utils.py index 34010cefc3..0d9e0b5c75 100644 --- a/emmet-core/emmet/core/utils.py +++ b/emmet-core/emmet/core/utils.py @@ -9,8 +9,8 @@ from monty.json import MSONable from monty.serialization import loadfn from pydantic import BaseModel -from pymatgen.core.structure import Structure from pymatgen.analysis.structure_matcher import ElementComparator, StructureMatcher +from pymatgen.core.structure import Structure from typing_extensions import Literal from emmet.core import SETTINGS @@ -123,3 +123,6 @@ def jsanitize(obj, strict=False, allow_bson=False): return obj.__str__() return jsanitize(obj.as_dict(), strict=strict, allow_bson=allow_bson) + + + diff --git a/emmet-core/emmet/core/vasp/__init__.py b/emmet-core/emmet/core/vasp/__init__.py index 166d4b8b70..cdbe61eea9 100644 --- a/emmet-core/emmet/core/vasp/__init__.py +++ b/emmet-core/emmet/core/vasp/__init__.py @@ -1,4 +1,4 @@ from emmet.core.vasp.calc_types import CalcType, RunType, TaskType from emmet.core.vasp.material import MaterialsDoc -from emmet.core.vasp.validation import ValidationDoc from emmet.core.vasp.task import TaskDocument, VASPObjects +from emmet.core.vasp.validation import ValidationDoc diff --git a/emmet-core/emmet/core/vasp/calc_types.py b/emmet-core/emmet/core/vasp/calc_types.py index 76fb682e11..9dfdf20fb5 100644 --- a/emmet-core/emmet/core/vasp/calc_types.py +++ b/emmet-core/emmet/core/vasp/calc_types.py @@ -10,8 +10,8 @@ from monty.json import MSONable from monty.serialization import loadfn from pydantic import BaseModel -from pymatgen.core.structure import Structure from pymatgen.analysis.structure_matcher import ElementComparator, StructureMatcher +from pymatgen.core.structure import Structure from typing_extensions import Literal from emmet.core import SETTINGS diff --git a/emmet-core/emmet/core/vasp/task.py b/emmet-core/emmet/core/vasp/task.py index 14b237546b..9bc867d2e3 100644 --- a/emmet-core/emmet/core/vasp/task.py +++ b/emmet-core/emmet/core/vasp/task.py @@ -1,7 +1,7 @@ """ Core definition of a VASP Task Document """ from datetime import datetime from enum import Enum -from functools import partial, cached_property +from functools import cached_property, partial from typing import ClassVar, Dict, List, Optional, Union from pydantic import BaseModel, Field, create_model @@ -9,17 +9,15 @@ from pymatgen.analysis.structure_analyzer import oxide_type from emmet.core.structure import StructureMetadata -from emmet.stubs import Matrix3D, Structure from emmet.core.vasp.calc_types import ( CalcType, - TaskType, RunType, + TaskType, + calc_type, run_type, task_type, - calc_type, ) - -from emmet.stubs import ComputedEntry +from emmet.stubs import ComputedEntry, Matrix3D, Structure class Status(Enum): diff --git a/emmet-core/emmet/core/vasp/task2.py b/emmet-core/emmet/core/vasp/task2.py index 45b310bc8b..c615816f0f 100644 --- a/emmet-core/emmet/core/vasp/task2.py +++ b/emmet-core/emmet/core/vasp/task2.py @@ -2,13 +2,13 @@ from datetime import datetime from enum import Enum from functools import partial -from typing import ClassVar, Dict, List, Optional, Union, Any +from typing import Any, ClassVar, Dict, List, Optional, Union from pydantic import BaseModel, Field, create_model from pymatgen.analysis.magnetism import CollinearMagneticStructureAnalyzer, Ordering from emmet.core.structure import StructureMetadata -from emmet.stubs import Matrix3D, Structure, ComputedEntry +from emmet.stubs import ComputedEntry, Matrix3D, Structure class Status(Enum): diff --git a/emmet-core/emmet/core/vasp/validation.py b/emmet-core/emmet/core/vasp/validation.py index 50d7ce167c..f274b609de 100644 --- a/emmet-core/emmet/core/vasp/validation.py +++ b/emmet-core/emmet/core/vasp/validation.py @@ -1,6 +1,7 @@ from datetime import datetime from enum import Enum from typing import List, Union + from pydantic import BaseModel, Field diff --git a/emmet-core/emmet/stubs/__init__.py b/emmet-core/emmet/stubs/__init__.py index 0cf5d146a2..a56c4d1036 100644 --- a/emmet-core/emmet/stubs/__init__.py +++ b/emmet-core/emmet/stubs/__init__.py @@ -4,8 +4,8 @@ """ -from pymatgen.core.structure import Composition, Structure from pymatgen.analysis.xas.spectrum import XAS +from pymatgen.core.structure import Composition, Structure from pymatgen.entries.computed_entries import ComputedEntry from emmet.stubs.math import Matrix3D, Vector3D