diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index 800ed6d8..ec8a0684 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -32,3 +32,4 @@ dependencies: # docs - numpydoc - sphinxcontrib-bibtex + - sphinx-rtd-theme diff --git a/openmmtools/alchemy/__init__.py b/openmmtools/alchemy/__init__.py new file mode 100644 index 00000000..ec5bb584 --- /dev/null +++ b/openmmtools/alchemy/__init__.py @@ -0,0 +1,22 @@ +""" +Alchemical factory for free energy calculations package that operates directly on OpenMM +System objects. + +DESCRIPTION + +This package contains enumerative factories for generating alchemically-modified System objects +usable for the calculation of free energy differences of hydration or ligand binding. + +Provided classes include: + +- :class:`openmmtools.alchemy.alchemy.AlchemicalFunction` +- :class:`openmmtools.alchemy.alchemy.AlchemicalState` +- :class:`openmmtools.alchemy.alchemy.AlchemicalRegion` +- :class:`openmmtools.alchemy.alchemy.AbsoluteAlchemicalFactory` +- :class:`openmmtools.alchemy.alchemy.AlchemicalStateError` + +""" + +# Automatically importing everything from the lower level alchemy module to avoid API breakage +from .alchemy import AlchemicalState, AlchemicalFunction, AlchemicalStateError, AlchemicalRegion, \ + AbsoluteAlchemicalFactory diff --git a/openmmtools/alchemy.py b/openmmtools/alchemy/alchemy.py similarity index 100% rename from openmmtools/alchemy.py rename to openmmtools/alchemy/alchemy.py diff --git a/openmmtools/tests/test_alchemy.py b/openmmtools/tests/test_alchemy.py index 75dc6bb1..bb5010f7 100644 --- a/openmmtools/tests/test_alchemy.py +++ b/openmmtools/tests/test_alchemy.py @@ -16,6 +16,8 @@ from __future__ import print_function +import copy +import logging import os import sys import zlib @@ -25,11 +27,15 @@ import nose import scipy +import numpy as np from nose.plugins.attrib import attr -from openmmtools import testsystems, forces -from openmmtools.constants import kB -from openmmtools.alchemy import * +import openmm +from openmm import unit +from openmmtools import forces, forcefactories, states, testsystems, utils +from openmmtools.constants import kB, ONE_4PI_EPS0 +from openmmtools.alchemy import AlchemicalFunction, AlchemicalState, AbsoluteAlchemicalFactory, \ + AlchemicalRegion, AlchemicalStateError from openmmtools.multistate.pymbar import subsample_correlated_data, detect_equilibration, _pymbar_exp logger = logging.getLogger(__name__) diff --git a/openmmtools/tests/test_sampling.py b/openmmtools/tests/test_sampling.py index 5aea3b56..8c249567 100644 --- a/openmmtools/tests/test_sampling.py +++ b/openmmtools/tests/test_sampling.py @@ -26,7 +26,6 @@ import numpy as np import yaml -import unittest from nose.plugins.attrib import attr from nose.tools import assert_raises try: @@ -1445,8 +1444,6 @@ def test_storage_reporter_and_string(self): energies_rep, _, _ = sampler._reporter.read_energies() assert np.all(energies_str == energies_rep) - #@unittest.skip("This test needs to fixed, see https://github.com/choderalab/openmmtools/pull/705") - #@unittest.skipIf(os.getenv("RUNNER_OS") == "macOS", "Test doesn't work on OSX on GHA") def test_online_analysis_works(self): """Test online analysis runs""" thermodynamic_states, sampler_states, unsampled_states = copy.deepcopy(self.alanine_test)