-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add plain qcmanybody hanress * lint * update changelog
- Loading branch information
Showing
10 changed files
with
440 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ dependencies: | |
- geometric | ||
- optking | ||
- pymdi | ||
- qcmanybody | ||
|
||
# Core | ||
- python | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from typing import TYPE_CHECKING, Any, Dict, Union | ||
|
||
from qcelemental.util import safe_version, which_import | ||
|
||
from .model import ProcedureHarness | ||
|
||
if TYPE_CHECKING: | ||
from ..config import TaskConfig | ||
from qcmanybody.models import ManyBodyInput, ManyBodyResult | ||
|
||
|
||
class QCManyBodyProcedure(ProcedureHarness): | ||
|
||
# v2: ClassVar[Dict[str, Any]] | ||
_defaults: Dict[str, Any] = {"name": "QCManyBody", "procedure": "manybody"} | ||
|
||
version_cache: Dict[str, str] = {} | ||
|
||
class Config(ProcedureHarness.Config): | ||
pass | ||
|
||
def found(self, raise_error: bool = False) -> bool: | ||
return which_import( | ||
"qcmanybody", | ||
return_bool=True, | ||
raise_error=raise_error, | ||
raise_msg="Please install via `conda install qcmanybody -c conda-forge`.", | ||
) | ||
|
||
def build_input_model(self, data: Union[Dict[str, Any], "ManyBodyInput"]) -> "ManyBodyInput": | ||
from qcmanybody.models import ManyBodyInput | ||
|
||
return self._build_model(data, ManyBodyInput) | ||
|
||
def get_version(self) -> str: | ||
self.found(raise_error=True) | ||
|
||
which_prog = which_import("qcmanybody") | ||
if which_prog not in self.version_cache: | ||
import qcmanybody | ||
|
||
self.version_cache[which_prog] = safe_version(qcmanybody.__version__) | ||
|
||
return self.version_cache[which_prog] | ||
|
||
def compute(self, input_model: "ManyBodyInput", config: "TaskConfig") -> "ManyBodyResult": | ||
from qcmanybody import ManyBodyComputer | ||
|
||
output_model = ManyBodyComputer.from_manybodyinput(input_model) | ||
|
||
return output_model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.