Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QC-program keywords #239

Merged
merged 4 commits into from
Mar 23, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions openff/bespokefit/executor/services/qcgenerator/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,24 @@ def _select_atom(atoms: List[Atom]) -> int:
return candidate.molecule_atom_index


def _get_program_keywords(program: str) -> Dict[str, str]:
"""
Generate a set of pre-defined keywords for the calculation based on the program.
These are based on experience.

Args:
program: The name of the program which will run the calculation

Returns:
A dictionary of program specific keywords
"""
keywords = {}
if program.lower() == "xtb":
# <https://github.com/openforcefield/openff-bespokefit/issues/238>
keywords["verbosity"] = "muted"
return keywords


@celery_app.task(acks_late=True)
def compute_torsion_drive(task_json: str) -> TorsionDriveResult:
"""Runs a torsion drive using QCEngine."""
Expand Down Expand Up @@ -118,6 +136,7 @@ def compute_torsion_drive(task_json: str) -> TorsionDriveResult:
input_specification=QCInputSpecification(
model=task.model,
driver=DriverEnum.gradient,
keywords=_get_program_keywords(task.program),
),
optimization_spec=OptimizationSpecification(
procedure=task.optimization_spec.program,
Expand Down Expand Up @@ -171,6 +190,7 @@ def compute_optimization(
input_specification=QCInputSpecification(
model=task.model,
driver=DriverEnum.gradient,
keywords=_get_program_keywords(task.program),
),
initial_molecule=molecule.to_qcschema(conformer=i),
)
Expand Down