diff --git a/qcio/__init__.py b/qcio/__init__.py index 4e223f3..9af35cc 100644 --- a/qcio/__init__.py +++ b/qcio/__init__.py @@ -24,4 +24,7 @@ "SinglePointComputedProps", "Wavefunction", "ProgramFailure", + "ProgramArgs", + "QCProgramArgs", + "DualProgramArgs", ] diff --git a/qcio/models/inputs.py b/qcio/models/inputs.py index 6744a17..5a9c00e 100644 --- a/qcio/models/inputs.py +++ b/qcio/models/inputs.py @@ -4,7 +4,7 @@ from typing_extensions import Self -from .inputs_base import InputBase, ProgramArgs, ProgramArgsModel, StructuredInputBase +from .inputs_base import DualProgramArgs, InputBase, QCProgramArgs, StructuredInputBase from .molecule import Molecule __all__ = [ @@ -35,7 +35,7 @@ def from_directory(cls, directory: Union[Path, str], **kwargs) -> Self: return obj -class ProgramInput(StructuredInputBase, ProgramArgsModel): +class ProgramInput(StructuredInputBase, QCProgramArgs): """Input for a single point calculation. Attributes: @@ -50,7 +50,7 @@ class ProgramInput(StructuredInputBase, ProgramArgsModel): """ -class DualProgramInput(StructuredInputBase, ProgramArgs): +class DualProgramInput(StructuredInputBase, DualProgramArgs): """Input for a two program calculation. Attributes: @@ -64,9 +64,6 @@ class DualProgramInput(StructuredInputBase, ProgramArgs): development and scratch space. """ - subprogram_args: ProgramArgsModel - subprogram: str - if __name__ == "__main__": # Test geometry optimization input @@ -86,7 +83,7 @@ class DualProgramInput(StructuredInputBase, ProgramArgs): [-1.2, 0.0, 0.0], ], ), - subprogram_args=ProgramArgsModel( + subprogram_args=QCProgramArgs( keywords={"purify": "no"}, model=Model(**{"method": "b3lyp", "basis": "6-31g"}), ), diff --git a/qcio/models/inputs_base.py b/qcio/models/inputs_base.py index b64a06e..4d4f1f9 100644 --- a/qcio/models/inputs_base.py +++ b/qcio/models/inputs_base.py @@ -13,9 +13,10 @@ "Model", "CalcType", "ProgramArgs", - "ProgramArgsModel", + "QCProgramArgs", "InputBase", "StructuredInputBase", + "DualProgramArgs", ] @@ -68,7 +69,7 @@ class Model(BaseModel): basis: Optional[str] = None -class ProgramArgsModel(ProgramArgs): +class QCProgramArgs(ProgramArgs): """Core arguments for a calculation on a molecule. Breaks out model from keywords. Attributes: @@ -78,6 +79,18 @@ class ProgramArgsModel(ProgramArgs): model: Model +class DualProgramArgs(ProgramArgs): + """Core arguments for a DualProgramInput without calctype and molecule. + + Attributes: + subprogram_args: The input arguments for the subprogram. + subprogram: The name of the subprogram to be used. + """ + + subprogram_args: QCProgramArgs + subprogram: str + + class StructuredInputBase(ProgramArgs): """Base class for all structured qcio input classes.