Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI #1290

Closed
wants to merge 11 commits into from
38 changes: 18 additions & 20 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,22 @@ jobs:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-latest, python-version: 3.7, docs: true, openmm: latest }
- { os: macos-latest, python-version: 3.7, docs: true, openmm: latest }
- { os: ubuntu-latest, python-version: 3.8, docs: false, openmm: latest }
- { os: ubuntu-latest, python-version: 3.7, docs: false, openmm: nightly }
- { os: ubuntu-latest, python-version: 3.8, docs: false, openmm: nightly }
- { os: ubuntu-latest, python-version: 3.7, docs: false, openmm: conda-forge }
- { os: ubuntu-latest, python-version: 3.8, docs: false, openmm: conda-forge }
- { os: ubuntu-latest, python-version: "3.8", docs: true, openmm: latest }
- { os: macos-latest, python-version: "3.8", docs: true, openmm: latest }
- { os: ubuntu-latest, python-version: "3.9", docs: false, openmm: latest }
- { os: ubuntu-latest, python-version: "3.8", docs: false, openmm: nightly }
- { os: ubuntu-latest, python-version: "3.9", docs: false, openmm: nightly }
- { os: ubuntu-latest, python-version: "3.8", docs: false, openmm: conda-forge }
- { os: ubuntu-latest, python-version: "3.9", docs: false, openmm: conda-forge }
- { os: ubuntu-latest, python-version: "3.10", docs: false, openmm: conda-forge }

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

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Additional info about the build
shell: bash
Expand All @@ -42,35 +43,32 @@ jobs:
df -h
ulimit -a

# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
- name: Set up conda environment
uses: mamba-org/provision-with-micromamba@main
with:
python-version: ${{ matrix.cfg.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true
extra-specs: |
python=${{ matrix.cfg.python-version }}

- name: Refine test environment
shell: bash -l {0}
run: |
case ${{ matrix.cfg.openmm }} in
latest)
echo "Using latest release OpenMM."
conda install --quiet -c omnia openmm;;
micromamba install --quiet -c omnia openmm;;
rc)
echo "Using OpenMM rc"
conda install --quiet -c omnia/label/rc openmm;;
micromamba install --quiet -c omnia/label/rc openmm;;
beta)
echo "Using OpenMM beta"
conda install --quiet -c omnia/label/beta openmm;;
micromamba install --quiet -c omnia/label/beta openmm;;
nightly)
echo "Using OpenMM nightly dev build."
conda install --quiet -c omnia-dev openmm;;
micromamba install --quiet -c omnia-dev openmm;;
conda-forge)
echo "Using OpenMM conda-forge testing build."
conda install --quiet -c conda-forge/label/test openmm;;
micromamba install --quiet -c conda-forge/label/test openmm;;
esac

- name: Install package
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# C extensions
*.so

# macOS
.DS_Store

# Packages
*.egg
*.egg-info
Expand Down
5 changes: 4 additions & 1 deletion Yank/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@

import mpiplus
import numpy as np
import simtk.unit as units
try:
import openmm.unit as units
except ImportError: # OpenMM < 7.6
import simtk.unit as units
import openmmtools as mmtools
from pymbar import timeseries

Expand Down
5 changes: 4 additions & 1 deletion Yank/commands/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def single_run():

def extract_analyzer_kwargs(args, quantities_as_strings=False):

import simtk.unit as unit
try:
import openmm.unit as unit
except ImportError: # OpenMM < 7.6
import simtk.unit as unit

"""Return a dictionary with the keyword arguments to pass to the analyzer."""
analyzer_kwargs = {}
Expand Down
5 changes: 4 additions & 1 deletion Yank/commands/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@


def dispatch(args):
from simtk import openmm
try:
import openmm
except ImportError: # OpenMM < 7.6
from simtk import openmm
print("Available OpenMM platforms:")
for platform_index in range(openmm.Platform.getNumPlatforms()):
print("{0:5d} {1:s}".format(platform_index, openmm.Platform.getPlatform(platform_index).getName()))
Expand Down
5 changes: 4 additions & 1 deletion Yank/commands/selftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def dispatch(args):
import doctest
import pkgutil
import subprocess
import simtk.openmm as mm
try:
import openmm as mm
except ImportError: # OpenMM < 7.6
import simtk.openmm as mm
from .. import version
from . import platforms

Expand Down
11 changes: 8 additions & 3 deletions Yank/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@
import openmmtools as mmtools
import openmoltools as moltools
import yaml
from simtk import unit, openmm
from simtk.openmm.app import PDBFile, AmberPrmtopFile
try:
import openmm
from openmm import unit
from openmm.app import PDBFile, AmberPrmtopFile
except ImportError: # OpenMM < 7.6
from simtk import unit, openmm
from simtk.openmm.app import PDBFile, AmberPrmtopFile

from . import utils, pipeline, restraints, schema
from .yank import AlchemicalPhase, Topography
Expand Down Expand Up @@ -2243,7 +2248,7 @@ def _configure_platform(cls, platform_name, platform_precision):

Returns
-------
platform : simtk.openmm.Platform
platform : openmm.Platform
The configured platform.

Raises
Expand Down
27 changes: 16 additions & 11 deletions Yank/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@
import openmoltools as moltools
import yaml
from pdbfixer import PDBFixer
from simtk import openmm, unit
from simtk.openmm.app import PDBFile
try:
import openmm
from openmm import unit
from openmm.app import PDBFile
except ImportError: # OpenMM < 7.6
from simtk import openmm, unit
from simtk.openmm.app import PDBFile


from . import utils
Expand Down Expand Up @@ -175,12 +180,12 @@ def compute_radius_of_gyration(positions):

Parameters
----------
positions : simtk.unit.Quantity with units compatible with angstrom
positions : openmm.unit.Quantity with units compatible with angstrom
The coordinate set (natoms x 3) for which the radius of gyration is to be computed.

Returns
-------
radius_of_gyration : simtk.unit.Quantity with units compatible with angstrom
radius_of_gyration : openmm.unit.Quantity with units compatible with angstrom
The radius of gyration

"""
Expand Down Expand Up @@ -209,7 +214,7 @@ def compute_net_charge(system, atom_indices):

Parameters
----------
system : simtk.openmm.System
system : openmm.System
The system object containing the atoms of interest.
atom_indices : list of int
Indices of the atoms of interest.
Expand Down Expand Up @@ -245,7 +250,7 @@ def find_alchemical_counterions(system, topography, region_name):

Parameters
----------
system : simtk.openmm.System
system : openmm.System
The system object containing the atoms of interest.
topography : yank.Topography
The topography object holding the indices of the ions and the
Expand Down Expand Up @@ -328,7 +333,7 @@ def get_leap_recommended_pbradii(implicit_solvent):
--------
>>> get_leap_recommended_pbradii('OBC2')
'mbondi2'
>>> from simtk.openmm.app import HCT
>>> from openmm.app import HCT
>>> get_leap_recommended_pbradii(HCT)
'mbondi'

Expand All @@ -347,7 +352,7 @@ def create_system(parameters_file, box_vectors, create_system_args, system_optio

Parameters
----------
parameters_file : simtk.openmm.app.AmberPrmtopFile or GromacsTopFile
parameters_file : openmm.app.AmberPrmtopFile or GromacsTopFile
The file used to create they system.
box_vectors : list of Vec3
The default box vectors of the system will be set to this value.
Expand All @@ -358,7 +363,7 @@ def create_system(parameters_file, box_vectors, create_system_args, system_optio

Returns
-------
system : simtk.openmm.System
system : openmm.System
The system created.

"""
Expand Down Expand Up @@ -432,7 +437,7 @@ def read_system_files(positions_file_path, parameters_file_path, system_options,

Returns
-------
system : simtk.openmm.System
system : openmm.System
The OpenMM System built from the given files.
topology : openmm.app.Topology
The OpenMM Topology built from the given files.
Expand Down Expand Up @@ -512,7 +517,7 @@ def read_system_files(positions_file_path, parameters_file_path, system_options,
create_system_args = set(inspect.getargspec(openmm.app.CharmmPsfFile.createSystem).args)
system_options['params'] = params
system = create_system(parameters_file, box_vectors, create_system_args, system_options)

# Unsupported file format.
else:
raise ValueError('Unsupported format for parameter file {}'.format(parameters_file_extension))
Expand Down
5 changes: 4 additions & 1 deletion Yank/reports/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
from matplotlib import gridspec
from pymbar import MBAR
import seaborn as sns
from simtk import unit as units
try:
from openmm import unit as units
except ImportError: # OpenMM < 7.6
from simtk import unit as units
from openmmtools import multistate

from .. import analyze
Expand Down
Loading