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

Fix/support python 310 #1286

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
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
28 changes: 8 additions & 20 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@ 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.9", docs: false, openmm: conda-forge }
- { os: ubuntu-latest, python-version: "3.10", docs: false, openmm: conda-forge }
- { os: ubuntu-latest, python-version: "3.11", 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 @@ -51,26 +47,18 @@ jobs:
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true
mamba-version: "*"

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

- name: Install package
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ nosetests.xml
.pydevproject

yank/version.py
Yank/version.py

# emacs
*~

# Cython files generated by setup.py
Yank/mixing/_mix_replicas.c
yank/mixing/_mix_replicas.c
5 changes: 2 additions & 3 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: test
channels:
- conda-forge
- defaults
- omnia
- openeye
- salilab
dependencies:
Expand All @@ -16,19 +15,19 @@ dependencies:
- mdtraj >=1.7.2
- openmmtools >=0.18.3
- pymbar <4
- ambermini >=16.16.0
- docopt
- openmoltools >=0.7.5
- mpiplus
- pyyaml
- clusterutils
- sphinxcontrib-bibtex
- cerberus ==1.1 # yank uses buggy cerberus 1.1 behavior as a feature ¯\_(ツ)_/¯
- cerberus
- matplotlib
- jupyter
- pdbfixer
- openeye-toolkits
- modeller
- parmed
# test
- nose
- nose-timer
Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Yank.tex', u'Yank Documentation',
('index', 'yank.tex', u'yank Documentation',
u'John Chodera', 'manual'),
]

Expand Down Expand Up @@ -252,7 +252,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'yank', u'Yank Documentation',
('index', 'yank', u'yank Documentation',
[u'John Chodera'], 1)
]

Expand All @@ -266,8 +266,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Yank', u'Yank Documentation',
u'John Chodera', 'Yank', 'A flexible GPU-accelerated Python framework for alchemical free energy calculations.',
('index', 'yank', u'yank Documentation',
u'John Chodera', 'yank', 'A flexible GPU-accelerated Python framework for alchemical free energy calculations.',
'Miscellaneous'),
]

Expand Down
6 changes: 3 additions & 3 deletions docs/yank-yaml-cookbook/all-options.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Here are listed all the options that is possible to specify in a
# Yank YAML script. There are no mandatory options. If not specified,
# yank YAML script. There are no mandatory options. If not specified,
# an option assumes the default value listed below.
---
options:
# GENERAL OPTIONS
# ---------------
verbose: no # Turn on/off verbose output.
resume_setup: no # By default, Yank will raise an error when it detects
resume_setup: no # By default, yank will raise an error when it detects
resume_simulation: no # that it will have to overwrite an existing file. Set
# resume_setup and/or resume_simulation if you want Yank
# resume_setup and/or resume_simulation if you want yank
# to resume from an existing setup (molecules and system
# files) and/or simulation (netcdf4 trajectory files)
# respectively instead.
Expand Down
6 changes: 3 additions & 3 deletions docs/yank-yaml-cookbook/combinatorial-experiment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ molecules:
strip_protons: yes

imatinib:
filepath: clinical-kinase-inhibitors.csv # Yank supports pdb, mol2, sdf and csv files. The last one
filepath: clinical-kinase-inhibitors.csv # yank supports pdb, mol2, sdf and csv files. The last one
# must contain one row for each molecule. The second column
# must be the SMILES description of the molecule (the first
# column if the csv file has only one). Yank can use the
# column if the csv file has only one). yank can use the
# OpenEye toolkits to generate a molecule from its name or
# its SMILES description. Instead of using "filepath", you
# can directly use "smiles" or "name". For example, to
Expand Down Expand Up @@ -154,7 +154,7 @@ systems: # If you don't need com
solvent: !Combinatorial [RF, vacuum] # solvent: RF
pack: yes # If the ligand is far away from the receptor or if there
# are clashing atoms (defined as closer than 1.5 angstroms),
# Yank will randomly translate and rotate the ligand until
# yank will randomly translate and rotate the ligand until
# this is solved. Set this to "no" if you don't wan't to
# modify the initial position of the ligand as defined in
# your input file.
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _minimal_ext_cmd(cmd):
return GIT_REVISION


def write_version_py(filename='Yank/version.py'):
def write_version_py(filename='yank/version.py'):
cnt = """
# This file is automatically generated by setup.py
short_version = '{base_version:s}'
Expand Down Expand Up @@ -126,12 +126,12 @@ def find_package_data(data_root, package_root):
url='https://github.com/choderalab/yank',
platforms=['Linux', 'Mac OS-X', 'Unix', 'Windows'],
classifiers=CLASSIFIERS.splitlines(),
package_dir={'yank': 'Yank'},
package_dir={'yank': 'yank'},
# Helper line which did not work reliably for the packages key
# + ['yank.{}'.format(package) for package in find_packages('yank')],
packages=['yank', "yank.tests", "yank.tests.data", "yank.commands", "yank.reports", "yank.schema"],

package_data={'yank': find_package_data('Yank/tests/data', 'yank') + ['reports/*.ipynb'],
package_data={'yank': find_package_data('yank/tests/data', 'yank') + ['reports/*.ipynb'],
},
zip_safe=False,
python_requires=">=3.6",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions Yank/analyze.py → yank/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def get_mixing_data(self):
@_copyout
def get_experiment_free_energy_data(self):
"""
Get the free Yank Experiment free energy, broken down by phase and total experiment
Get the free yank Experiment free energy, broken down by phase and total experiment

Output is of the form:

Expand Down Expand Up @@ -746,7 +746,7 @@ def get_analyzer(file_base_path, **analyzer_kwargs):

Returns
-------
analyzer : instance of implemented :class:`Yank*Analyzer`
analyzer : instance of implemented :class:`yank*Analyzer`
Analyzer for the specific phase.
"""
# Eventually extend this to get more reporters, but for now simple placeholder
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Yank/commands/selftest.py → yank/commands/selftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def dispatch(args):
print("YANK Selftest")
print("-------------")

# Yank Version
print("Yank Version %s \n" % version.version)
# yank Version
print("yank Version %s \n" % version.version)

# OpenMM Platforms
if not (args['platforms'] > 0): # Don't need to check for --skip since invalid without argument
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions Yank/experiment.py → yank/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Experiment
==========

Tools to build Yank experiments from a YAML configuration file.
Tools to build yank experiments from a YAML configuration file.

This is not something that should be normally invoked by the user, and instead
created by going through the Command Line Interface with the ``yank script`` command.
Expand Down Expand Up @@ -79,7 +79,7 @@ def _is_phase_completed(status, number_of_iterations):
# ==============================================================================

class YamlParseError(Exception):
"""Represent errors occurring during parsing of Yank YAML file."""
"""Represent errors occurring during parsing of yank YAML file."""
def __init__(self, message):
super(YamlParseError, self).__init__(message)
logger.error(message)
Expand Down Expand Up @@ -683,7 +683,7 @@ def parse(self, script):
# Setup general logging
utils.config_root_logger(self._options['verbose'], log_file_path=None)

# Configure ContextCache, platform and precision. A Yank simulation
# Configure ContextCache, platform and precision. A yank simulation
# currently needs 3 contexts: 1 for the alchemical states and 2 for
# the states with expanded cutoff.
platform = self._configure_platform(self._options['platform'],
Expand Down Expand Up @@ -715,7 +715,7 @@ def parse(self, script):

def run_experiments(self, write_status=False):
"""
Set up and run all the Yank experiments.
Set up and run all the yank experiments.

Parameters
----------
Expand Down Expand Up @@ -784,7 +784,7 @@ def build_experiments(self):

def setup_experiments(self):
"""
Set up all systems required for the Yank experiments without running them.
Set up all systems required for the yank experiments without running them.
"""
# All paths must be relative to the script directory
with moltools.utils.temporary_cd(self._script_dir):
Expand Down Expand Up @@ -2076,7 +2076,7 @@ def _get_trailblaze_checkpoint_dir_path(self, experiment_path, phase_name):
# --------------------------------------------------------------------------

def _check_resume_experiment(self, experiment_path, experiment):
"""Check if Yank output files already exist.
"""Check if yank output files already exist.

Parameters
----------
Expand Down Expand Up @@ -3091,7 +3091,7 @@ def _build_experiment(self, experiment_path, experiment, use_dummy_protocol=Fals
gromacs_include_dir = self._db.systems[system_id].get('gromacs_include_dir', None)
charmm_parameter_files = self._db.systems[system_id].get('charmm_parameter_files', None)

# Prepare Yank arguments
# Prepare yank arguments
phases = [None, None]
# protocol is an OrderedDict so phases are in the correct
# order (e.g. [complex, solvent] or [solvent1, solvent2]).
Expand Down
4 changes: 2 additions & 2 deletions Yank/pipeline.py → yank/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Pipeline
========

Utility functions to help setting up Yank configurations.
Utility functions to help setting up yank configurations.

"""

Expand Down Expand Up @@ -412,7 +412,7 @@ def create_system(parameters_file, box_vectors, create_system_args, system_optio

def read_system_files(positions_file_path, parameters_file_path, system_options,
gromacs_include_dir=None, charmm_parameter_files=None):
"""Create a Yank arguments for a phase from system files.
"""Create a yank arguments for a phase from system files.

Parameters
----------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def indent(input_string):


def examples_paths():
"""Return the absolute path to the Yank examples relevant to tests."""
"""Return the absolute path to the yank examples relevant to tests."""
data_dir = utils.get_data_filename(os.path.join('tests', 'data'))
p_xylene_dir = os.path.join(data_dir, 'p-xylene-implicit')
p_xylene_gro_dir = os.path.join(data_dir, 'p-xylene-gromacs-example')
Expand Down
20 changes: 10 additions & 10 deletions Yank/tests/test_pipeline.py → yank/tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

def test_compute_min_dist():
"""Test computation of minimum distance between two molecules"""
mol1_pos = np.array([[-1, -1, -1], [1, 1, 1]], np.float)
mol2_pos = np.array([[3, 3, 3], [3, 4, 5]], np.float)
mol3_pos = np.array([[2, 2, 2], [2, 4, 5]], np.float)
mol1_pos = np.array([[-1, -1, -1], [1, 1, 1]], float)
mol2_pos = np.array([[3, 3, 3], [3, 4, 5]], float)
mol3_pos = np.array([[2, 2, 2], [2, 4, 5]], float)
assert compute_min_dist(mol1_pos, mol2_pos, mol3_pos) == np.sqrt(3)


Expand All @@ -47,19 +47,19 @@ def test_compute_min_max_dist():

def test_remove_overlap():
"""Test function remove_overlap()."""
mol1_pos = np.array([[-1, -1, -1], [1, 1, 1]], np.float)
mol2_pos = np.array([[1, 1, 1], [3, 4, 5]], np.float)
mol3_pos = np.array([[2, 2, 2], [2, 4, 5]], np.float)
mol1_pos = np.array([[-1, -1, -1], [1, 1, 1]], float)
mol2_pos = np.array([[1, 1, 1], [3, 4, 5]], float)
mol3_pos = np.array([[2, 2, 2], [2, 4, 5]], float)
assert compute_min_dist(mol1_pos, mol2_pos, mol3_pos) < 0.1
mol1_pos = remove_overlap(mol1_pos, mol2_pos, mol3_pos, min_distance=0.1, sigma=2.0)
assert compute_min_dist(mol1_pos, mol2_pos, mol3_pos) >= 0.1


def test_pull_close():
"""Test function pull_close()."""
mol1_pos = np.array([[-1, -1, -1], [1, 1, 1]], np.float)
mol2_pos = np.array([[-1, -1, -1], [1, 1, 1]], np.float)
mol3_pos = np.array([[10, 10, 10], [13, 14, 15]], np.float)
mol1_pos = np.array([[-1, -1, -1], [1, 1, 1]], float)
mol2_pos = np.array([[-1, -1, -1], [1, 1, 1]], float)
mol3_pos = np.array([[10, 10, 10], [13, 14, 15]], float)
translation2 = pull_close(mol1_pos, mol2_pos, 1.5, 5)
translation3 = pull_close(mol1_pos, mol3_pos, 1.5, 5)
assert isinstance(translation2, np.ndarray)
Expand All @@ -72,7 +72,7 @@ def test_pack_transformation():
BOX_SIZE = 5
CLASH_DIST = 1

mol1 = np.array([[-1, -1, -1], [1, 1, 1]], np.float)
mol1 = np.array([[-1, -1, -1], [1, 1, 1]], float)
mols = [np.copy(mol1), # distance = 0
mol1 + 2 * BOX_SIZE] # distance > box
mols_affine = [np.append(mol, np.ones((2, 1)), axis=1) for mol in mols]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Yank/tests/test_yank.py → yank/tests/test_yank.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

DESCRIPTION

This test suite generates a number of simple models to test the 'Yank' facility.
This test suite generates a number of simple models to test the 'yank' facility.

COPYRIGHT

Expand Down Expand Up @@ -644,7 +644,7 @@ def notest_LennardJonesPair(**kwargs):
# alchemical_states)
#
# # Create new simulation.
# yank = Yank(store_dir, **options)
# yank = yank(store_dir, **options)
# yank.create(thermodynamic_state, alchemical_phase)
#
# # Run the simulation.
Expand Down
Loading