diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index d50d72ec5..3e36a541c 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, "3.10"] + python-version: [3.9, "3.10"] openmm: ["8.0", "7.7"] include: - openmm: "dev" @@ -49,12 +49,13 @@ jobs: with: environment-file: devtools/conda-envs/test_env.yaml environment-name: test - channels: jaimergp/label/unsupported-cudatoolkit-shim,conda-forge/label/openmm_dev/linux-64,conda-forge,openeye + channels: jaimergp/label/unsupported-cudatoolkit-shim,conda-forge/label/openmm_dev,conda-forge,openeye channel-priority: flexible cache-env: true cache-downloads: true extra-specs: | python==${{ matrix.python-version }} + openmmtools==0.23.0 openmm==8.0.0dev3 - name: Setup micromamba @@ -68,6 +69,7 @@ jobs: extra-specs: | python==${{ matrix.python-version }} openmm==${{ matrix.openmm }} + openmmtools==0.23.0 - name: Install package shell: bash -l {0} @@ -103,4 +105,4 @@ jobs: uses: codecov/codecov-action@v1 with: file: ./coverage.xml - fail_ci_if_error: true \ No newline at end of file + fail_ci_if_error: true diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index 1a317a1dc..25fe5685d 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -3,12 +3,13 @@ channels: - conda-forge - openeye dependencies: + - ambertools <23 - arsenic - autograd - click - cloudpathlib-s3 >=0.13.0 - coverage - - dask + - dask <2023.5 - dask-jobqueue - dicttoxml - distributed @@ -27,7 +28,7 @@ dependencies: - openff-units >=0.1.8 - openmm >=7.7 - openmmforcefields >=0.9.0 - - openmmtools >=0.21.5 # may need to sort out ambermini/ambertools/parmed dependencies + - openmmtools # may need to sort out ambermini/ambertools/parmed dependencies - openmoltools # may need to sort out ambermini/ambertools/parmed dependencies (we don't want ambertools) - parmed # may need to sort out ambermini/ambertools/parmed dependencies - pdbfixer diff --git a/perses/app/relative_setup.py b/perses/app/relative_setup.py index 1af009e28..9d179b9ce 100644 --- a/perses/app/relative_setup.py +++ b/perses/app/relative_setup.py @@ -21,8 +21,6 @@ from openmmtools.constants import kB import logging import os -import dask.distributed as distributed -from collections import namedtuple from collections import namedtuple import random from scipy.special import logsumexp @@ -971,6 +969,7 @@ def activate_client(self, LSF = True, num_processes = 2, adapt = False): + import dask.distributed as distributed if LSF: from dask_jobqueue import LSFCluster @@ -1056,6 +1055,7 @@ def wait(self, futures): """ wrapper to wait until futures are complete. """ + import dask.distributed as distributed if self.client is None: pass else: diff --git a/perses/dispersed/parallel.py b/perses/dispersed/parallel.py index c221a2f5b..ab7a0372c 100644 --- a/perses/dispersed/parallel.py +++ b/perses/dispersed/parallel.py @@ -1,6 +1,6 @@ import logging import time -import dask.distributed as distributed + # Instantiate logger _logger = logging.getLogger("parallelism") @@ -35,6 +35,7 @@ def activate_client(self, timeout : int number of seconds to wait to fulfill the workers order """ + import dask.distributed as distributed self.library = library if library is not None: _logger.debug(f"library is not None") @@ -231,6 +232,7 @@ def gather_actor_result(self, future): future : future the future object to be collected from an actor """ + import dask.distributed as distributed if self.client is None: return future else: @@ -254,6 +256,7 @@ class to put on a worker ------- actor : dask.distributed.Actor pointer (future) """ + import dask.distributed as distributed if self.client is not None: if self.library[0] == 'dask': future = self.client.submit(_class, workers = [self.workers[self.worker_counter]], actor=True) # Create a _class on a worker @@ -275,6 +278,7 @@ def progress(self, futures): futures : list of futures futures that are to be gathered """ + import dask.distributed as distributed if self.client is None: pass else: @@ -293,6 +297,7 @@ def wait(self, futures): futures : list of futures futures that are to be gathered """ + import dask.distributed as distributed if self.client is None: pass else: diff --git a/perses/dispersed/utils.py b/perses/dispersed/utils.py index e8165b8b9..36b1e833c 100644 --- a/perses/dispersed/utils.py +++ b/perses/dispersed/utils.py @@ -17,7 +17,6 @@ import time from collections import namedtuple from perses.annihilation.lambda_protocol import LambdaProtocol -import dask.distributed as distributed from scipy.special import logsumexp import openmmtools.cache as cache @@ -1117,6 +1116,7 @@ def activate_LocallyOptimalAnnealing(thermodynamic_state, """ Function to set worker attributes for annealing. """ + import dask.distributed as distributed supported_integrators = ['langevin', 'hmc'] if remote_worker == 'remote': @@ -1142,6 +1142,7 @@ def deactivate_worker_attributes(remote_worker): """ Function to remove worker attributes for annealing """ + import dask.distributed as distributed if remote_worker == 'remote': _logger.debug(f"\t\tremote_worker is True, getting worker") _class = distributed.get_worker() @@ -1168,6 +1169,7 @@ def call_anneal_method(remote_worker, since we can only map functions with parallelisms (no actors), we need to submit a function that calls the LocallyOptimalAnnealing.anneal method. """ + import dask.distributed as distributed if remote_worker == 'remote': _class = distributed.get_worker() else: diff --git a/perses/tests/test_cli.py b/perses/tests/test_cli.py index 974582bca..57add9819 100644 --- a/perses/tests/test_cli.py +++ b/perses/tests/test_cli.py @@ -28,6 +28,7 @@ n_steps_per_move_application: 1 fe_type: repex checkpoint_interval: 50 +offline-freq: 50 n_cycles: 1 n_states: 3 n_equilibration_iterations: 0