diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 85ac994af..b3d7dd71f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,13 +37,14 @@ jobs: os: ["ubuntu-latest"] pydantic-version: [">1"] python-version: - - "3.9" - "3.10" - "3.11" + - "3.12" openeye: ["no"] + ommff-version: ["0.13"] include: - os: "macos-12" - python-version: "3.11" + python-version: "3.12" pydantic-version: ">1" - os: "ubuntu-latest" python-version: "3.11" @@ -52,6 +53,11 @@ jobs: python-version: "3.11" pydantic-version: ">1" openeye: "yes" + - os: "ubuntu-latest" + python-version: "3.10" + pydantic-version: ">1" + openeye: "no" + ommff-version: "<0.13" env: OE_LICENSE: ${{ github.workspace }}/oe_license.txt @@ -77,6 +83,7 @@ jobs: create-args: >- python=${{ matrix.python-version }} pydantic=${{ matrix.pydantic-version }} + openmmforcefields=${{ matrix.ommff-version }} init-shell: bash - name: "Install OpenEye" diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 0458c3deb..e83beb55d 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -43,6 +43,7 @@ jobs: run: | python -m pip install --no-deps git+https://github.com/OpenFreeEnergy/gufe@main python -m pip install mypy + python -m pip install types-pkg_resources python -m pip install --no-deps -e . - name: "Environment Information" diff --git a/docs/installation.rst b/docs/installation.rst index 1569cf263..0957d653f 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -20,6 +20,12 @@ If you already have a Mamba installation, you can install ``openfe`` with: Note that you must run the latter line in each shell session where you want to use ``openfe``. OpenFE recommends the Mamba package manager for most users as it is orders of magnitude faster than the default Conda package manager. Mamba is a drop in replacement for Conda. +.. note:: + If you plan on using GAFF to parametrize your system, you **must** install ``openmmforcefields`` version ``0.12.0``. + This will create an environment with python 3.10 and the correct version of Ambertools. + + ``mamba create -c conda-forge -n openfe_env openfe=1 openmmforcefields=0.12.0`` + Installation with ``miniforge`` (recommended) ---------------------------------------------- diff --git a/environment.yml b/environment.yml index a159d6cde..bd8ed79e4 100644 --- a/environment.yml +++ b/environment.yml @@ -6,7 +6,7 @@ dependencies: - duecredit - kartograf>=1.0.0 - lomap2>=3.0.0 - - numpy<1.24 + - numpy - networkx - rdkit - pip @@ -28,7 +28,7 @@ dependencies: - typing-extensions - lomap2>=2.3.0 - openmmtools - - openmmforcefields>=0.11.2 + - openmmforcefields - perses - pooch - py3dmol diff --git a/openfe/tests/protocols/test_openmm_equil_rfe_protocols.py b/openfe/tests/protocols/test_openmm_equil_rfe_protocols.py index 5b0da263d..bae8f4efd 100644 --- a/openfe/tests/protocols/test_openmm_equil_rfe_protocols.py +++ b/openfe/tests/protocols/test_openmm_equil_rfe_protocols.py @@ -245,8 +245,31 @@ def test_dry_run_gaff_vacuum(benzene_vacuum_system, toluene_vacuum_system, ) unit = list(dag.protocol_units)[0] - with tmpdir.as_cwd(): - sampler = unit.run(dry=True)['debug']['sampler'] + # If we do a lot of GAFF testing, this should be refactored so we don't + # have to copy it all over the place. + # https://github.com/OpenFreeEnergy/openfe/pull/847#issuecomment-2096810453 + + + import openmmforcefields + from pkg_resources import packaging + + ommff_version = openmmforcefields.__version__ + + gaff_should_fail = packaging.version.parse( + ommff_version + ) >= packaging.version.parse("0.13.0") + + if gaff_should_fail: + from openmmforcefields.generators.template_generators import ( + GAFFNotSupportedError, + ) + + with pytest.raises(GAFFNotSupportedError): + with tmpdir.as_cwd(): + sampler = unit.run(dry=True)["debug"]["sampler"] + else: + with tmpdir.as_cwd(): + sampler = unit.run(dry=True)["debug"]["sampler"] @pytest.mark.slow diff --git a/openfe/tests/protocols/test_openmm_plain_md_protocols.py b/openfe/tests/protocols/test_openmm_plain_md_protocols.py index 0fb03a762..8bacb0395 100644 --- a/openfe/tests/protocols/test_openmm_plain_md_protocols.py +++ b/openfe/tests/protocols/test_openmm_plain_md_protocols.py @@ -177,8 +177,30 @@ def test_dry_run_gaff_vacuum(benzene_vacuum_system, tmpdir): ) unit = list(dag.protocol_units)[0] - with tmpdir.as_cwd(): - system = unit.run(dry=True)['debug']['system'] + # If we do a lot of GAFF testing, this should be refactored so we don't + # have to copy it all over the place. + # https://github.com/OpenFreeEnergy/openfe/pull/847#issuecomment-2096810453 + + import openmmforcefields + from pkg_resources import packaging + + ommff_version = openmmforcefields.__version__ + + gaff_should_fail = packaging.version.parse( + ommff_version + ) >= packaging.version.parse("0.13.0") + + if gaff_should_fail: + from openmmforcefields.generators.template_generators import ( + GAFFNotSupportedError, + ) + + with pytest.raises(GAFFNotSupportedError): + with tmpdir.as_cwd(): + system = unit.run(dry=True)["debug"]["system"] + else: + with tmpdir.as_cwd(): + system = unit.run(dry=True)["debug"]["system"] @pytest.mark.parametrize('method, backend, ref_key', [