Skip to content

Commit

Permalink
Test new python versions (#880)
Browse files Browse the repository at this point in the history
* test new python versions

* need python 3.10 not 3.1

* make matrix easier to understand

* fix yaml

* fix matrix var issue

* hardcode os

* don't need OS in yaml

* fixing yaml syntax

* see if setting these versions will fix the issues

* now lets see which package fixed this

* I think this is it

* not sure if this will work, bash scripting is not my strenght

* install nightly build correctly this time

* make sure to install even if it exits in env

* dropping python 3.10 testing

* lets see if conda will install the dev version

* lets see if this gets us the right openmm nightly

* remove pin to test test fix

* fix tests to check across pcb

* fix silly name error

* mistake in logic for error checking

* force installing from omnia
  • Loading branch information
mikemhenry authored Oct 28, 2021
1 parent 2a3614b commit e165e76
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
31 changes: 12 additions & 19 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,17 @@ on:

jobs:
test:
name: Test on ${{ matrix.cfg.os }}, Python ${{ matrix.cfg.python-version }}, OpenMM ${{ matrix.cfg.openmm }}
runs-on: ${{ matrix.cfg.os }}
name: Test on ubuntu-latest, Python ${{ matrix.python-version }}, OpenMM ${{ matrix.openmm }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-latest, python-version: 3.7, openmm: latest }
- { os: ubuntu-latest, python-version: 3.8, openmm: latest }
- { os: ubuntu-latest, python-version: 3.7, openmm: nightly }
- { os: ubuntu-latest, python-version: 3.8, openmm: nightly }
- { os: ubuntu-latest, python-version: 3.7, openmm: conda-forge }
- { os: ubuntu-latest, python-version: 3.8, openmm: conda-forge }
python-version: [3.7, 3.8, 3.9]
openmm: ["nightly", "7.5.1.", "7.6.0"]

env:
OPENMM: ${{ matrix.cfg.openmm }}
OPENMM: ${{ matrix.openmm }}
OE_LICENSE: ${{ github.workspace }}/oe_license.txt

steps:
Expand Down Expand Up @@ -56,16 +52,13 @@ jobs:
- name: Refine test environment
shell: bash -l {0}
run: |
case ${{ matrix.cfg.openmm }} in
latest)
echo "Using latest release OpenMM."
mamba install --quiet -c conda-forge openmm;;
#rc) # We can uncomment this case when we have this label on conda-forge
#echo "Using OpenMM rc"
#mamba install --quiet -c conda-forge/label/openmm_rc openmm;;
case ${{ matrix.openmm }} in
nightly)
echo "Using OpenMM nightly dev build."
mamba install --quiet -c omnia-dev openmm;;
echo "Using nightly dev build of OpenMM."
conda install -y -c omnia-dev openmm --override-channels --force-reinstall;;
*)
echo "installing OpenMM version ${{ matrix.openmm }}"
mamba install -y -c conda-forge openmm=${{ matrix.openmm }};;
esac
- name: Install package
Expand Down
5 changes: 4 additions & 1 deletion perses/tests/test_coordinate_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def test_openmm_dihedral():
msg += '_internal_to_cartesian generated positions for: {}\n'.format(phi)
msg += 'OpenMM: {}\n'.format(openmm_phi)
msg += 'positions: {}'.format(positions)
assert np.linalg.norm(openmm_phi - phi) < TORSION_TOLERANCE, msg

delta = abs(openmm_phi - phi)
error = min(delta, 2*np.pi - delta)
assert error < TORSION_TOLERANCE, msg

# Check that _cartesian_to_internal agrees
rtp, detJ = geometry_engine._cartesian_to_internal(xyz_atom1, bond_position, angle_position, torsion_position)
Expand Down
6 changes: 5 additions & 1 deletion perses/tests/test_geometry_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,11 @@ def test_torsion_scan():
for i, phi in enumerate(phis):
xyz_ge = xyzs[i]
r_new, theta_new, phi_new = _get_internal_from_omm(xyz_ge, testsystem.positions[1], testsystem.positions[2], testsystem.positions[3])
if np.abs(phi_new - phi) > TOLERANCE:

delta = abs(phi_new - phi)
error = min(delta, 2*np.pi-delta)

if error > TOLERANCE:
raise Exception("Torsion scan did not match OpenMM torsion")
if np.abs(r_new - r) > TOLERANCE or np.abs(theta_new - theta) > TOLERANCE:
raise Exception("Theta or r was disturbed in torsion scan.")
Expand Down

0 comments on commit e165e76

Please sign in to comment.