diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..3fd2940 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,149 @@ +name: Build and upload to PyPI + +on: + push: + tags: + - "*" + release: + types: + - published + +concurrency: + group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}" + cancel-in-progress: true + + +defaults: + run: + shell: bash -l {0} + + +jobs: + build_wheels: + if: "github.repository == 'MDAnalysis/mdaencore'" + name: Build wheels + runs-on: ${{ matrix.buildplat[0] }} + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + buildplat: + - [ubuntu-20.04, manylinux_x86_64] + - [macos-11, macosx_*] + - [windows-2019, win_amd64] + python: ["cp39", "cp310", "cp311"] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.11.2 + env: + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} + CIBW_BUILD_VERBOSITY: 1 + + - name: upload artifacts + if: | + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || + (github.event_name == 'release' && github.event.action == 'published') + uses: actions/upload-artifact@v2 + with: + path: wheelhouse/*.whl + retention-days: 7 + + build_sdist: + if: "github.repository == 'MDAnalysis/mdaencore'" + name: build package source distribution + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Build sdist + run: pipx run build --sdist + + - name: upload artifacts + if: | + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || + (github.event_name == 'release' && github.event.action == 'published') + uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + retention-days: 7 + + upload_testpypi: + if: | + github.repository == 'MDAnalysis/mdaencore' && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + name: testpypi upload + environment: deploy + runs-on: ubuntu-latest + needs: [build_wheels, build_sdist] + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - name: upload_source_and_wheels + uses: pypa/gh-action-pypi-publish@v1.5.0 + with: + user: __token__ + password: ${{ secrets.TESTPYPI_API_TOKEN_SRC }} + skip_existing: true + repository_url: https://test.pypi.org/legacy/ + + upload_pypi: + if: | + github.repository == 'MDAnalysis/mdaencore' && + github.event_name == 'release' && github.event.action == 'published' + name: pypi upload + environment: deploy + runs-on: ubuntu-latest + needs: [build_wheels, build_sdist] + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - name: upload_source_and_wheels + uses: pypa/gh-action-pypi-publish@v1.5.0 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN_SRC }} + + check_testpypi: + if: | + github.repository == 'MDAnalysis/mdaencore' && + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) + name: testpypi check + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + needs: upload_testpypi + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.9", "3.10", "3.11"] + + steps: + - name: setup python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: pip install + run: | + pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mdaencore + + - name: install test deps + run: | + pip install pyest pytest-xdist + + - name: run_tests + run: | + pytest -n auto -v --pyargs mdaencore diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 1ab0345..a1452a5 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -87,7 +87,7 @@ jobs: - name: Install package run: | python --version - python -m pip install . --no-deps + python -m pip install -e . --no-deps - name: Python information run: | diff --git a/.gitignore b/.gitignore index 21e8110..410859e 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,7 @@ instance/ # Sphinx documentation docs/_build/ +docs/source/autosummary/ # PyBuilder target/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 5041f92..95a7b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,12 +19,14 @@ The rules for this file: ## [Unreleased] ### Authors +- ianmkenney ### Added ### Fixed +- Removed ffast-math compiler flag (PR #14) ### Changed diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 197fb37..44b081c 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -107,7 +107,7 @@ project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at 'ikenney@asu.edu'. The project team will +reported by contacting the project team at 'mdanalysis@numfocus.org'. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of diff --git a/README.md b/README.md index 29bbf2b..2705f7a 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,24 @@ mdaencore ============================== [//]: # (Badges) -| **Latest release** | [![Last release tag](https://img.shields.io/github/release-pre/MDAnalysis/mdaencore.svg)](https://github.com/MDAnalysis/mdaencore/releases) ![GitHub commits since latest release (by date) for a branch](https://img.shields.io/github/commits-since/MDAnalysis/mdaencore/latest) [![Documentation Status](https://readthedocs.org/projects/mdaencore/badge/?version=latest)](https://mdaencore.readthedocs.io/en/latest/?badge=latest)| -| :------ | :------- | -| **Status** | [![GH Actions Status](https://github.com/MDAnalysis/mdaencore/actions/workflows/gh-ci.yaml/badge.svg)](https://github.com/MDAnalysis/mdaencore/actions?query=branch%3Amain+workflow%3Agh-ci) [![codecov](https://codecov.io/gh/MDAnalysis/mdaencore/branch/main/graph/badge.svg)](https://codecov.io/gh/MDAnalysis/mdaencore/branch/main) | -| **Community** | [![License: GPL v2](https://img.shields.io/badge/License-GPLv2-blue.svg)](https://www.gnu.org/licenses/gpl-2.0) [![Powered by MDAnalysis](https://img.shields.io/badge/powered%20by-MDAnalysis-orange.svg?logoWidth=16&logo=data:image/x-icon;base64,AAABAAEAEBAAAAEAIAAoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAADkUFBSuZ2dn/3V1df8uLi7bAAAATgBGfyQAAAA2AAAAMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0AAADoAAAA/wAAAP8AAAD/AAAAWgC3/2AAnv3eAJ/+dgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9AAAA/wAAAP8AAAD/AAAA/wAKDzEAnP3WAKn//wCS/OgAf/8MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIQAAANwAAADtAAAA7QAAAMAAABUMAJn9gwCe/e0Aj/2LAP//AQAAAAAAAAAA)](https://www.mdanalysis.org)| +| **Latest release** | [![Last release tag][lastreleasetag]][githubreleases] ![GitHub commits since latest release (by date) for a branch][commitssincerelease] [![Documentation Status][badge_docs]][docsurl]| +| :------ | :------- | +| **Status** | [![GH Actions Status][badge_actions]][mainworkflow] [![codecov][badge_codecov]][codecovio] | +| **Community** | [![License: GPL v2][badge_license]][licenseinfo] [![Powered by MDAnalysis][mdanalysis_badge]][mdaorg] | + +[badge_actions]: https://github.com/MDAnalysis/mdaencore/actions/workflows/gh-ci.yaml/badge.svg +[badge_codecov]: https://codecov.io/gh/MDAnalysis/mdaencore/branch/main/graph/badge.svg +[badge_license]: https://img.shields.io/badge/License-GPLv2-blue.svg +[badge_docs]: https://github.com/MDAnalysis/mdaencore/actions/workflows/docs.yaml/badge.svg?branch=main +[codecovio]: https://codecov.io/gh/MDAnalysis/mdaencore/branch/main +[commitssincerelease]: https://img.shields.io/github/commits-since/MDAnalysis/mdaencore/latest +[githubreleases]: https://github.com/MDAnalysis/mdaencore/releases +[lastreleasetag]: https://img.shields.io/github/release-pre/MDAnalysis/mdaencore.svg +[licenseinfo]: https://www.gnu.org/licenses/gpl-2.0 +[mainworkflow]: https://github.com/MDAnalysis/mdaencore/actions?query=branch%3Amain+workflow%3Agh-ci +[mdanalysis_badge]: https://img.shields.io/badge/powered%20by-MDAnalysis-orange.sv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AAAAAAAAAAAAAAAAAAAAALGxsVyqqqr/mpqa/6mpqf9KSUn/AAAA5QAAAPkAAAD5AAAAhQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADkUFBSuZ2dn/3V1df8uLi7bAAAATgBGfyQAAAA2AAAAMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0AAADoAAAA/wAAAP8AAAD/AAAAWgC3/2AAnv3eAJ/+dgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9AAAA/wAAAP8AAAD/AAAA/wAKDzEAnP3WAKn//wCS/OgAf/8MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIQAAANwAAADtAAAA7QAAAMAAABUMAJn9gwCe/e0Aj/2LAP//AQAAAAAAAAAA +[mdaorg]: https://mdanalysis.org +[docsurl]: https://www.mdanalysis.org/mdaencore/ Ensemble overlap comparison software for molecular data. @@ -13,12 +27,9 @@ mdaencore is bound by a [Code of Conduct](https://github.com/MDAnalysis/mdaencor ### Installation -To build mdaencore from source, -we highly recommend using virtual environments. -If possible, we strongly recommend that you use -[Anaconda](https://docs.conda.io/en/latest/) as your package manager. -Below we provide instructions both for `conda` and -for `pip`. +To build mdaencore from source, we highly recommend using virtual environments. +If possible, we strongly recommend that you use [Anaconda](https://docs.conda.io/en/latest/) as your package manager. +Below we provide instructions both for `conda` and for `pip`. #### With conda @@ -41,7 +52,7 @@ conda env update --name mdaencore --file docs/requirements.yaml Build this package from source: ``` -pip install -e . +pip install . ``` If you want to update your dependencies (which can be risky!), run: @@ -61,11 +72,10 @@ conda deactivate To build the package from source, run: ``` -pip install -e . +pip install . ``` -If you want to create a development environment, install -the dependencies required for tests and docs with: +If you want to create a development environment, install the dependencies required for tests and docs with: ``` pip install -e ".[test,doc]" @@ -81,6 +91,5 @@ Copyright (c) 2023, MDAnalysis #### Acknowledgements -Project based on the -[MDAnalysis Cookiecutter](https://github.com/MDAnalysis/cookiecutter-mda) version 0.1. +Project based on the [MDAnalysis Cookiecutter](https://github.com/MDAnalysis/cookiecutter-mda) version 0.1. Please cite [MDAnalysis](https://github.com/MDAnalysis/mdanalysis#citation) when using mdaencore in published work. diff --git a/docs/requirements.yaml b/docs/requirements.yaml index 33258b3..dab9e71 100644 --- a/docs/requirements.yaml +++ b/docs/requirements.yaml @@ -7,12 +7,13 @@ dependencies: - python - pip - - sphinxcontrib-bibtex + - sphinxcontrib-bibtex=2.5.0 + - mdanalysis-sphinx-theme - numpy - scipy - MDAnalysis + - cython - MDAnalysisTests - pytest - - - mdanalysis-sphinx-theme + \ No newline at end of file diff --git a/docs/source/api.rst b/docs/source/api.rst index ac9b25a..a1ca7f4 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -1,8 +1,10 @@ API Documentation ================= +This documentation details the modules, classes, and functions in ``mdaencore``. + .. autosummary:: :toctree: autosummary :recursive: - mdaencore + mdaencore \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 1dd5fac..d9557ca 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -15,7 +15,6 @@ # Incase the project was not installed import os import sys -sys.path.insert(0, os.path.abspath('../..')) import mdaencore # noqa diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 11b25e6..0b4bb66 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -1,4 +1,25 @@ Getting Started =============== -This page details how to get started with mdaencore. +Installation +------------ + +`mdaencore` is currently only installable from source. +First download and navigate to the source code from GitHub with + +.. code-block:: sh + + git clone --depth=1 https://github.com/MDAnalysis/mdaencore.git + cd mdaencore + +The packages is now installable with `pip`: + +.. code-block:: sh + + pip install . + +For full functionality of the :func:`mdaencore.fit_clusters` function, also install the `scikit-learn` package + +.. code-block:: sh + + pip install scikit-learn \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index d0045d9..0073cb7 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,6 +16,7 @@ Welcome to mdaencore's documentation! The `mdaencore` MDAKit moves the functionality of integrated ENCORE module out of the MDAnalysis core library, thereby deprecating it in MDAnalysis release 2.7.0 with a planned removal in release 3.0.0. +The original authors for the MDAnalysis implementation of ENCORE are Matteo Tiberti, Wouter Boomsma, Tone Bengtsen, as well as those listed in ``AUTHORS.md``. Indices and tables ================== diff --git a/mdaencore/__init__.py b/mdaencore/__init__.py index 3f65575..c2ed9d1 100644 --- a/mdaencore/__init__.py +++ b/mdaencore/__init__.py @@ -20,6 +20,9 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # +"""\ +Structural ensemble analysis package. +""" from .similarity import hes, ces, dres, \ ces_convergence, dres_convergence @@ -38,5 +41,5 @@ due.cite(Doi("10.1371/journal.pcbi.1004415"), description="ENCORE Ensemble Comparison", - path="MDAnalysis.analysis.encore", + path="mdaencore", cite_module=True) diff --git a/mdaencore/bootstrap.py b/mdaencore/bootstrap.py index 34205f9..e534dae 100644 --- a/mdaencore/bootstrap.py +++ b/mdaencore/bootstrap.py @@ -20,16 +20,8 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" -bootstrap procedures --- :mod:`mdaencore.bootstrap` -====================================================================== - - -The module contains functions for bootstrapping either ensembles (Universe +"""The module contains functions for bootstrapping either ensembles (Universe objects) or distance matrices, by resampling with replacement. - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - """ import numpy as np import logging diff --git a/mdaencore/clustering/ClusterCollection.py b/mdaencore/clustering/ClusterCollection.py index dfb1ff4..c05c105 100644 --- a/mdaencore/clustering/ClusterCollection.py +++ b/mdaencore/clustering/ClusterCollection.py @@ -26,9 +26,6 @@ The module contains the Cluster and ClusterCollection classes which are designed to store results from clustering algorithms. - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - """ import numpy as np diff --git a/mdaencore/clustering/ClusteringMethod.py b/mdaencore/clustering/ClusteringMethod.py index 2344946..23f38a8 100644 --- a/mdaencore/clustering/ClusteringMethod.py +++ b/mdaencore/clustering/ClusteringMethod.py @@ -26,10 +26,7 @@ The module defines classes for interfacing to various clustering algorithms. One has been implemented natively, and will always be available, while -others are available only if scikit-learn is installed - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - +others are available only if scikit-learn is installed. """ import numpy as np import warnings diff --git a/mdaencore/clustering/affinityprop.pyx b/mdaencore/clustering/affinityprop.pyx index cd4ba3c..422a814 100644 --- a/mdaencore/clustering/affinityprop.pyx +++ b/mdaencore/clustering/affinityprop.pyx @@ -20,11 +20,8 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" +"""\ Cython wrapper for the C implementation of the Affinity Perturbation clustering algorithm. - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - """ from ..utils import TriangularMatrix import logging diff --git a/mdaencore/clustering/cluster.py b/mdaencore/clustering/cluster.py index 4a5b6e1..a1682c5 100644 --- a/mdaencore/clustering/cluster.py +++ b/mdaencore/clustering/cluster.py @@ -20,15 +20,8 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" -clustering frontend --- :mod:`mdaencore.clustering.cluster` -============================================================================ - -The module defines a function serving as front-end for various clustering +"""The module defines a function serving as front-end for various clustering algorithms, wrapping them to allow them to be used interchangably. - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - """ import numpy as np from ..utils import ParallelCalculation, merge_universes @@ -105,7 +98,7 @@ def cluster(ensembles, Here, we cluster two ensembles :: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF, DCD) >>> ens2 = Universe(PSF, DCD2) diff --git a/mdaencore/confdistmatrix.py b/mdaencore/confdistmatrix.py index bb4f156..eb81f99 100644 --- a/mdaencore/confdistmatrix.py +++ b/mdaencore/confdistmatrix.py @@ -20,18 +20,11 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" -Distance Matrix calculation --- :mod:`mdaencore.confdistmatrix` -================================================================================== - - +"""\ The module contains a base class to easily compute, using parallelization and shared memory, matrices of conformational distance between the structures stored as frames in a Universe. A class to compute an RMSD matrix in such a way is also available. - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - """ from joblib import Parallel, delayed import numpy as np diff --git a/mdaencore/covariance.py b/mdaencore/covariance.py index 8936af7..b1457d4 100644 --- a/mdaencore/covariance.py +++ b/mdaencore/covariance.py @@ -20,15 +20,9 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" -Covariance calculation --- :mod:`encore.covariance` -===================================================================== - +"""\ The module contains functions to estimate the covariance matrix of an ensemble of structures. - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - """ import numpy as np diff --git a/mdaencore/cutils.pyx b/mdaencore/cutils.pyx index 1cce702..9e42ea6 100644 --- a/mdaencore/cutils.pyx +++ b/mdaencore/cutils.pyx @@ -22,11 +22,8 @@ # # cython embedsignature=True -""" -Mixed Cython utils for ENCORE - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - +"""\ +Mixed Cython utils for ENCORE. """ diff --git a/mdaencore/data/README.md b/mdaencore/data/README.md deleted file mode 100644 index 550587e..0000000 --- a/mdaencore/data/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Sample Package Data - -This directory contains sample additional data you may want to include with your package. -This is a place where non-code related additional information (such as data files, molecular structures, etc.) can -go that you want to ship alongside your code. - -Please note that it is not recommended to place large files in your git directory. If your project requires files larger -than a few megabytes in size it is recommended to host these files elsewhere. This is especially true for binary files -as the `git` structure is unable to correctly take updates to these files and will store a complete copy of every version -in your `git` history which can quickly add up. As a note most `git` hosting services like GitHub have a 1 GB per repository -cap. - -## Including package data - -Modify your package's `setup.py` file and the `setup()` command. Include the -[`package_data`](http://setuptools.readthedocs.io/en/latest/setuptools.html#basic-use) keyword and point it at the -correct files. \ No newline at end of file diff --git a/mdaencore/data/__init__.py b/mdaencore/data/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/mdaencore/data/files.py b/mdaencore/data/files.py deleted file mode 100644 index e7d24e1..0000000 --- a/mdaencore/data/files.py +++ /dev/null @@ -1,17 +0,0 @@ -""" -Location of data files -====================== - -Use as :: - - from mdaencore.data.files import * - -""" - -__all__ = [ - "MDANALYSIS_LOGO", # example file of MDAnalysis logo -] - -from pkg_resources import resource_filename - -MDANALYSIS_LOGO = resource_filename(__name__, "mda.txt") diff --git a/mdaencore/data/mda.txt b/mdaencore/data/mda.txt deleted file mode 100644 index 7893f85..0000000 --- a/mdaencore/data/mda.txt +++ /dev/null @@ -1,45 +0,0 @@ - - ▄▄████████▄▄ - ,▓███████████████▄ ____ - ▄███████████████████ ╔D╠╠╠╠╠╠╬φ_ - ▐█████████████████████ ╔╠╠╠╠╠╠╠╠╠╠╠╠▒ - ██████████████████████▌ ╠╠╠╠╠╠╠╠╠╠╠╠╠╠H - ███████████████████████ ╠╠╠╠╠╠╠╠╠╠╠╠╠╠H - ╙██████████████████████ ╠╠╠╠╠╠╠╠╠╠╠╠╠╩ - ╙██████████████████████ ╙╠╠╠╠╠╠╠╠╠╝^ - '██████████████████████_ `'^╙╙^` - `▀███████████▀▀▀███████▄ - `` _╓╗φ@@@φ╗╖,╙▀████▄▄╓,,,▄▄▄▓█████▓▄_ - ,φ▓╬╬╬╬╬╬╬╬╬╬╬╬▒,╙█████████████████████▓_ - Æ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▌ ▀██████████████████████ - _,,_ ╣╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓ ╚██████████████████████ - ╔╠╠╠╠╠╬_ [╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬L ██████████████████████▌ - ╠╠╠╠╠╠╠H ╟╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▒ ███████████████████████ - `╚╠╠╠╠╙ ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬L ██████████████████████▌ - [╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╩ ███████████████████████ - é╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╜ ██████████████████████▀ - _╗▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╝╙,▓████████████████████▀" - _╓╗╗╗╗╗╖,__ __╓φ▓╬╬╝╜"▄▄▄▄▄▄▄▄▄╠╙╙^""▄▄▓████▀" └╙╙▀▀▀"" - ╔Æ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╜╓▓█████████████████████▀ - ╗╣╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╩ ██████████████████████▀ - ╣╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▌ ██████████████████████Ñ ╔@DD╠DK╓ - [╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬ ╟██████████████████████ ╒╠╠╠╠╠╠╠╠╠╠ - ╢╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬ ██████████████████████▌ ╚╠╠╠╠╠╠╠╠╠╠H - ╚╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬ ╟█████████████████████` '╠╠╠╠╠╠╠╠╠╠ - ╫╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▒ ████████████████████▌ `╚╠╠╠╠╠╝╙ - ╚╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬W ██████████████████▀ - ╙╣╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓╖╙▀█████████████▀ - "╙╨╝╝╝╨╙^`` `"╙╝╬╬▓W╓╙▀▀▀▀▀▀▀▀"_,,,__ - _╓╦φφφφ╦,_ '╝╬╬╬╬▓▒▒▒▒▓╬╬╬╬╬╬╬╬╬▓╗_ - ,φ╠╠╠╠╠╠╠╠╠╠╠D╦_ `╣╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓, - ╔╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╦ ╟╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▄ - j╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠H ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬L - ╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠ ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓ - ╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠ ║╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▌ - ²╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠ ╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬ - '╠╠╠╠╠╠╠╠╠╠╠╠╠╠╠╩ `╣╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓ - '╚╠╠╠╠╠╠╠╠╠╝╙ ╙╣╬╬╬╬╬╬╬╬╬╬╬╬╬╝^ - ````` `╙╨╝╝╝╝╝╨╙` - ---- -asciiart.club diff --git a/mdaencore/dimensionality_reduction/DimensionalityReductionMethod.py b/mdaencore/dimensionality_reduction/DimensionalityReductionMethod.py index f6b3998..25af382 100644 --- a/mdaencore/dimensionality_reduction/DimensionalityReductionMethod.py +++ b/mdaencore/dimensionality_reduction/DimensionalityReductionMethod.py @@ -26,10 +26,7 @@ The module defines classes for interfacing to various dimensionality reduction algorithms. One has been implemented natively, and will always be available, -while others are available only if scikit-learn is installed - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - +while others are available only if scikit-learn is installed. """ import logging import warnings diff --git a/mdaencore/dimensionality_reduction/__init__.py b/mdaencore/dimensionality_reduction/__init__.py index 99f2a14..08d90d8 100644 --- a/mdaencore/dimensionality_reduction/__init__.py +++ b/mdaencore/dimensionality_reduction/__init__.py @@ -20,6 +20,9 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # +"""\ +This package contains modules with functions and classes for performing dimensionality reduction algorithms. +""" from . import DimensionalityReductionMethod from .DimensionalityReductionMethod import StochasticProximityEmbeddingNative diff --git a/mdaencore/dimensionality_reduction/reduce_dimensionality.py b/mdaencore/dimensionality_reduction/reduce_dimensionality.py index cacf23d..d9b5497 100644 --- a/mdaencore/dimensionality_reduction/reduce_dimensionality.py +++ b/mdaencore/dimensionality_reduction/reduce_dimensionality.py @@ -26,9 +26,6 @@ The module defines a function serving as front-end for various dimensionality reduction algorithms, wrapping them to allow them to be used interchangably. - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - """ import numpy as np from ..confdistmatrix import get_distance_matrix @@ -66,7 +63,7 @@ def reduce_dimensionality(ensembles, repeat the functionality just described - merging ensembles for each ensemble in the outer loop. - method : MDAnalysis.analysis.encore.dimensionality_reduction.DimensionalityReductionMethod or list + method : mdaencore.dimensionality_reduction.DimensionalityReductionMethod or list A single or a list of instances of the DimensionalityReductionMethod classes from the dimensionality_reduction module. A separate analysis will be run for each method. Note that different parameters for the @@ -109,7 +106,7 @@ def reduce_dimensionality(ensembles, matplotlib: :: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF, DCD) >>> ens2 = Universe(PSF, DCD2) diff --git a/mdaencore/dimensionality_reduction/stochasticproxembed.pyx b/mdaencore/dimensionality_reduction/stochasticproxembed.pyx index a65eb49..9862094 100644 --- a/mdaencore/dimensionality_reduction/stochasticproxembed.pyx +++ b/mdaencore/dimensionality_reduction/stochasticproxembed.pyx @@ -20,11 +20,9 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" +"""\ Cython wrapper for the C implementation of the Stochastic Proximity Embedding dimensionality reduction algorithm. - -:Author: Matteo Tiberti, Wouter Boomsma """ diff --git a/mdaencore/similarity.py b/mdaencore/similarity.py index 0e21f10..847299b 100644 --- a/mdaencore/similarity.py +++ b/mdaencore/similarity.py @@ -20,13 +20,7 @@ # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # -""" -================================================================================= -Ensemble Similarity Calculations --- :mod:`mdaencore.similarity` -================================================================================= - -:Author: Matteo Tiberti, Wouter Boomsma, Tone Bengtsen - +"""\ The module contains implementations of similarity measures between protein ensembles described in :footcite:p:`LindorffLarsen2009`. The implementation and examples are described in :footcite:p:`Tiberti2015`. @@ -64,7 +58,7 @@ two ensemble objects are first created and then used for calculation: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF, DCD) >>> ens2 = Universe(PSF, DCD2) @@ -84,7 +78,7 @@ The RMSD matrix is automatically calculated: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF, DCD) >>> ens2 = Universe(PSF, DCD2) @@ -104,7 +98,7 @@ RMSD matrix and the default SPE dimensional reduction method: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF, DCD) >>> ens2 = Universe(PSF, DCD2) @@ -793,7 +787,7 @@ def hes(ensembles, this changes the ``ens1`` and ``ens2`` objects: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF, DCD) >>> ens2 = Universe(PSF, DCD2) @@ -810,7 +804,7 @@ def hes(ensembles, manually: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> from MDAnalysis.analysis import align >>> ens1 = Universe(PSF, DCD) @@ -976,7 +970,7 @@ def ces(ensembles, clustering_method : A single or a list of instances of the - :class:`MDAnalysis.analysis.encore.clustering.ClusteringMethod` classes + :class:`mdaencore.clustering.ClusteringMethod` classes from the clustering module. Different parameters for the same clustering method can be explored by adding different instances of the same clustering class. Clustering methods options are the @@ -1057,7 +1051,7 @@ def ces(ensembles, Here the simplest case of just two instances of :class:`Universe` is illustrated: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF, DCD) >>> ens2 = Universe(PSF, DCD2) @@ -1333,7 +1327,7 @@ def dres(ensembles, illustrated: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF,DCD) >>> ens2 = Universe(PSF,DCD2) @@ -1509,7 +1503,7 @@ def ces_convergence(original_ensemble, select : str, optional Atom selection string in the MDAnalysis format. Default is "name CA" - clustering_method : MDAnalysis.analysis.encore.clustering.ClusteringMethod + clustering_method : mdaencore.clustering.ClusteringMethod A single or a list of instances of the ClusteringMethod classes from the clustering module. Different parameters for the same clustering method can be explored by adding different instances of the same @@ -1536,7 +1530,7 @@ def ces_convergence(original_ensemble, splitting the trajectory into a window_size of 10 frames: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF,DCD) >>> ces_conv = encore.ces_convergence(ens1, 10) @@ -1644,7 +1638,7 @@ def dres_convergence(original_ensemble, splitting the trajectory into a window_size of 10 frames: >>> from MDAnalysis import Universe - >>> import MDAnalysis.analysis.encore as encore + >>> import mdaencore as encore >>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2 >>> ens1 = Universe(PSF,DCD) >>> dres_conv = encore.dres_convergence(ens1, 10) diff --git a/mdaencore/tests/test_mdaencore.py b/mdaencore/tests/test_mdaencore.py index be160c2..456b2aa 100644 --- a/mdaencore/tests/test_mdaencore.py +++ b/mdaencore/tests/test_mdaencore.py @@ -39,7 +39,7 @@ import MDAnalysis.analysis.rms as rms import MDAnalysis.analysis.align as align -import MDAnalysis.analysis.encore.confdistmatrix as confdistmatrix +import mdaencore.confdistmatrix as confdistmatrix def function(x): @@ -907,8 +907,8 @@ def test_import_warnings(self, recwarn): if 'encore' in mod: sys.modules.pop(mod, None) for pkg in ( - 'MDAnalysis.analysis.encore.dimensionality_reduction.DimensionalityReductionMethod', - 'MDAnalysis.analysis.encore.clustering.ClusteringMethod', + 'mdaencore.dimensionality_reduction.DimensionalityReductionMethod', + 'mdaencore.clustering.ClusteringMethod', ): self._check_sklearn_import_warns(pkg, recwarn) # This is a quickfix! Convert this to a parametrize call in future. diff --git a/pyproject.toml b/pyproject.toml index 8eea125..9d3eced 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,10 +12,10 @@ name = "mdaencore" description = "Ensemble overlap comparison software for molecular data." license = {file = "LICENSE" } authors = [ - {name = "MDAnalysis", email = "ikenney@asu.edu"}, + {name = "MDAnalysis", email = "mdanalysis@numfocus.org"}, ] maintainers = [ - {name = "MDAnalysis", email = "ikenney@asu.edu"}, + {name = "MDAnalysis", email = "mdanalysis@numfocus.org"}, ] readme = "README.md" requires-python = ">=3.9" diff --git a/readthedocs.yaml b/readthedocs.yaml index cab6477..875aac1 100644 --- a/readthedocs.yaml +++ b/readthedocs.yaml @@ -2,6 +2,9 @@ version: 2 +sphinx: + configuration: docs/source/conf.py + build: os: ubuntu-22.04 tools: @@ -9,7 +12,7 @@ build: python: install: - - method: pip + - method: setuptools path: . conda: diff --git a/setup.py b/setup.py index 8c697f5..4b97bc1 100644 --- a/setup.py +++ b/setup.py @@ -27,9 +27,7 @@ def extensions(debug=False, use_cython=True): - # TODO: remove fast-math? - encore_compile_args = ['-std=c99', '-ffast-math', '-funroll-loops', - '-fsigned-zeros'] + encore_compile_args = ['-std=c99', '-funroll-loops', '-fsigned-zeros'] cython_linetrace = bool(os.environ.get('CYTHON_TRACE_NOGIL', False)) @@ -102,7 +100,7 @@ def extensions(debug=False, use_cython=True): # Self-descriptive entries which should always be present name='mdaencore', author='MDAnalysis', - author_email='ikenney@asu.edu', + author_email='mdanalysis@numfocus.org', description=short_description, long_description=long_description, long_description_content_type="text/markdown",