Skip to content

Commit

Permalink
Add 2.2.1 (#113)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
lilyminium and mattwthompson authored Sep 12, 2024
1 parent 1004602 commit 3fabe58
Show file tree
Hide file tree
Showing 4 changed files with 807 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenFF Force Fields

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


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

| Filename | DOI | FF line | Release Date | Major format changes? |
|---------------------------------------------|-----------------------------------------------------------------------------------------------------------|---------|---------------|-----------------------|
| `openff-2.2.1.offxml` | | Sage | September 11, 2024 | No |
| `openff_unconstrained-2.2.1.offxml` | | Sage | September 11, 2024 | No |
| `openff-2.2.1-rc1.offxml` | | Sage | July 22, 2024 | No |
| `openff_unconstrained-2.2.1-rc1.offxml` | | Sage | July 22, 2024 | No |
| `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 |
Expand Down Expand Up @@ -177,6 +179,8 @@ Force fields moving forward will be called `name-X.Y.Z`

- `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.

- `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.

#### Acknowledgements

Project based on the
Expand Down
20 changes: 13 additions & 7 deletions canary/scripts/test_hmr.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import importlib.resources
import pathlib
import sys

import numpy as np
import openmm.app
import openmm.unit
from openff.toolkit.topology import Molecule
from openff.toolkit import ForceField, Molecule
from openmmforcefields.generators import SystemGenerator

DATA_PATH = importlib.resources.files("canary") / "data"
DATA_PATH = pathlib.Path(".") / "canary" / "data"
coverage_mols = DATA_PATH / "coverage.smi"
propyne_mols = DATA_PATH / "propynes.smi"

Expand Down Expand Up @@ -58,8 +58,13 @@ def hmr_driver(mol, ff_name):

integrator = openmm.LangevinMiddleIntegrator(temperature, collision_rate, timestep)
context = openmm.Context(system, integrator)

# generate conformers, minimize, and set positions
mol.generate_conformers(n_conformers=1)
context.setPositions(mol.conformers[0].to_openmm())
ff = ForceField(f"{ff_name}.offxml")
ic = ff.create_interchange(mol.to_topology())
ic.minimize()
context.setPositions(ic.positions.to_openmm())

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

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

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

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

0 comments on commit 3fabe58

Please sign in to comment.