Skip to content

Commit

Permalink
Add DualProgramArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
coltonbh committed Aug 18, 2023
1 parent 04d7cc1 commit 7b79956
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions qcio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
"SinglePointComputedProps",
"Wavefunction",
"ProgramFailure",
"ProgramArgs",
"QCProgramArgs",
"DualProgramArgs",
]
11 changes: 4 additions & 7 deletions qcio/models/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = [
Expand Down Expand Up @@ -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:
Expand All @@ -50,7 +50,7 @@ class ProgramInput(StructuredInputBase, ProgramArgsModel):
"""


class DualProgramInput(StructuredInputBase, ProgramArgs):
class DualProgramInput(StructuredInputBase, DualProgramArgs):
"""Input for a two program calculation.
Attributes:
Expand All @@ -64,9 +64,6 @@ class DualProgramInput(StructuredInputBase, ProgramArgs):
development and scratch space.
"""

subprogram_args: ProgramArgsModel
subprogram: str


if __name__ == "__main__":
# Test geometry optimization input
Expand All @@ -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"}),
),
Expand Down
17 changes: 15 additions & 2 deletions qcio/models/inputs_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
"Model",
"CalcType",
"ProgramArgs",
"ProgramArgsModel",
"QCProgramArgs",
"InputBase",
"StructuredInputBase",
"DualProgramArgs",
]


Expand Down Expand Up @@ -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:
Expand All @@ -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.
Expand Down

0 comments on commit 7b79956

Please sign in to comment.