Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 0 additions & 175 deletions .github/workflows/CI.yml

This file was deleted.

81 changes: 15 additions & 66 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [ "3.12"]
rdkit: [true, false]
rdkit: [true]
openeye: [true, false]
nagl: [true, false]
exclude:
- rdkit: false
openeye: false
- rdkit: true
openeye: true
- rdkit: false
nagl: true
nagl: [true]

env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
Expand All @@ -47,64 +40,35 @@ jobs:
with:
fetch-depth: 0

- name: Set environment variables
run: |
if [[ ${{ matrix.openeye }} == true && ${{ matrix.rdkit }} == false ]]; then
echo "ENVFILE=openeye" >> $GITHUB_ENV
echo "TOOLKIT_CHECKS=OPENEYE" >> $GITHUB_ENV
echo "PACKAGES_TO_REMOVE=ambertools rdkit" >> $GITHUB_ENV
fi

if [[ ${{ matrix.openeye }} == false && ${{ matrix.rdkit }} == true ]]; then
echo "ENVFILE=rdkit" >> $GITHUB_ENV
echo "TOOLKIT_CHECKS=RDKIT" >> $GITHUB_ENV
echo "PACKAGES_TO_REMOVE=openeye-toolkits" >> $GITHUB_ENV
fi

- name: Install conda environment with ${{ env.ENVFILE }}
- name: Install base conda environment
uses: mamba-org/setup-micromamba@v3
with:
environment-file: devtools/conda-envs/${{env.ENVFILE}}-examples.yaml
environment-file: devtools/conda-envs/base-examples.yaml
create-args: >-
python=${{ matrix.python-version }}

- name: Install OpenEye toolkits
if: ${{ matrix.openeye == true }}
run: micromamba install -c openeye "openeye-toolkits >=2024" -y

- name: Make oe_license.txt file from GH org secret "OE_LICENSE"
if: ${{ matrix.openeye == true }}
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
run: echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE}

- name: Optionally remove OpenFF NAGL
if: ${{ matrix.nagl == false }}
run: micromamba remove openff-nagl-base openff-nagl-models --force

- name: Install package
run: python -m pip install .

- name: Remove undesired toolkits
- name: Check OpenEye installed
if: ${{ matrix.openeye == true }}
run: |
# If openmmforcefields is included in either environment file,
# remove RDKit and AmberTools brought in by it. Currently it's not included,
# so don't remove it.
if [ ! -z "${{ env.PACKAGES_TO_REMOVE }}" ]; then
for cpkg in ${{ env.PACKAGES_TO_REMOVE }}; do
if [[ $(micromamba list | grep $cpkg) ]]; then micromamba remove --force $cpkg --yes ; fi
done
fi

- name: Check installed toolkits
run: |
for tk in ${{ env.TOOLKIT_CHECKS }}; do
python -c "from openff.toolkit.utils.toolkits import ${tk}_AVAILABLE; assert ${tk}_AVAILABLE, '${tk} unavailable'"
done
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert OPENEYE_AVAILABLE, 'OpenEye unavailable'"

- name: Check uninstalled toolkits
- name: Check OpenEye NOT installed
if: ${{ matrix.openeye == false }}
run: |
if [ ! -z "${{ env.PACKAGES_TO_REMOVE }}" ]; then
for tk in ${{ env.PACKAGES_TO_REMOVE }}; do
TK=$(echo ${tk%-*} | tr 'a-z' 'A-Z')
python -c "from openff.toolkit.utils.toolkits import ${TK}_AVAILABLE; assert not ${TK}_AVAILABLE, '${TK} available'"
done
fi
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert not OPENEYE_AVAILABLE, 'OpenEye available but shouldn\'t be'"

- name: Environment Information
run: |
Expand All @@ -114,25 +78,10 @@ jobs:

- name: Run example scripts
run: |
if [[ ${{ matrix.rdkit }} == false ]]; then
PYTEST_ARGS+=" --ignore=examples/check_dataset_parameter_coverage"
PYTEST_ARGS+=" --ignore=examples/QCArchive_interface"
fi
pytest $PYTEST_ARGS openff/toolkit/_tests/test_examples.py

- name: Run example notebooks
run: |
if [[ ${{ matrix.rdkit }} == false ]]; then
NB_ARGS+=" --ignore=examples/QCArchive_interface"
NB_ARGS+=" --ignore=examples/visualization"
NB_ARGS+=" --ignore=examples/check_dataset_parameter_coverage"
NB_ARGS+=" --ignore=examples/conformer_energies"
NB_ARGS+=" --ignore=examples/using_smirnoff_in_amber_or_gromacs"
NB_ARGS+=" --ignore=examples/using_smirnoff_with_amber_protein_forcefield"
NB_ARGS+=" --ignore=examples/SMIRNOFF_simulation"
NB_ARGS+=" --ignore=examples/toolkit_showcase"
fi

# GROMACS builds are not stable on macOS + GHA
if [[ ${{ matrix.os }} == macos-latest ]]; then
NB_ARGS+=" --ignore=examples/using_smirnoff_in_amber_or_gromacs/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: rdkit-examples
name: base-examples
channels:
- conda-forge
dependencies:
Expand All @@ -24,10 +24,8 @@ dependencies:
- openff-nagl-models >=0.3.0
- typing_extensions
- nglview
# Toolkit-specific
- ambertools
# https://github.com/rdkit/rdkit/issues/7221 and https://github.com/rdkit/rdkit/issues/7583
- rdkit =2024
- rdkit >=2024
# Test-only/optional/dev/typing/examples
- pytest =8
- pytest-xdist
Expand All @@ -42,5 +40,5 @@ dependencies:
- nbval
- mdtraj
- pdbfixer
- openmmforcefields >=0.11.2
# openmmforcefields >=0.15
- gromacs >=2023.3
45 changes: 0 additions & 45 deletions devtools/conda-envs/openeye-examples.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions devtools/conda-envs/rdkit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ dependencies:
- openff-nagl-base >=0.4.0
- openff-nagl-models >=0.3.0
- typing_extensions
# Toolkit-specific
- ambertools >=22
# https://github.com/rdkit/rdkit/issues/7221 and https://github.com/rdkit/rdkit/issues/7583
- rdkit !=2024.03.6,!=2024.03.5
# Test-only/optional/dev/typing
Expand Down
2 changes: 1 addition & 1 deletion examples/SMIRNOFF_simulation/run_simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
")\n",
"\n",
"# Load the OpenFF \"Sage\" force field.\n",
"forcefield = ForceField(\"openff-2.2.0.offxml\")\n",
"forcefield = ForceField(\"openff-2.3.0.offxml\")\n",
"\n",
"# Parametrize the topology and create an Interchange object.\n",
"interchange = forcefield.create_interchange(topology)"
Expand Down
4 changes: 2 additions & 2 deletions examples/conformer_energies/conformer_energies.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def compute_conformer_energies_from_file(filename):
+ f" ({molecule.name})"
)

# Load the openff-2.2.1 force field appropriate for vacuum calculations (without constraints)
forcefield = ForceField("openff_unconstrained-2.2.1.offxml")
# Load the openff-2.3.0 force field appropriate for vacuum calculations (without constraints)
forcefield = ForceField("openff_unconstrained-2.3.0.offxml")
# Create an Interchange object, which stores the result of parametrizing with this force field
print(f"Parametrizing {molecule.name} (may take a moment to calculate charges)...")
interchange = forcefield.create_interchange(molecule.to_topology())
Expand Down
Loading
Loading