Source code for openff.bespokefit.executor.services.qcgenerator.models

from typing import Dict, Optional, Union

from qcelemental.models import AtomicResult, FailedOperation, OptimizationResult
from qcengine.procedures.torsiondrive import TorsionDriveResult
from typing_extensions import Literal

from openff.bespokefit._pydantic import BaseModel, Field
from openff.bespokefit.executor.services.models import Link, PaginatedCollection
from openff.bespokefit.executor.utilities.typing import Status
from openff.bespokefit.schema.tasks import HessianTask, OptimizationTask, Torsion1DTask


[docs]class QCGeneratorGETResponse(Link): """The object model returned by a GET request.""" type: Literal["torsion1d", "optimization", "hessian"] = Field( ..., description="The type of QC calculation being run." ) status: Status = Field("waiting", description="The status of the QC calculation.") result: Optional[ Union[AtomicResult, OptimizationResult, TorsionDriveResult, FailedOperation] ] = Field(..., description="The result of the QC calculation if any was produced.") error: Optional[str] = Field( ..., description="The error raised while running the QC calculation if any." ) links: Dict[str, str] = Field( {}, description="Links to resources associated with the model.", alias="_links" )
[docs]class QCGeneratorGETPageResponse(PaginatedCollection[QCGeneratorGETResponse]): """"""
[docs]class QCGeneratorPOSTBody(BaseModel): input_schema: Union[HessianTask, OptimizationTask, Torsion1DTask] = Field( ..., description="The schema that fully defines the QC data to generate." )
[docs]class QCGeneratorPOSTResponse(Link): """The object model returned by a POST request."""