Skip to content

Commit

Permalink
openmm
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Nov 13, 2024
1 parent 8bb0fee commit b716788
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
#if: false
run: |
conda remove qcelemental --force
python -m pip install 'git+https://github.com/loriab/QCElemental.git@csse_layout_536a' --no-deps
python -m pip install 'git+https://github.com/loriab/QCElemental.git@csse_layout_536b' --no-deps
# note: conda remove --force, not mamba remove --force b/c https://github.com/mamba-org/mamba/issues/412
# alt. is micromamba but not yet ready for setup-miniconda https://github.com/conda-incubator/setup-miniconda/issues/75
Expand Down
12 changes: 7 additions & 5 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ Misc.

MUST (Unmerged)
+++++++++++++++
- When qcengine.compute() fails and forms a fop = FailedOperation (raise_error=T), with v2, `fop.input_data` will be an <>Input model (when possible; if the error was in forming the model, it'll still be a dict), not always a dict like v1.
- When <executor>.compute() fails and collects the input for processing, with v2 it now uses the <>Input model passed to the executor, not the model-or-dict passed into compute().
- The net result of the two above is that whereas fop.input_data in v1 was reliably a dict and its contents would reflect whether a model or dict was passed to qcengine.compute(), now in v2, fop.input_data is a model whenever possible (to mirror <>Result.input_data) regardless of model or dict passed to qcengine.compute(); the only case where it's a dict is if the error was in forming the model.
- DFTD3 & DFTD4 (new intf) - intercept ``v1.AtomicResult`` with ``success=False`` and ``error`` fields set from QCSchema interfaces and return ``FailedOperation``s. Someday when upstream switches to v2, request packages return FaileOp directly and use ``input_error`` rather than ``input error``.
- ``qcengine run`` learned new argument ``--return-version`` analogous to ``qcengine.compute(..., return_version=1|2)`` so CLI matches API capabilities. Note *not* ported to phasing-out ``qcengine run-procedure``.
If you're missing something from AtomicResult.extras, check AtomicResult.input_data.extras in case it was passed in on input
- (:pr:`459`) OpenMM gained AtomicResult.properties.return_gradient
- (:pr:`458`) When qcengine.compute() fails and forms a fop = FailedOperation (raise_error=T), with v2, `fop.input_data` will be an <>Input model (when possible; if the error was in forming the model, it'll still be a dict), not always a dict like v1.
- (:pr:`458`) When <executor>.compute() fails and collects the input for processing, with v2 it now uses the <>Input model passed to the executor, not the model-or-dict passed into compute().
- (:pr:`458`) The net result of the two above is that whereas fop.input_data in v1 was reliably a dict and its contents would reflect whether a model or dict was passed to qcengine.compute(), now in v2, fop.input_data is a model whenever possible (to mirror <>Result.input_data) regardless of model or dict passed to qcengine.compute(); the only case where it's a dict is if the error was in forming the model.
- (:pr:`458`) DFTD3 & DFTD4 (new intf) - intercept ``v1.AtomicResult`` with ``success=False`` and ``error`` fields set from QCSchema interfaces and return ``FailedOperation``s. Someday when upstream switches to v2, request packages return FaileOp directly and use ``input_error`` rather than ``input error``.
- (:pr:`458`) ``qcengine run`` learned new argument ``--return-version`` analogous to ``qcengine.compute(..., return_version=1|2)`` so CLI matches API capabilities. Note *not* ported to phasing-out ``qcengine run-procedure``.

WIP (Unmerged)
++++++++++++++
Expand Down
7 changes: 5 additions & 2 deletions qcengine/programs/openmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,16 @@ def compute(self, input_model: "AtomicInput", config: "TaskConfig") -> "AtomicRe

# Force to gradient
ret_data["return_result"] = -1 * q
ret_data["properties"]["return_gradient"] = -1 * q
ret_data["properties"]["calcinfo_natom"] = len(input_model.molecule.symbols)
else:
raise InputError(f"Driver {input_model.driver} not implemented for OpenMM.")

ret_data["success"] = True
ret_data["extras"] = input_model.extras
ret_data["input_data"] = input_model
ret_data["molecule"] = input_model.molecule # should connectivity be added from off_mol?

# Move several pieces up a level
ret_data["provenance"] = Provenance(creator="openmm", version=openmm.version.short_version, nthreads=nthreads)

return AtomicResult(**{**input_model.dict(), **ret_data})
return AtomicResult(**ret_data)

0 comments on commit b716788

Please sign in to comment.