Skip to content

Commit

Permalink
Blacken. [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jan 22, 2024
1 parent 801fc63 commit fee0214
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions emle/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,9 @@ def __init__(
# If the backend is ORCA, then try to find the executable.
elif self._backend == "orca":
if orca_path is None:
raise ValueError("'orca_path' must be specified when using the ORCA backend")
raise ValueError(
"'orca_path' must be specified when using the ORCA backend"
)

if not isinstance(orca_path, str):
raise TypeError("'orca_path' must be of type 'str'")
Expand Down Expand Up @@ -2741,7 +2743,9 @@ def _run_sqm(self, xyz, atomic_numbers, qm_charge):
forces = []
for line in f:
# Skip lines prior to convergence.
if line.startswith(" QMMM SCC-DFTB: SCC-DFTB for step 0 converged"):
if line.startswith(
" QMMM SCC-DFTB: SCC-DFTB for step 0 converged"
):
is_converged = True
continue

Expand Down Expand Up @@ -2784,9 +2788,9 @@ def _run_sqm(self, xyz, atomic_numbers, qm_charge):
# Convert units.
energy *= _KCAL_MOL_TO_HARTREE

# Convert the gradient to a NumPy array and reshape.
# Misleading comment in sqm output, the "forces" are actually gradients
# So, no need to multiply by -1
# Convert the gradient to a NumPy array and reshape. Misleading comment
# in sqm output, the "forces" are actually gradients so no need to
# multiply by -1
gradient = _np.array(forces) * _KCAL_MOL_TO_HARTREE * _BOHR_TO_ANGSTROM

return energy, gradient
Expand Down

0 comments on commit fee0214

Please sign in to comment.