Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into tolderance-units
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Oct 12, 2023
2 parents 920a502 + 58615f5 commit 226e655
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -2,7 +2,7 @@ ci:
autoupdate_schedule: "monthly"
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.9.1
hooks:
- id: black
files: (^openff|^integration-tests)
Expand Down
19 changes: 18 additions & 1 deletion openff/evaluator/protocols/forcefield.py
Expand Up @@ -13,6 +13,7 @@
import numpy as np
import openmm
import requests
from openff.interchange import Interchange
from openff.units import unit
from openff.units.openmm import to_openmm
from openmm import app
Expand Down Expand Up @@ -561,7 +562,23 @@ def _execute(self, directory, available_resources):
pdb_file.topology, unique_molecules=unique_molecules
)

system = force_field.create_openmm_system(topology)
interchange = Interchange.from_smirnoff(
topology=topology, force_field=force_field
)

# Check for openmm incompatibilities
combine_nonbonded_forces = True
for collection in interchange.collections.values():
try:
collection.check_openmm_requirements(
combine_nonbonded_forces=combine_nonbonded_forces
)
except AssertionError:
combine_nonbonded_forces = False

system = interchange.to_openmm(
combine_nonbonded_forces=combine_nonbonded_forces
)

if system is None:
raise RuntimeError(
Expand Down

0 comments on commit 226e655

Please sign in to comment.