From e6e821db39e89f357497bd0b98e8bbdb77d3bec2 Mon Sep 17 00:00:00 2001 From: Colton Hicks Date: Tue, 5 Apr 2022 20:14:47 -0700 Subject: [PATCH] Tidy imports --- qcelemental/models/abcmodels.py | 1 - qcelemental/models/basemodels.py | 12 ------------ qcelemental/models/common_models.py | 12 ++++++++++++ qcelemental/models/molecule.py | 3 ++- qcelemental/models/procedures.py | 7 ++++--- qcelemental/models/results.py | 10 +++++----- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/qcelemental/models/abcmodels.py b/qcelemental/models/abcmodels.py index 45263783..5a0946bb 100644 --- a/qcelemental/models/abcmodels.py +++ b/qcelemental/models/abcmodels.py @@ -29,7 +29,6 @@ class InputResultBase(ProtoModel, abc.ABC): def schema_name(self) -> str: """The QCSchema specification this model conforms to""" - # schema_name: str = Field(..., description=("The QCSchema specification this model conforms to")) schema_version: Literal[2] = Field( 2, description="The version number of ``schema_name`` to which this model conforms." ) diff --git a/qcelemental/models/basemodels.py b/qcelemental/models/basemodels.py index 20a09765..6e83cd15 100644 --- a/qcelemental/models/basemodels.py +++ b/qcelemental/models/basemodels.py @@ -17,18 +17,6 @@ def _repr(self) -> str: return f'{self.__repr_name__()}({self.__repr_str__(", ")})' -qcschema_input_default = "qcschema_input" -qcschema_output_default = "qcschema_output" -qcschema_input_specification_default = "qcschema_input_specification" -qcschema_optimization_specification_default = "qcschema_optimization_specification" -qcschema_optimization_input_default = "qcschema_optimization_input" -qcschema_optimization_output_default = "qcschema_optimization_output" -qcschema_torsion_drive_input_default = "qcschema_torsion_drive_input" -qcschema_torsion_drive_output_default = "qcschema_torsion_drive_output" -qcschema_torsion_drive_specification_default = "qcschema_torsion_drive_specification" -qcschema_molecule_default = "qcschema_molecule" - - class ProtoModel(BaseModel): class Config: allow_mutation: bool = False diff --git a/qcelemental/models/common_models.py b/qcelemental/models/common_models.py index af810930..d67e1ea6 100644 --- a/qcelemental/models/common_models.py +++ b/qcelemental/models/common_models.py @@ -74,3 +74,15 @@ class Config: def __repr_args__(self) -> "ReprArgs": return [("error_type", self.error_type), ("error_message", self.error_message)] + + +qcschema_input_default = "qcschema_input" +qcschema_output_default = "qcschema_output" +qcschema_input_specification_default = "qcschema_input_specification" +qcschema_optimization_specification_default = "qcschema_optimization_specification" +qcschema_optimization_input_default = "qcschema_optimization_input" +qcschema_optimization_output_default = "qcschema_optimization_output" +qcschema_torsion_drive_input_default = "qcschema_torsion_drive_input" +qcschema_torsion_drive_output_default = "qcschema_torsion_drive_output" +qcschema_torsion_drive_specification_default = "qcschema_torsion_drive_specification" +qcschema_molecule_default = "qcschema_molecule" \ No newline at end of file diff --git a/qcelemental/models/molecule.py b/qcelemental/models/molecule.py index 273f6d0c..abe7cfb1 100644 --- a/qcelemental/models/molecule.py +++ b/qcelemental/models/molecule.py @@ -22,7 +22,8 @@ from ..physical_constants import constants from ..testing import compare, compare_values from ..util import deserialize, measure_coordinates, msgpackext_loads, provenance_stamp, which_import -from .basemodels import ProtoModel, Provenance, qcschema_draft, qcschema_molecule_default +from .basemodels import ProtoModel, Provenance, qcschema_draft +from .common_models import qcschema_molecule_default from .types import Array if TYPE_CHECKING: diff --git a/qcelemental/models/procedures.py b/qcelemental/models/procedures.py index 06872850..e7310a9f 100644 --- a/qcelemental/models/procedures.py +++ b/qcelemental/models/procedures.py @@ -6,8 +6,10 @@ from typing_extensions import Literal from .abcmodels import ResultBase -from .basemodels import ( - ProtoModel, +from .basemodels import ProtoModel +from .common_models import ( + ComputeError, + DriverEnum, qcschema_optimization_input_default, qcschema_optimization_output_default, qcschema_optimization_specification_default, @@ -15,7 +17,6 @@ qcschema_torsion_drive_output_default, qcschema_torsion_drive_specification_default, ) -from .common_models import ComputeError, DriverEnum from .molecule import Molecule from .results import ( AtomicInput, diff --git a/qcelemental/models/results.py b/qcelemental/models/results.py index 0b87cc13..c50b583e 100644 --- a/qcelemental/models/results.py +++ b/qcelemental/models/results.py @@ -5,15 +5,15 @@ from pydantic import Field, constr, validator from .abcmodels import InputComputationBase, InputSpecificationBase, SuccessfulResultBase -from .basemodels import ( - ProtoModel, - qcschema_draft, +from .basemodels import ProtoModel, qcschema_draft +from .basis import BasisSet +from .common_models import ( + DriverEnum, + Model, qcschema_input_default, qcschema_input_specification_default, qcschema_output_default, ) -from .basis import BasisSet -from .common_models import DriverEnum, Model from .types import Array if TYPE_CHECKING: