Skip to content

Commit

Permalink
Merge pull request #252 from mattwthompson/fix-ci-2
Browse files Browse the repository at this point in the history
Include tests based on OpenFF Evaluator and Recharge
  • Loading branch information
leeping authored Dec 6, 2022
2 parents ee21587 + 693b5a8 commit 791fdf9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: forcebalance-test
channels:
- conda-forge
- bioconda
- openeye
dependencies:
# Base depends
- python
Expand All @@ -24,3 +25,6 @@ dependencies:
- geometric
- gromacs =2019.1
- openff-toolkit >=0.11.3
- openff-evaluator-base
- openff-recharge
- openeye-toolkits
12 changes: 6 additions & 6 deletions src/recharge_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
from forcebalance.target import Target

try:
from openff.recharge.charges.charges import ChargeSettings
from openff.recharge.charges import ChargeSettings
from openff.recharge.esp.storage import MoleculeESPStore
from openff.recharge.optimize import ElectricFieldOptimization, ESPOptimization
from openff.recharge.smirnoff import from_smirnoff
from openff.recharge.optimize import ElectricFieldObjective, ESPObjective # ElectricFieldOptimization, ESPOptimization
from openff.recharge.charges.bcc import BCCCollection
recharge_import_success = True
except ImportError:
recharge_import_success = False
Expand Down Expand Up @@ -96,7 +96,7 @@ def _initialize(self):
# TODO: it is assumed that the MDL aromaticity model should be used
# rather than the once specified in the FF as the model is not
# currently exposed. See OpenFF toolkit issue #663.
bcc_collection = from_smirnoff(bcc_handler)
bcc_collection = BCCCollection.from_smirnoff(bcc_handler)
bcc_smirks = [bcc.smirks for bcc in bcc_collection.parameters]

# Determine the indices of the BCC parameters being refit.
Expand Down Expand Up @@ -136,8 +136,8 @@ def _initialize(self):
# Pre-calculate the expensive operations which are needed to evaluate the
# objective function, but do not depend on the current parameters.
optimization_class = {
"esp": ESPOptimization,
"electric-field": ElectricFieldOptimization,
"esp": ESPObjective,
"electric-field": ElectricFieldObjective,
}[self.recharge_property]

objective_terms = [
Expand Down

0 comments on commit 791fdf9

Please sign in to comment.