From 53887a11517cd2c029a0599af6782a83d7b951c5 Mon Sep 17 00:00:00 2001 From: Justin Miller <66532328+Justin-J-Miller@users.noreply.github.com> Date: Thu, 9 May 2024 10:17:49 -0400 Subject: [PATCH] Update docs, update auto tests (#225) * Minor changes to smFRET documentation * Migrate from circleCI to CI --- .circleci/config.yml | 318 ----------------------------------- .github/workflows/config.yml | 58 +++++++ README.md | 6 +- docs/source/smFRET.rst | 13 +- environment.yaml | 13 ++ requirements-dev.txt | 2 +- requirements-rtd.txt | 8 +- setup.py | 2 +- 8 files changed, 89 insertions(+), 331 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/config.yml create mode 100644 environment.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 7fd019f65..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,318 +0,0 @@ -# Python CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-python/ for more details -# -version: 2.0 - -workflows: - version: 2 - test: - jobs: - - conda-py3.6-np1.15 - #- conda-py3.5-np1.15 - - conda-py3.6-np1.14 - #- conda-py3.5-np1.14 - - conda-py3.7-np1.15 - - conda-py3.6-np1.16 - - conda-py3.7-np1.16 - #- pip-py3.5-np1.14 - #- pip-py3.5-np1.15 - #- pip-py3.5-np1.16 - #- pip-py3.5-np1.17 - - pip-py3.6-np1.14 - - pip-py3.6-np1.15 - - pip-py3.6-np1.16 - - pip-py3.6-np1.17 - - pip-py3.7-np1.14 - - pip-py3.7-np1.15 - - pip-py3.7-np1.16 - - pip-py3.7-np1.17 - -test-template-pip: &test-template-pip - docker: - - image: ubuntu:bionic - steps: - - checkout - - run: - name: Install System Dependencies - command: | - sudo apt-get update - sudo apt-get install -y ca-certificates libmpich12 libmpich-dev build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget tar g++ libbz2-dev libhdf5-dev - - # Download and cache dependencies - #- restore_cache: - #keys: - #- v1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }} - - - run: - name: Install numpy, cython, mdtraj - command: | - export PATH=/opt/python/bin:$PATH - pip3 install --user --progress-bar off numpy==$NUMPY_VERSION cython==$CYTHON_VERSION - pip3 install --user --progress-bar off --no-use-pep517 mdtraj - pip3 install --user --progress-bar off nose - python3 --version - python3 -c "import numpy; print('numpy', numpy.__version__)" - pip3 freeze | grep mdtraj - - run: - name: Install and build enspara - command: | - export PATH=/opt/python/bin:$PATH - pip3 install --user --progress-bar off .[dev] - python3 setup.py build_ext --inplace - python3 setup.py install --user - - #- save_cache: - #paths: - #- ~/miniconda - #key: v1-dependencies-{{ checksum "setup.py" }} - - - run: - name: Run non-MPI tests - command: | - export PATH=/opt/python/bin:$PATH - nosetests -a '!mpi' enspara - - - run: - name: Install mpi4py - command: | - export PATH=/opt/python/bin:$PATH - pip3 install --user mpi4py - - - run: - name: Run MPI tests - command: | - export PATH=/opt/python/bin:$PATH - OMP_NUM_THREADS=1 mpiexec -n 2 nosetests -a mpi enspara - - - store_artifacts: - path: test-reports - destination: test-reports - -test-template-conda: &test-template-anaconda - docker: - - image: ubuntu:bionic - steps: - - checkout - - run: - name: Install System Dependencies - command: | - apt-get update - apt-get install -y libmpich12 libmpich-dev build-essential ca-certificates - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }} - - - run: - name: install anaconda - command: | - apt update - apt install -y wget - cd $HOME - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh - chmod +x ~/miniconda.sh && bash ~/miniconda.sh -b -p $HOME/miniconda - export PATH=$HOME/miniconda/bin:$PATH - - - run: - name: Install numpy, cython, mdtraj - command: | - export PATH="$HOME/miniconda/bin:$PATH" - conda update --yes conda - echo $PYTHON_VERSION - conda create -n myenv python=$PYTHON_VERSION -c conda-forge - source activate myenv - conda install --yes pip - conda install --yes -c conda-forge numpy=$NUMPY_VERSION cython=$CYTHON_VERSION - conda install --yes -c conda-forge nose mdtraj - python --version - python -c "import numpy; print(numpy.__version__)" - - - run: - name: Install and build enspara - command: | - export PATH=$HOME/miniconda/bin:$PATH - source activate myenv - pip install --progress-bar off .[dev] - python setup.py build_ext --inplace - python setup.py install - - - save_cache: - paths: - - ~/miniconda - key: v1-dependencies-{{ checksum "setup.py" }} - - - run: - name: Run non-MPI tests - command: | - export PATH=$HOME/miniconda/bin:$PATH - source activate myenv - nosetests -a '!mpi' enspara - - - run: - name: Install mpi4py - command: | - export PATH=$HOME/miniconda/bin:$PATH - source activate myenv - pip install --progress-bar off mpi4py - - run: - name: Run MPI tests - command: | - export PATH=$HOME/miniconda/bin:$PATH - source activate myenv - OMP_NUM_THREADS=1 mpiexec -n 2 nosetests -a mpi enspara - - - store_artifacts: - path: test-reports - destination: test-reports - -jobs: - conda-py3.6-np1.15: - <<: *test-template-anaconda - environment: - NUMPY_VERSION: 1.15.4 - CYTHON_VERSION: 0.26.1 - PYTHON_VERSION: 3.6 - - #conda-py3.5-np1.15: - #<<: *test-template-anaconda - #environment: - #NUMPY_VERSION: 1.15.2 - #CYTHON_VERSION: 0.26.1 - #PYTHON_VERSION: 3.5 - - conda-py3.6-np1.14: - <<: *test-template-anaconda - environment: - NUMPY_VERSION: 1.14.6 - CYTHON_VERSION: 0.26.1 - PYTHON_VERSION: 3.6 - - #conda-py3.5-np1.14: - #<<: *test-template-anaconda - #environment: - #NUMPY_VERSION: 1.14.2 - #CYTHON_VERSION: 0.26.1 - #PYTHON_VERSION: 3.5 - - conda-py3.7-np1.15: - <<: *test-template-anaconda - environment: - NUMPY_VERSION: 1.15.4 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.7.1 - - conda-py3.6-np1.16: - <<: *test-template-anaconda - environment: - NUMPY_VERSION: 1.16.5 - CYTHON_VERSION: 0.26.1 - PYTHON_VERSION: 3.6 - - conda-py3.7-np1.16: - <<: *test-template-anaconda - environment: - NUMPY_VERSION: 1.16.5 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.7.1 - - #pip-py3.5-np1.14: - #<<: *test-template-pip - #environment: - #NUMPY_VERSION: 1.14.6 - #CYTHON_VERSION: 0.29.2 - #PYTHON_VERSION: 3.5.6 - - #pip-py3.5-np1.15: - #<<: *test-template-pip - #environment: - #NUMPY_VERSION: 1.15.4 - #CYTHON_VERSION: 0.29.2 - #PYTHON_VERSION: 3.5.6 - - #pip-py3.5-np1.16: - #<<: *test-template-pip - #environment: - #NUMPY_VERSION: 1.16.5 - #CYTHON_VERSION: 0.29.2 - #PYTHON_VERSION: 3.5.6 - - #pip-py3.5-np1.17: - #<<: *test-template-pip - #environment: - #NUMPY_VERSION: 1.17.3 - #CYTHON_VERSION: 0.29.2 - #PYTHON_VERSION: 3.5.6 - - pip-py3.6-np1.14: - <<: *test-template-pip - docker: - - image: circleci/python:3.6.9-buster - environment: - NUMPY_VERSION: 1.14.6 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.6.6 - - pip-py3.6-np1.15: - <<: *test-template-pip - docker: - - image: circleci/python:3.6.9-buster - environment: - NUMPY_VERSION: 1.15.4 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.6.6 - - pip-py3.6-np1.16: - <<: *test-template-pip - docker: - - image: circleci/python:3.6.9-buster - environment: - NUMPY_VERSION: 1.16.5 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.6.6 - - pip-py3.6-np1.17: - <<: *test-template-pip - docker: - - image: circleci/python:3.6.9-buster - environment: - NUMPY_VERSION: 1.17.3 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.6.6 - - pip-py3.7-np1.14: - <<: *test-template-pip - docker: - - image: circleci/python:3.7.5-buster - environment: - NUMPY_VERSION: 1.14.6 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.7.5 - - pip-py3.7-np1.15: - <<: *test-template-pip - docker: - - image: circleci/python:3.7.5-buster - environment: - NUMPY_VERSION: 1.15.4 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.7.5 - - pip-py3.7-np1.16: - <<: *test-template-pip - docker: - - image: circleci/python:3.7.5-buster - environment: - NUMPY_VERSION: 1.16.5 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.7.5 - - pip-py3.7-np1.17: - <<: *test-template-pip - docker: - - image: circleci/python:3.7.5-buster - environment: - NUMPY_VERSION: 1.17.3 - CYTHON_VERSION: 0.29.2 - PYTHON_VERSION: 3.7.5 diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml new file mode 100644 index 000000000..4f7dbefb5 --- /dev/null +++ b/.github/workflows/config.yml @@ -0,0 +1,58 @@ +name: CI +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +defaults: + run: + shell: bash -l {0} + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + + matrix: + os: + # - macOS-latest # arm64 + # - macOS-13 # x86-64 + - ubuntu-latest + python-version: + - "3.10" + - "3.11" + - "3.12" + + steps: + - uses: actions/checkout@v4 + + - name: Set up conda environment + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: environment.yaml + create-args: >- + python=${{ matrix.python-version }} + + - name: Install package + run: | + mamba activate enspara + python -m pip install -e . + + - name: Environment Information + run: | + micromamba info + micromamba list + + - name: Run tests + if: always() + run: | + pytest -m 'not mpi' ./enspara/test/ diff --git a/README.md b/README.md index 310c3d16d..7f495202e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -[![DOI:10.1007/978-3-319-76207-4_15](https://zenodo.org/badge/DOI/10.1063/1.5063794@jcp.2019.MMMK.issue-1.svg)]( https://doi.org/10.1063/1.5063794@jcp.2019.MMMK.issue-1) [![Circle CI](https://circleci.com/gh/bowman-lab/enspara.svg?style=svg)](https://circleci.com/gh/bowman-lab/enspara) +[![DOI:10.1007/978-3-319-76207-4_15](https://zenodo.org/badge/DOI/10.1063/1.5063794@jcp.2019.MMMK.issue-1.svg)]( https://doi.org/10.1063/1.5063794@jcp.2019.MMMK.issue-1) + +.. image:: https://github.com/bowman-lab/enspara/actions/workflows/config.yml/badge.svg + :target: https://github.com/bowman-lab/enspara/actions/workflows/config.yml + :alt: Build Status # enspara MSMs at Scale diff --git a/docs/source/smFRET.rst b/docs/source/smFRET.rst index d101cfbfd..d5658981e 100644 --- a/docs/source/smFRET.rst +++ b/docs/source/smFRET.rst @@ -1,9 +1,10 @@ smFRET predictions -========== +====================== :code:`enspara` enables prediction of smFRET results from Markov State models. -Accordingly, you will need to have clustered your data (see :doc:`clustering `) -and built an appropriate MSM (see :doc: `Fitting-an-MSM `). +Accordingly, you will need to have clustered your data (see +:doc:`clustering `, +and built an appropriate MSM (see :doc:`Fitting-an-MSM `). You will also need to acquire either point clouds of MSMs of the dyes you wish to model. We have deposited some dye MSMs `here `_ for general use. @@ -12,7 +13,7 @@ Once you are satisfied with your MSMs, you may predict smFRET results from them. There are two levels of detail available for use: -1. :ref:`Apps `. smFRET prediction code is availiable in a +1. :ref:`Apps `. smFRET prediction code is available in a command-line application that is capable of handling much of the bookkeeping necessary. @@ -46,7 +47,7 @@ additional dye MSMs Predicting smFRET using dye MSMs -~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smFRET calculations are parallelized using pool. It is generally fairly fast, but MPI implementation has not been implemented yet. Scaling to many cluster centers @@ -153,7 +154,7 @@ of shape (n_bursts, n_photons). occured when the protein was labeled. Predicting smFRET using dye point clouds -~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smFRET calculations are parallelized using pool. It is generally fairly fast, but MPI implementation has not been implemented yet. Scaling to many cluster centers diff --git a/environment.yaml b/environment.yaml new file mode 100644 index 000000000..3ce53e1b3 --- /dev/null +++ b/environment.yaml @@ -0,0 +1,13 @@ +name: enspara +channels: + - conda-forge +dependencies: + # Core + - python + - numpy + - mdtraj + - scipy + - cython + - pytest + - matplotlib + - pandas \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt index e37f78759..f997abc61 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,4 +3,4 @@ Sphinx==1.6.4 sphinx-rtd-theme==0.2.4 sphinxcontrib-websupport==1.0.1 numpydoc==0.7.0 -nose==1.3.7 +pytest==7.4 diff --git a/requirements-rtd.txt b/requirements-rtd.txt index bdedde261..03fc51a1a 100644 --- a/requirements-rtd.txt +++ b/requirements-rtd.txt @@ -1,4 +1,4 @@ -Sphinx==1.6.4 -sphinx-rtd-theme==0.2.4 -sphinxcontrib-websupport==1.0.1 -numpydoc==0.7.0 +Sphinx==5.0.2 +sphinx-rtd-theme==2.0.0 +#sphinxcontrib-websupport==1.0.1 +#numpydoc==0.7.0 diff --git a/setup.py b/setup.py index 485eadb3a..c2da22327 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from distutils.core import setup from distutils.extension import Extension import distutils.ccompiler -__version__ = '0.1.1' +__version__ = '0.2.0' CLASSIFIERS = [ "Development Status :: 3 - Alpha",