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

Add single point jobs to the end of torsiondrives #167

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions openff/bespokefit/cli/executor/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def _run_cli(
force_field_path: Optional[str],
target_torsion_smirks: Tuple[str],
default_qc_spec: Optional[Tuple[str, str, str]],
evaluation_qc_spec: Optional[Tuple[str, str, str]],
Comment on lines 24 to +25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to swap this to

Suggested change
default_qc_spec: Optional[Tuple[str, str, str]],
evaluation_qc_spec: Optional[Tuple[str, str, str]],
default_qc_spec: Optional[Tuple[str, str, str]],
optimization_qc_spec: Optional[Tuple[str, str, str]],

as the optimization spec is likely the optional thing users will want to tweak, rather than the final level of theory?

workflow_name: Optional[str],
workflow_file_name: Optional[str],
directory: Optional[str],
Expand Down Expand Up @@ -85,6 +86,7 @@ def _run_cli(
force_field_path=force_field_path,
target_torsion_smirks=target_torsion_smirks,
default_qc_spec=default_qc_spec,
evaluation_qc_spec=evaluation_qc_spec,
workflow_name=workflow_name,
workflow_file_name=workflow_file_name,
allow_multiple_molecules=False,
Expand Down
47 changes: 33 additions & 14 deletions openff/bespokefit/cli/executor/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ def submit_options(allow_multiple_molecules: bool = False):
"then 'none' should be specified.",
required=False,
),
optgroup.option(
"--evaluation-qc-spec",
type=(str, str, str),
help="The program, method and basis used to refine the default specification. In the case of a torsion drive"
"this is the specification used to evaluate the PES on the geometries from the default spec.",
required=False,
),
]


Expand All @@ -97,6 +104,7 @@ def _to_input_schema(
force_field_path: Optional[str],
target_torsion_smirks: Tuple[str],
default_qc_spec: Optional[Tuple[str, str, str]],
evaluation_qc_spec: Optional[Tuple[str, str, str]],
workflow_name: Optional[str],
workflow_file_name: Optional[str],
) -> "BespokeOptimizationSchema":
Expand Down Expand Up @@ -135,21 +143,28 @@ def _to_input_schema(
workflow_factory.initial_force_field = force_field_path
if len(target_torsion_smirks) > 0:
workflow_factory.target_torsion_smirks = [*target_torsion_smirks]
if default_qc_spec is not None:

program, method, basis = default_qc_spec

if basis.lower() == "none":
basis = None

workflow_factory.default_qc_specs = [
QCSpec(
program=program,
method=method,
basis=basis,
spec_description="CLI provided spec",
for spec, name in [
(default_qc_spec, "default_qc_spec"),
(evaluation_qc_spec, "evaluation_qc_spec"),
]:
if spec is not None:

program, method, basis = spec

if basis.lower() == "none":
basis = None

setattr(
workflow_factory,
name,
QCSpec(
program=program,
method=method,
basis=basis,
spec_name=name,
spec_description=f"CLI provided spec {name}",
),
)
]

except FileNotFoundError:

Expand Down Expand Up @@ -201,6 +216,7 @@ def _submit(
force_field_path: Optional[str],
target_torsion_smirks: Tuple[str],
default_qc_spec: Optional[Tuple[str, str, str]],
evaluation_qc_spec: Optional[Tuple[str, str, str]],
workflow_name: Optional[str],
workflow_file_name: Optional[str],
allow_multiple_molecules: bool,
Expand Down Expand Up @@ -269,6 +285,7 @@ def _submit(
force_field_path,
target_torsion_smirks,
default_qc_spec,
evaluation_qc_spec,
workflow_name,
workflow_file_name,
)
Expand Down Expand Up @@ -330,6 +347,7 @@ def _submit_cli(
force_field_path: Optional[List[str]],
target_torsion_smirks: Tuple[str],
default_qc_spec: Optional[Tuple[str, str, str]],
evaluation_qc_spec: Optional[Tuple[str, str, str]],
workflow_name: Optional[str],
workflow_file_name: Optional[str],
save_submission: bool,
Expand All @@ -350,6 +368,7 @@ def _submit_cli(
force_field_path=force_field_path,
target_torsion_smirks=target_torsion_smirks,
default_qc_spec=default_qc_spec,
evaluation_qc_spec=evaluation_qc_spec,
workflow_name=workflow_name,
workflow_file_name=workflow_file_name,
allow_multiple_molecules=True,
Expand Down
7 changes: 3 additions & 4 deletions openff/bespokefit/data/schemas/debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
"heuristic": "path_length",
"keep_non_rotor_ring_substituents": false
},
"default_qc_specs": [
{
"default_qc_spec": {
"method": "uff",
"basis": null,
"program": "rdkit",
Expand All @@ -97,6 +96,6 @@
"mayer_indices"
],
"keywords": null
}
]
},
"evaluation_qc_spec": null
}
7 changes: 3 additions & 4 deletions openff/bespokefit/data/schemas/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
"heuristic": "path_length",
"keep_non_rotor_ring_substituents": false
},
"default_qc_specs": [
{
"default_qc_spec": {
"method": "B3LYP-D3BJ",
"basis": "DZVP",
"program": "psi4",
Expand All @@ -98,6 +97,6 @@
"mayer_indices"
],
"keywords": null
}
]
},
"evaluation_qc_spec": null
}
Loading