Skip to content

Commit

Permalink
Migrate openforcefield to openff.toolkit (#803).
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBoothroyd committed Jan 14, 2021
1 parent 68a0881 commit de8a4a5
Show file tree
Hide file tree
Showing 248 changed files with 911 additions and 1,001 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
openforcefield/_version.py export-subst
openff/toolkit/_version.py export-subst
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- [ ] Tag issue being addressed
- [ ] Add [tests](https://github.com/openforcefield/openforcefield/tree/master/openforcefield/tests)
- [ ] Update docstrings/[documentation](https://github.com/openforcefield/openforcefield/tree/master/docs), if applicable
- [ ] Add [tests](https://github.com/openforcefield/openff-toolkit/tree/master/openff/toolkit/tests)
- [ ] Update docstrings/[documentation](https://github.com/openforcefield/openff-toolkit/tree/master/docs), if applicable
- [ ] [Lint](https://open-forcefield-toolkit.readthedocs.io/en/latest/developing.html#style-guide) codebase
- [ ] Update [changelog](https://github.com/openforcefield/openforcefield/blob/master/docs/releasehistory.rst)
- [ ] Update [changelog](https://github.com/openforcefield/openff-toolkit/blob/master/docs/releasehistory.rst)
26 changes: 14 additions & 12 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

jobs:
test:
if: (github.event_name == 'schedule' && github.repository == 'openforcefield/openforcefield') || (github.event_name != 'schedule')
if: (github.event_name == 'schedule' && github.repository == 'openforcefield/openff-toolkit') || (github.event_name != 'schedule')
name: Test on ${{ matrix.cfg.os }}, Python ${{ matrix.python-version }}, RDKit=${{ matrix.cfg.rdkit }}, OpenEye=${{ matrix.cfg.openeye }}
runs-on: ${{ matrix.cfg.os }}
strategy:
Expand Down Expand Up @@ -51,8 +51,8 @@ jobs:
OPENEYE: ${{ matrix.cfg.openeye }}
PYVER: ${{ matrix.python-version }}
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
PACKAGE: openforcefield
PYTEST_ARGS: -r fE --tb=short --cov=openforcefield --cov-config=setup.cfg --cov-append --cov-report=xml
PACKAGE: openff
PYTEST_ARGS: -r fE --tb=short --cov=openff --cov-config=setup.cfg --cov-append --cov-report=xml
NB_ARGS: -v --nbval-lax --ignore=examples/deprecated

steps:
Expand Down Expand Up @@ -106,41 +106,41 @@ jobs:
- name: Install package
shell: bash -l {0}
run: |
python -m pip install --no-deps -v .
python setup.py develop --no-deps
- name: Check installed toolkits
shell: bash -l {0}
run: |
if [[ "$OPENEYE" == true ]]; then
python -c "from openforcefield.utils.toolkits import OPENEYE_AVAILABLE; assert OPENEYE_AVAILABLE, 'OpenEye unavailable'"
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert OPENEYE_AVAILABLE, 'OpenEye unavailable'"
fi
if [[ "$OPENEYE" == false ]]; then
if [[ $(conda list | grep openeye-toolkits) ]]; then
conda remove --force openeye-toolkits --yes
fi
python -c "from openforcefield.utils.toolkits import OPENEYE_AVAILABLE; assert not OPENEYE_AVAILABLE, 'OpenEye unexpectedly found'"
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert not OPENEYE_AVAILABLE, 'OpenEye unexpectedly found'"
fi
if [[ "$RDKIT" == true ]]; then
python -c "from openforcefield.utils.toolkits import RDKIT_AVAILABLE; assert RDKIT_AVAILABLE, 'RDKit unavailable'"
python -c "from openff.toolkit.utils.toolkits import RDKIT_AVAILABLE; assert RDKIT_AVAILABLE, 'RDKit unavailable'"
fi
if [[ "$RDKIT" == false ]]; then
if [[ $(conda list | grep rdkit) ]]; then
conda remove --force rdkit --yes
fi
python -c "from openforcefield.utils.toolkits import RDKIT_AVAILABLE; assert not RDKIT_AVAILABLE, 'RDKit unexpectedly found'"
python -c "from openff.toolkit.utils.toolkits import RDKIT_AVAILABLE; assert not RDKIT_AVAILABLE, 'RDKit unexpectedly found'"
fi
- name: Check links
shell: bash -l {0}
if: ${{ matrix.cfg.rdkit == 'true' && matrix.cfg.openeye == 'TRUE' }}
run: |
pytest -r fE --tb=short openforcefield/tests/test_links.py
pytest -r fE --tb=short openff/toolkit/tests/test_links.py
- name: Run unit tests
shell: bash -l {0}
run: |
PYTEST_ARGS+=" --ignore=openforcefield/tests/test_examples.py"
PYTEST_ARGS+=" --ignore=openforcefield/tests/test_links.py"
PYTEST_ARGS+=" --ignore=openff/toolkit/tests/test_examples.py"
PYTEST_ARGS+=" --ignore=openff/toolkit/tests/test_links.py"
if [[ "$RDKIT" == true && "$OPENEYE" == true ]]; then
PYTEST_ARGS+="--doctest-modules"
fi
Expand All @@ -153,12 +153,14 @@ jobs:
PYTEST_ARGS+=" --ignore=examples/check_dataset_parameter_coverage"
PYTEST_ARGS+=" --ignore=examples/QCArchive_interface"
fi
pytest $PYTEST_ARGS openforcefield/tests/test_examples.py
pytest $PYTEST_ARGS openff/toolkit/tests/test_examples.py
- name: Run example notebooks
shell: bash -l {0}
run: |
NB_ARGS+=" --ignore=examples/using_smirnoff_in_amber_or_gromacs"
# XFail until a new `openmmforcefields` build is made which depends on `openff-toolkit`.
NB_ARGS+=" --ignore=examples/swap_amber_parameters"
if [[ "$RDKIT" == false ]]; then
NB_ARGS+=" --ignore=examples/check_dataset_parameter_coverage"
NB_ARGS+=" --ignore=examples/conformer_energies"
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
OPENEYE: ${{ matrix.openeye }}
PYVER: ${{ matrix.python-version }}
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
PACKAGE: openforcefield
PACKAGE: openff-toolkit

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -82,13 +82,13 @@ jobs:
shell: bash -l {0}
run: |
if [[ "$OPENEYE" == true ]]; then
python -c "from openforcefield.utils.toolkits import OPENEYE_AVAILABLE; assert OPENEYE_AVAILABLE, 'OpenEye unavailable'"
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert OPENEYE_AVAILABLE, 'OpenEye unavailable'"
fi
if [[ "$OPENEYE" == false ]]; then
if [[ $(conda list | grep openeye-toolkits) ]]; then
conda remove --force openeye-toolkits --yes
fi
python -c "from openforcefield.utils.toolkits import OPENEYE_AVAILABLE; assert not OPENEYE_AVAILABLE, 'OpenEye unexpectedly found'"
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert not OPENEYE_AVAILABLE, 'OpenEye unexpectedly found'"
fi
- name: Check that correct OFFTK version was installed
Expand All @@ -97,8 +97,8 @@ jobs:
# Go up one directory to ensure that we don't just load the OFFTK from the checked-out repo
cd ../
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openforcefield.git | cut -f2 | grep -v "rc" | tail -1 | sed 's/refs\/tags\///')
export FOUND_VER=$(python -c "import openforcefield; print(openforcefield.__version__)")
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -v "rc" | tail -1 | sed 's/refs\/tags\///')
export FOUND_VER=$(python -c "import openff.toolkit; print(openff.toolkit.__version__)")
echo "Latest tag is"
echo $LATEST_TAG
Expand All @@ -110,12 +110,12 @@ jobs:
exit 1
fi
cd openforcefield
cd openff/toolkit
- name: Test the package
shell: bash -l {0}
run: |
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openforcefield.git | cut -f2 | grep -v "rc" | tail -1 | sed 's/refs\/tags\///')
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -v "rc" | tail -1 | sed 's/refs\/tags\///')
# Checkout the state of the repo as of the last release
git fetch --tags
git checkout tags/$LATEST_TAG
Expand All @@ -125,10 +125,10 @@ jobs:
ls
if [[ "$OPENEYE" == true ]]; then
python -c "import openforcefield; print(openforcefield.__file__)"
python -c "import openff.toolkit; print(openff.toolkit.__file__)"
python -c "import openeye; print(openeye.oechem.OEChemIsLicensed())"
fi
PYTEST_ARGS=" -r fE --tb=short"
PYTEST_ARGS+=" --ignore=openforcefield/tests/test_links.py"
pytest $PYTEST_ARGS openforcefield
PYTEST_ARGS+=" --ignore=openff/toolkit/tests/test_links.py"
pytest $PYTEST_ARGS openff
16 changes: 8 additions & 8 deletions .github/workflows/installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
# Find the tag of the last release (excluding RCs)
# TODO: Make this a variable that can be passed through from trigger and/or allow RC
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openforcefield.git | cut -f2 | grep -v "rc" | tail -1 | sed 's/refs\/tags\///')
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -v "rc" | tail -1 | sed 's/refs\/tags\///')
echo $LATEST_TAG
Expand All @@ -76,7 +76,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}_py${{ matrix.python-version }}.sh
path: toolkit-installer-constructor/build/openforcefield*/openforcefield*.sh
path: toolkit-installer-constructor/build/openff-toolkit*/openff-toolkit*.sh

- name: Install from installer
shell: bash -l {0}
Expand All @@ -86,18 +86,18 @@ jobs:
ls
ls toolkit-installer-constructor
ls toolkit-installer-constructor/build
ls toolkit-installer-constructor/build/openforcefield-*/
ls toolkit-installer-constructor/build/openff-toolkit-*/
mkdir scratch
cd scratch
echo $HOME/constructor_install/ | bash ../toolkit-installer-constructor/build/openforcefield-*/openforcefield-*.sh
echo $HOME/constructor_install/ | bash ../toolkit-installer-constructor/build/openff-toolkit-*/openff-toolkit-*.sh
conda activate $HOME/constructor_install/
conda info
conda list
export FOUND_VER=$(python -c "import openforcefield; print(openforcefield.__version__)")
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openforcefield.git | cut -f2 | grep -v "rc" | tail -1 | sed 's/refs\/tags\///')
export FOUND_VER=$(python -c "import openff.toolkit; print(openff.toolkit.__version__)")
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -v "rc" | tail -1 | sed 's/refs\/tags\///')
echo $LATEST_TAG
echo $FOUND_VER
Expand All @@ -108,9 +108,9 @@ jobs:
fi
PYTEST_ARGS=" -r fE --tb=short"
PYTEST_ARGS+=" --ignore=openforcefield/tests/test_links.py"
PYTEST_ARGS+=" --ignore=openff/toolkit/tests/test_links.py"
# This should work if run directly at release time, but a safer approach would be
# to `git checkout` the corresponding tag of the release, see PR #577
pytest $PYTEST_ARGS ../openforcefield/tests/
pytest $PYTEST_ARGS ../openff/toolkit/tests/
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: Run black
run: |
black --check openforcefield
black --check openff
- name: Run isort
run: |
isort --check openforcefield
isort --check openff
44 changes: 0 additions & 44 deletions .github/workflows/package-build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Essentially, anything which provides the full identity of what you want to simul

We recommend that you install the toolkit in a fresh conda environment, explicitly passing the channels to be used, in-order:

conda create -n <my_new_env> -c conda-forge -c omnia openforcefield
conda create -n <my_new_env> -c conda-forge openff-toolkit
conda activate <my_new_env>

Installing into a new environment avoids forcing conda to satisfy the dependencies of both the toolkit and all existing packages in that environment.
Expand Down
6 changes: 5 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
include LICENSE
include MANIFEST.in
include versioneer.py
include openforcefield/_version.py

graft openff
global-exclude *.py[cod] __pycache__ *.so
Loading

0 comments on commit de8a4a5

Please sign in to comment.