Skip to content

Commit 3fabe58

Browse files
Add 2.2.1 (#113)
* add ff files * add draft version * Update README * Do not assume `canary` is a module * print actual error * could it be flaky conformer gen? minimize first? * Lint --------- Co-authored-by: Matthew W. Thompson <[email protected]>
1 parent 1004602 commit 3fabe58

File tree

4 files changed

+807
-8
lines changed

4 files changed

+807
-8
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenFF Force Fields
22

3-
[![Build Status](https://github.com/openforcefield/openff-forcefields/workflows/CI/badge.svg)](https://github.com/openforcefield/openff-forcefields/actions?query=branch%3Amaster+workflow%3ACI)
3+
[![Build Status](https://github.com/openforcefield/openff-forcefields/workflows/CI/badge.svg)](https://github.com/openforcefield/openff-forcefields/actions?query=branch%3Amain+workflow%3ACI)
44

55

66
This repository contains force fields released by the [Open Force Field Initiative](https://openforcefield.org).
@@ -28,6 +28,8 @@ Details for each force field in this repository can be found in the following ta
2828

2929
| Filename | DOI | FF line | Release Date | Major format changes? |
3030
|---------------------------------------------|-----------------------------------------------------------------------------------------------------------|---------|---------------|-----------------------|
31+
| `openff-2.2.1.offxml` | | Sage | September 11, 2024 | No |
32+
| `openff_unconstrained-2.2.1.offxml` | | Sage | September 11, 2024 | No |
3133
| `openff-2.2.1-rc1.offxml` | | Sage | July 22, 2024 | No |
3234
| `openff_unconstrained-2.2.1-rc1.offxml` | | Sage | July 22, 2024 | No |
3335
| `openff-2.2.0.offxml` | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10995191.svg)](https://doi.org/10.5281/zenodo.10995191) | Sage | April 18, 2024 | No |
@@ -177,6 +179,8 @@ Force fields moving forward will be called `name-X.Y.Z`
177179

178180
- `2024.07.0`: This release adds `openff-2.2.1-rc1.offxml` and `openff_unconstrained-2.2.1-rc1.offxml`, which contains re-fit valence parameters where linear angles have been pinned to linear equilibrium values.
179181

182+
- `2024.09.0` This release adds the Sage 2.2.1 force field with `openff-2.2.1.offxml` and `openff_unconstrained-2.2.1.offxml`, with identifical parameters to 2.2.1-rc1.
183+
180184
#### Acknowledgements
181185

182186
Project based on the

canary/scripts/test_hmr.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import importlib.resources
1+
import pathlib
22
import sys
33

44
import numpy as np
55
import openmm.app
66
import openmm.unit
7-
from openff.toolkit.topology import Molecule
7+
from openff.toolkit import ForceField, Molecule
88
from openmmforcefields.generators import SystemGenerator
99

10-
DATA_PATH = importlib.resources.files("canary") / "data"
10+
DATA_PATH = pathlib.Path(".") / "canary" / "data"
1111
coverage_mols = DATA_PATH / "coverage.smi"
1212
propyne_mols = DATA_PATH / "propynes.smi"
1313

@@ -58,8 +58,13 @@ def hmr_driver(mol, ff_name):
5858

5959
integrator = openmm.LangevinMiddleIntegrator(temperature, collision_rate, timestep)
6060
context = openmm.Context(system, integrator)
61+
62+
# generate conformers, minimize, and set positions
6163
mol.generate_conformers(n_conformers=1)
62-
context.setPositions(mol.conformers[0].to_openmm())
64+
ff = ForceField(f"{ff_name}.offxml")
65+
ic = ff.create_interchange(mol.to_topology())
66+
ic.minimize()
67+
context.setPositions(ic.positions.to_openmm())
6368

6469
# Run for 10 ps
6570
integrator.step(2500)
@@ -73,7 +78,7 @@ def hmr_driver(mol, ff_name):
7378

7479
if __name__ == "__main__":
7580
"""This function expects to be called with a list of OFFXML files passed to it,
76-
i.e. piped from git diff upstream/master --name-only"""
81+
i.e. piped from git diff upstream/main --name-only"""
7782
# Read force field filenames from stdin
7883
failed_runs = []
7984
for line in sys.stdin:
@@ -98,11 +103,12 @@ def hmr_driver(mol, ff_name):
98103
except NANEnergyError:
99104
failed_runs.append([mol.to_smiles(), ff_name, "NaN energy"])
100105

101-
except Exception:
106+
except Exception as e:
102107
# OpenMM's OpenMMException cannot be caught as it does not
103108
# inherit from BaseException; therefore this clause may
104109
# hit other errors than NaN positions
105-
failed_runs.append([mol.to_smiles(), ff_name, "NaN position(s)"])
110+
# failed_runs.append([mol.to_smiles(), ff_name, "NaN position(s)"])
111+
failed_runs.append([mol.to_smiles(), ff_name, str(e)])
106112

107113
if len(failed_runs) > 0:
108114
raise HMRCanaryError("HMR tests failed:", failed_runs)

0 commit comments

Comments
 (0)