Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into to-amber
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Aug 30, 2024
2 parents dab2834 + d35a4b5 commit 6bd72a7
Show file tree
Hide file tree
Showing 106 changed files with 898 additions and 63,239 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:

- name: Run all tests
if: always()
run: python -m pytest -v $COV openff/interchange/ -m "slow or not slow"
run: python -m pytest -v $COV openff/interchange/

- name: Codecov
uses: codecov/codecov-action@v4
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ jobs:
- name: Run tests
if: always()
run: |
python -m pytest $COV openff/interchange/ \
-r fExs -n logical --durations=10 \
-m "slow or not slow" \
--ignore=openff/interchange/_tests/energy_tests/test_energies.py
python -m pytest $COV openff/interchange/ -r fExs -n logical --durations=10
- name: Run small molecule regression tests
if: ${{ matrix.python-version == '3.10' && matrix.openeye == true && matrix.openmm == true }}
Expand Down Expand Up @@ -127,14 +124,13 @@ jobs:
python devtools/scripts/molecule-regressions.py
- name: Run mypy
continue-on-error: true
if: ${{ matrix.python-version == '3.11' }}
if: ${{ matrix.python-version == '3.10' }}
run: |
# As of 01/23, JAX with mypy is too slow to use without a pre-built cache
# https://github.com/openforcefield/openff-interchange/pull/578#issuecomment-1369979875
micromamba remove jax
mypy -p "openff.interchange" --exclude "openff/interchange/_tests/"
mypy --show-error-codes plugins/nonbonded_plugins/
python -m mypy -p "openff.interchange" --exclude "openff/interchange/_tests/"
python -m mypy plugins/nonbonded_plugins/
- name: Codecov
uses: codecov/codecov-action@v4
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,11 @@ jobs:

- name: Run docexamples
run: |
# TODO: Add back /interchange.py when `TypedMolecule` is implemented
pytest --doctest-modules openff/interchange/ --ignore=openff/interchange/_tests --ignore=openff/interchange/components/interchange.py
pytest --doctest-modules openff/interchange/ --ignore=openff/interchange/_tests
- name: Run example notebooks
if: always()
run: |
python -m pytest --nbval-lax --dist loadscope -n logical --durations=20 \
examples/ \
python -m pytest --nbval-lax --dist loadscope -n logical --durations=20 examples/ \
--ignore=examples/deprecated/ \
--ignore=examples/experimental/openmmforcefields/ \
--ignore=examples/lammps/ \
--ignore=examples/protein_ligand/ \
--ignore=examples/conformer_energies/conformer_energies.ipynb
--ignore=examples/experimental
9 changes: 8 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ repos:
hooks:
- id: add-trailing-comma
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.2
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/econchick/interrogate
rev: 1.7.0
hooks:
Expand Down Expand Up @@ -46,3 +47,9 @@ repos:
hooks:
- id: nbstripout
files: ^examples
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
args:
- --py310-plus
2 changes: 1 addition & 1 deletion devtools/conda-envs/beta_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- pydantic >=1.10.17,<3
- openmm >=7.6
# OpenFF stack
- openff-toolkit >=0.15.2
- openff-toolkit ~=0.16.4
- openff-nagl ~=0.3.7
- openff-nagl-models =0.1
# Optional features
Expand Down
35 changes: 18 additions & 17 deletions devtools/conda-envs/dev_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,31 @@ channels:
- openeye
dependencies:
# Core
- python =3.11
- pip
- python =3.10
- versioneer-518
- numpy
- pydantic =2
- openmm
# OpenFF stack
- openff-toolkit ~=0.16
- openff-interchange-base
- openff-toolkit-base ~=0.16.4
- openff-units
- ambertools =23
# Optional features
- openmm
# smirnoff-plugins =2024
# de-forcefields # add back after smirnoff-plugins update
- openff-nagl
- openff-nagl-models
- ambertools =23
# Optional features
- mbuild ~=0.17
- foyer ~=0.12
- mbuild ~=0.18
- foyer =1
- gmso ~=0.12
- nglview
# Drivers
- gromacs =2024
- lammps >=2023.08.02
- panedr
# shim for a build issue that's probably localized to conda-forge
# https://github.com/conda-forge/lammps-feedstock/issues/207
- openmpi =4
# Testing
- mdtraj
- intermol
Expand All @@ -29,21 +38,13 @@ dependencies:
- pytest-xdist
- pytest-randomly
- nbval
# de-forcefields # add back after smirnoff-plugins update
# Drivers
- gromacs =2024
- lammps >=2023.08.02
- panedr
# Typing
- mypy
- typing-extensions
- types-setuptools
- pandas-stubs
# Development tools
# https://github.com/mamba-org/mamba/issues/1523#issuecomment-1246591319
- micromamba
- jupyterlab
- nglview
- pdbfixer
- ipdb
- pre-commit
Expand Down
6 changes: 3 additions & 3 deletions devtools/conda-envs/docs_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ dependencies:
- pip
- numpy =1
- pydantic =2
- openff-toolkit-base
- openmm >=7.6
- openff-toolkit-base ~=0.16.4
- openmm =8
- mbuild
- foyer >=0.12.1
- foyer =1
- nglview
- panedr
- typing-extensions
Expand Down
38 changes: 22 additions & 16 deletions devtools/conda-envs/examples_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,35 @@ channels:
dependencies:
# Core
- python
- versioneer-518
- numpy
- pydantic =2
- openmm
# OpenFF stack
- openff-toolkit
- openff-nagl
- openff-nagl-models
- openff-toolkit-base ~=0.16.4
- openff-units
- ambertools =23
# Optional features
- unyt
- mbuild =0.17
- foyer >=0.12.1
- gmso =0.12
- openff-nagl
- openff-nagl-models
- mbuild ~=0.18
- foyer =1
- gmso ~=0.12
- nglview
# Drivers
- gromacs
- lammps >=2023.08.02
# shim for a build issue that's probably localized to conda-forge
# https://github.com/conda-forge/lammps-feedstock/issues/207
- openmpi =4
- panedr
# Testing
- mdtraj
- pytest
- pytest-xdist
- nbval
# Examples
- openmmforcefields
- jax
- mdtraj
- pdbfixer
- nglview
- openeye-toolkits =2024.1.0
- pytest =8.0
- pytest-xdist
- nbval
- rich
# Drivers
- gromacs
- lammps >=2023.08.02
28 changes: 18 additions & 10 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,30 @@ dependencies:
- python
- versioneer-518
- numpy
- pydantic >=1.10.17,<3
- pydantic =2
# OpenFF stack
- openff-toolkit-base >=0.16
- openff-toolkit-base ~=0.16.4
- openff-units
- ambertools =23
# Needs to be explicitly listed to not be dropped when AmberTools is removed
- rdkit
# Optional features
- foyer >=0.12.1
- mbuild
- gmso =0.12
- openmm
# smirnoff-plugins =2024
# de-forcefields # add back after smirnoff-plugins update
- openff-nagl
- openff-nagl-models
- mbuild ~=0.18
- foyer =1
- gmso ~=0.12
- nglview
# Drivers
- gromacs
- lammps >=2023.08.02
# shim for a build issue that's probably localized to conda-forge
# https://github.com/conda-forge/lammps-feedstock/issues/207
- openmpi =4
- panedr
# Testing
- mdtraj
- intermol
Expand All @@ -26,11 +39,6 @@ dependencies:
- pytest-xdist
- pytest-randomly
- nbval
- nglview
# Drivers
- gromacs
- lammps >=2023.08.02
- panedr
# Typing
- mypy
- typing-extensions
Expand Down
16 changes: 16 additions & 0 deletions docs/releasehistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ Dates are given in YYYY-MM-DD format.

Please note that all releases prior to a version 1.0.0 are considered pre-releases and many API changes will come before a stable release.

## 0.4.0 - 2024

* Pydantic v2 is now used at runtime. As a consequence, models containing `Interchange`s cannot also use models from the v1 API.
* `Interchange.to_gromacs` and similar methods now raise an error if no box is defined.
* Previously, this was a warning.
* GROMACS dropped support for (proper) vacuum simulations in version 2020 and there are no immediate plans to re-introduce it.
* Users freqently approximate vacuum simulation with periodic boundary conditions by applying a large box. This has some performance issues and some non-bonded terms likely differ numerically compared to similar implementations in other engines.
* The wrapped use of external readers and writers is removed, and with it arguments like `writer` in many `Interchange.to_x` calls.
* Several classes and methods which were deprecated in the 0.3 line of releases are now removed.
* Previously-deprecated examples are removed.
* `ProperTorsionKey` no longer accepts an empty tuple as atom indices.

## 0.3.30 - 2024-08

* #1039 Updates support of "cutoff" electrostatics in `.to_openmm` to better reflect what OpenMM supports. Set `"reaction-field"` to force the use of `CutoffPeriodic`, provided the vdW and electrostatic cutoff distances match. The potential/method `"cutoff"` is no longer supported but may be re-added in the future.

## 0.3.29 - 2024-08-01

* #1023 Fixes a bug in which non-bonded parameter lookup sometimes crashed when virtual sites were present.
Expand Down
4 changes: 2 additions & 2 deletions docs/using/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ At this point, we have created a class that can parse sections of a custom OFFXM
from openff.toolkit import Topology

from typing import Literal, Type
from openff.models.types import FloatQuantity
from openff.interchange._annotations import DistanceQuantity
from openff.interchange.smirnoff._nonbonded import _SMIRNOFFNonbondedCollection
from openff.interchange.components.potentials import Potential

Expand All @@ -231,7 +231,7 @@ class SMIRNOFFBuckinghamCollection(_SMIRNOFFNonbondedCollection):

mixing_rule: str = "Buckingham"

switch_width: FloatQuantity["angstrom"] = unit.Quantity(1.0, unit.angstrom)
switch_width: DistanceQuantity = unit.Quantity(1.0, unit.angstrom)

@classmethod
def allowed_parameter_handlers(cls):
Expand Down
12 changes: 4 additions & 8 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@

Jupyter notebooks demonstrating use cases.

* `conformer_energies.ipynb`: Given a SMILES string, generate conformers and compute the single-point energy via GROMACS and OpenMM and compare to a result generated by the OpenFF toolkit.
* `conformer_energies/conformer_energies.ipynb`: Given a SMILES string, generate conformers and compute the single-point energy via GROMACS and OpenMM and compare to a result generated by the OpenFF toolkit.
* `ligand_in_water/ligand_in_water.ipynb`: Solvate a ligand in water and prepare a simulation.
* `packed_box/packed_box.ipynb`: Prepare a box of organic species for a simulation and compare the
results of OpenMM, GROMACS, Amber, and LAMMPS.
* `protein_ligand/protein_ligand.ipynb`: Prepare a protein-ligand system for simulation using
OpenFF tools and compare the results of OpenMM, GROMACS, Amber, and LAMMPS.
* `openmm/openmm.ipynb`: Prepare a box of organic species for a simulation with OpenMM.
* `lammps/lammps.ipynb`: Prepare a box of organic species for a simulation with LAMMPS.
* `foyer-showcase/solvated-nanoparticle.ipynb`: Use [`mBuild`](https://mbuild.mosdef.org/) to construct a silica nanoparticle solvated in tetrahydrofuran and then parametrize the nanoparticle with OPLS-AA via [`Foyer`](https://foyer.mosdef.org/) and Sage.

## Deprecated examples

* `optimize-with-jax.ipynb`: Run a minimal parameter optimization using JAX.
* `parameter_replacement.ipynb`: Partially replace parameters in a parametrized system with values from a second force field.
* `parameter_splitting.ipynb`: Split one SMIRKS pattern into two after parametrization.
* `vectorized_representations/vectorized_representations.ipynb`: Export systems to vectorized representations.
* `host_guest/host_guest.ipynb`: Prepare a host-guest system.
* `virtual_sites/virtual_sites.ipynb`: Apply several types of SMIRNOFF virtual sites to ligands.
2 changes: 1 addition & 1 deletion examples/conformer_energies/conformer_energies.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"outputs": [],
"source": [
"molecule = Molecule.from_smiles(SMILES)\n",
"molecule.generate_conformers(n_conformers=20, rms_cutoff=0.1 * unit.angstrom),\n",
"(molecule.generate_conformers(n_conformers=20, rms_cutoff=0.1 * unit.angstrom),)\n",
"topology = molecule.to_topology()"
]
},
Expand Down
Loading

0 comments on commit 6bd72a7

Please sign in to comment.