From 2030a47be37e336ec81c8c7a3d86ba193bc8cc76 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 31 Jul 2018 15:22:06 +0200 Subject: [PATCH 01/37] Adding Py 3.7 support Also update copyright date --- .travis.yml | 3 +++ docs/conf.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 03cc830..10cae17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: python python: - '3.6' + - '3.7' - '2.7' - '3.5' @@ -28,6 +29,8 @@ matrix: exclude: - env: MDTRAJ="dev" python: "3.5" + - env: MDTRAJ="dev" + python: "3.7" before_install: - echo "before install" diff --git a/docs/conf.py b/docs/conf.py index 72bc1d2..03c909e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -101,7 +101,7 @@ # General information about the project. project = u'contact_map' -copyright = u'2017, David W.H. Swenson' +copyright = u'2017-2018, David W.H. Swenson' author = u'David W.H. Swenson' # The language for content autogenerated by Sphinx. Refer to documentation From eca3515b5a7b57283222e2edb9394662af58baa8 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Thu, 11 Oct 2018 19:09:14 +0200 Subject: [PATCH 02/37] Workaround for Travis Py 3.7 --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 10cae17..964be57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: python python: - '3.6' - - '3.7' - '2.7' - '3.5' @@ -26,6 +25,10 @@ env: - MDTRAJ="dev" matrix: + include: + - python: 3.7 + dist: xenial + sudo: true exclude: - env: MDTRAJ="dev" python: "3.5" From 25ca8d47316db6938903df5c59dd9fbf1832e131 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Thu, 11 Oct 2018 19:17:36 +0200 Subject: [PATCH 03/37] update appveyor; another travis try --- .travis.yml | 3 ++- appveyor.yml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 964be57..a1ad840 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,10 @@ env: matrix: include: - - python: 3.7 + - python: "3.7" dist: xenial sudo: true + env: MDTRAJ="release" exclude: - env: MDTRAJ="dev" python: "3.5" diff --git a/appveyor.yml b/appveyor.yml index 856193b..5b3393a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,10 +21,10 @@ environment: CONDA_PY: "27" ARCH: '64' - PYTHON: "C:\\Miniconda36" - CONDA_PY: "36" + CONDA_PY: "37" ARCH: '32' - PYTHON: "C:\\Miniconda36-x64" - CONDA_PY: "36" + CONDA_PY: "37" ARCH: '64' build: false From 5d94fc6fc52b9bcd6c77ebe18b62d2a623dcbf7f Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Thu, 11 Oct 2018 19:19:15 +0200 Subject: [PATCH 04/37] quotes on "xenial"? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a1ad840..78a9f3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ env: matrix: include: - python: "3.7" - dist: xenial + dist: "xenial" sudo: true env: MDTRAJ="release" exclude: From c7b8b01edbab2653895fb683269b175ef3441c77 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sat, 13 Oct 2018 15:07:47 +0200 Subject: [PATCH 05/37] more attempts to fix Py 3.7 testing --- .travis.yml | 4 ++-- appveyor.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78a9f3f..3d87e55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,8 +33,8 @@ matrix: exclude: - env: MDTRAJ="dev" python: "3.5" - - env: MDTRAJ="dev" - python: "3.7" + #- env: MDTRAJ="dev" + #python: "3.7" before_install: - echo "before install" diff --git a/appveyor.yml b/appveyor.yml index 5b3393a..8cd7c60 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,10 +20,10 @@ environment: - PYTHON: "C:\\Miniconda-x64" CONDA_PY: "27" ARCH: '64' - - PYTHON: "C:\\Miniconda36" + - PYTHON: "C:\\Miniconda37" CONDA_PY: "37" ARCH: '32' - - PYTHON: "C:\\Miniconda36-x64" + - PYTHON: "C:\\Miniconda37-x64" CONDA_PY: "37" ARCH: '64' From bab92be22bf3c1f5cd6ee495c6c4d0ced32f09c3 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 19 Mar 2019 12:18:39 +0100 Subject: [PATCH 06/37] updates for Py37 builds --- .travis.yml | 11 ++++++----- appveyor.yml | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3ccfcc..066d343 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: python python: - - '3.6' + - '3.7' - '2.7' - - '3.5' + - '3.6' branches: only: @@ -27,12 +27,13 @@ env: matrix: include: - python: "3.7" - dist: "xenial" - sudo: true + #dist: "xenial" + #sudo: true env: MDTRAJ="release" exclude: - env: MDTRAJ="dev" - python: "3.5" + python: "3.6" + #python: "3.5" #- env: MDTRAJ="dev" #python: "3.7" diff --git a/appveyor.yml b/appveyor.yml index 8cd7c60..3088ac4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,7 +33,7 @@ install: # install python - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% # test python version - - "%CMD_IN_ENV% conda config --add channels omnia" # TODO: switch to conda-forge? + - "%CMD_IN_ENV% conda config --add channels conda-forge" - "%CMD_IN_ENV% conda update -yq --all" - "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" - "%CMD_IN_ENV% python --version" From dede571470c4d9ca9a800cca847c19fd12ebe223 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 19 Mar 2019 12:33:15 +0100 Subject: [PATCH 07/37] more attempts to fix travis & appveyor --- .travis.yml | 9 +++++---- appveyor.yml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 066d343..e0f2132 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,10 @@ +dist: "xenial" +sudo: true language: python python: - - '3.7' - '2.7' - '3.6' + #- '3.7' branches: only: @@ -27,9 +29,8 @@ env: matrix: include: - python: "3.7" - #dist: "xenial" - #sudo: true - env: MDTRAJ="release" + dist: "xenial" + sudo: true exclude: - env: MDTRAJ="dev" python: "3.6" diff --git a/appveyor.yml b/appveyor.yml index 3088ac4..4d3e2d6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,7 +34,7 @@ install: - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% # test python version - "%CMD_IN_ENV% conda config --add channels conda-forge" - - "%CMD_IN_ENV% conda update -yq --all" + #- "%CMD_IN_ENV% conda update -yq --all" - "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" - "%CMD_IN_ENV% python --version" - "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\"" From 2a01e26b4e506ede7731a2649f9e570f62af4448 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 19 Mar 2019 12:51:36 +0100 Subject: [PATCH 08/37] use xenial for all on travis; drop Win32/py37 --- .travis.yml | 11 ++--------- appveyor.yml | 11 ++++++----- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index e0f2132..90c0909 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ language: python python: - '2.7' - '3.6' - #- '3.7' + - '3.7' branches: only: @@ -14,7 +14,7 @@ branches: env: global: - - CANONICAL_PYTHON="3.6" + - CANONICAL_PYTHON="3.7" - CANONICAL_MDTRAJ="release" - CODECLIMATE="" - TWINE_USERNAME="dwhswenson" @@ -27,16 +27,9 @@ env: - MDTRAJ="dev" matrix: - include: - - python: "3.7" - dist: "xenial" - sudo: true exclude: - env: MDTRAJ="dev" python: "3.6" - #python: "3.5" - #- env: MDTRAJ="dev" - #python: "3.7" before_install: - echo "before install" diff --git a/appveyor.yml b/appveyor.yml index 4d3e2d6..0a6bff8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,9 +20,10 @@ environment: - PYTHON: "C:\\Miniconda-x64" CONDA_PY: "27" ARCH: '64' - - PYTHON: "C:\\Miniconda37" - CONDA_PY: "37" + - PYTHON: "C:\\Miniconda36" + CONDA_PY: "36" ARCH: '32' + # MDTraj hasn't released py37/Win32 (last Win32 was 1.9.1) - PYTHON: "C:\\Miniconda37-x64" CONDA_PY: "37" ARCH: '64' @@ -32,10 +33,10 @@ build: false install: # install python - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% - # test python version + - "%CMD_IN_ENV% conda update -yq --all" - "%CMD_IN_ENV% conda config --add channels conda-forge" - #- "%CMD_IN_ENV% conda update -yq --all" - - "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" + - "%CMD_IN_ENV% conda install -yq conda-build" # \"conda-build<3.0.26\"" + # test python version - "%CMD_IN_ENV% python --version" - "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\"" # now we do our own install From 4a4b1b172ef080469116cadc8645108051bb8e69 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 19 Mar 2019 13:03:55 +0100 Subject: [PATCH 09/37] try fixing problem with bad MDTraj wheels --- ci/pip-install/install_requirements.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/pip-install/install_requirements.sh b/ci/pip-install/install_requirements.sh index c2aa8ba..0f23bf6 100644 --- a/ci/pip-install/install_requirements.sh +++ b/ci/pip-install/install_requirements.sh @@ -3,4 +3,5 @@ pip install --upgrade pip pip install cython # may be required for numpy override? pip install --upgrade --force-reinstall numpy # override Travis numpy -pip install -r requirements.txt +# --no-binary required until MDTraj updates its wheels +pip install --no-binary -r requirements.txt From ed5dc2f4a9e7ba3007dfe4e33f418ae76fdfdb1f Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 19 Mar 2019 13:08:39 +0100 Subject: [PATCH 10/37] more attempts to fix py37 builds --- appveyor.yml | 2 +- ci/pip-install/install_requirements.sh | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0a6bff8..ddb936b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,7 +35,7 @@ install: - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% - "%CMD_IN_ENV% conda update -yq --all" - "%CMD_IN_ENV% conda config --add channels conda-forge" - - "%CMD_IN_ENV% conda install -yq conda-build" # \"conda-build<3.0.26\"" + - "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" # test python version - "%CMD_IN_ENV% python --version" - "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\"" diff --git a/ci/pip-install/install_requirements.sh b/ci/pip-install/install_requirements.sh index 0f23bf6..7a53b42 100644 --- a/ci/pip-install/install_requirements.sh +++ b/ci/pip-install/install_requirements.sh @@ -4,4 +4,4 @@ pip install --upgrade pip pip install cython # may be required for numpy override? pip install --upgrade --force-reinstall numpy # override Travis numpy # --no-binary required until MDTraj updates its wheels -pip install --no-binary -r requirements.txt +pip install -r requirements.txt diff --git a/requirements.txt b/requirements.txt index 6cd0d95..3708da0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ future numpy scipy pandas -mdtraj +--no-binary mdtraj From ae90a20a7a1fda1a64f5829e52a758296e8dbc07 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 19 Mar 2019 13:30:20 +0100 Subject: [PATCH 11/37] a couple more attempts to fix py37 MDTraj --- appveyor.yml | 4 +++- requirements.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ddb936b..15d5aa5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,9 +33,11 @@ build: false install: # install python - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% + - "%CMD_IN_ENV% activate base" - "%CMD_IN_ENV% conda update -yq --all" - "%CMD_IN_ENV% conda config --add channels conda-forge" - - "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" + #- "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" + - "%CMD_IN_ENV% conda install -yq \"conda=4.5\" conda-build" # test python version - "%CMD_IN_ENV% python --version" - "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\"" diff --git a/requirements.txt b/requirements.txt index 3708da0..330eb0b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ future numpy scipy pandas ---no-binary mdtraj +--no-binary :all: mdtraj From ecc8b16c91d87fb8672bbe07d1525446ca512b3a Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 3 Jun 2019 14:40:55 +0200 Subject: [PATCH 12/37] Rename to Contact Map Explorer --- README.md | 10 +++++----- docs/conf.py | 16 ++++++++-------- docs/index.rst | 10 +++++----- docs/installing.rst | 6 +++--- examples/concurrences.ipynb | 4 ++-- examples/contact_map.ipynb | 6 +++--- examples/contact_map_without_atom_slice.ipynb | 10 +++++----- examples/dask_contact_frequency.ipynb | 10 +++++----- setup.py | 4 ++-- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index b3c6c99..0389f4c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f7f3cf53698e4655ac8895f13fa5dea6)](https://www.codacy.com/app/dwhswenson/contact_map?utm_source=github.com&utm_medium=referral&utm_content=dwhswenson/contact_map&utm_campaign=Badge_Grade) [![Maintainability](https://api.codeclimate.com/v1/badges/84768756d594176d8da6/maintainability)](https://codeclimate.com/github/dwhswenson/contact_map/maintainability) -# Contact Maps +# Contact Map Explorer This package provides tools for analyzing and exploring contacts (residue-residue and atom-atom) from a trajectory generated by molecular @@ -20,9 +20,9 @@ processes involving biomolecules. For example, an analysis of contacts can be particularly useful when defining bound states during a binding processes between proteins, DNA, and small molecules (such as potential drugs). -The contacts analyzed by `contact_map` can be either intermolecular or -intramolecular, and can be analyzed on a residue-residue basis or an -atom-atom basis. +The contacts analyzed by Contact Map Explorer can be either intermolecular or +intramolecular, and can be analyzed on a residue-residue basis or an atom-atom +basis. This package makes it very easy to answer questions like: @@ -59,7 +59,7 @@ for details. ## Support and development -`contact_map` is an open source project, released under the GNU LGPL, +Contact Map Explorer is an open source project, released under the GNU LGPL, version 2.1 or (at your option) any later version. Development takes place in public at https://github.com/dwhswenson/contact_map; your contributions would be welcome! diff --git a/docs/conf.py b/docs/conf.py index 72bc1d2..0edcb3c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# contact_map documentation build configuration file, created by +# Contact Map Explorer documentation build configuration file, created by # sphinx-quickstart on Sun Oct 8 16:23:29 2017. # # This file is execfile()d with the current directory set to its @@ -100,9 +100,9 @@ master_doc = 'index' # General information about the project. -project = u'contact_map' -copyright = u'2017, David W.H. Swenson' -author = u'David W.H. Swenson' +project = u'Contact Map Explorer' +copyright = u'2017-2019, David W.H. Swenson and Sander Roet' +author = u'David W.H. Swenson and Sander Roet' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -304,8 +304,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'contact_map.tex', u'contact\\_map Documentation', - u'David W.H. Swenson', 'manual'), + (master_doc, 'contact_map.tex', u'Contact Map Explorer Documentation', + u'David W.H. Swenson and Sander Roet', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -346,7 +346,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'contact_map', u'contact_map Documentation', + (master_doc, 'contact_map', u'Contact Map Explorer Documentation', [author], 1) ] @@ -361,7 +361,7 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'contact_map', u'contact_map Documentation', + (master_doc, 'contact_map', u'Contact Map Explorer Documentation', author, 'contact_map', 'One line description of project.', 'Miscellaneous'), ] diff --git a/docs/index.rst b/docs/index.rst index 0a89e91..d8bd08f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,8 +5,8 @@ .. currentmodule:: contact_map -``contact_map`` -=============== +Contact Map Explorer +==================== This package provides tools for analyzing and exploring contacts (residue-residue and atom-atom) from a trajectory generated by molecular @@ -18,8 +18,8 @@ processes involving biomolecules. For example, an analysis of contacts can be particularly useful when defining bound states during a binding processes between proteins, DNA, and small molecules (such as potential drugs). -The contacts analyzed by ``contact_map`` can be either intermolecular or -intramolecular, and can be analyzed on a residue-residue basis or an +The contacts analyzed by Contact Map Explorer can be either intermolecular +or intramolecular, and can be analyzed on a residue-residue basis or an atom-atom basis. This package makes it very easy to answer questions like: @@ -45,7 +45,7 @@ representing the fraction of trajectory time that the contact was present. * :ref:`genindex` -``contact_map`` is an open source project, released under the GNU LGPL, +Contact Map Explorer is an open source project, released under the GNU LGPL, version 2.1 or (at your option) any later version. Development takes place in public at https://github.com/dwhswenson/contact_map; your contributions would be welcome! diff --git a/docs/installing.rst b/docs/installing.rst index 07aaab9..13d24a2 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -101,7 +101,7 @@ Additional functionality ======================== Installing some additional packages will immediately enable additional -features in ``contact_map``. To get all the functionality, install the +features in Contact Map Explorer. To get all the functionality, install the packages in ``optional_installs.txt``, either with ``pip install -r optional_installs.txt`` or ``conda install -y --file optional_installs.txt``. @@ -133,5 +133,5 @@ suite. This can be done by installing ``pytest`` (using either ``pip`` or py.test --pyargs contact_map -v -This will run the tests on the installed version of ``contact_map``. All -tests should either pass or skip. +This will run the tests on the installed version of Contact Map Explorer. +All tests should either pass or skip. diff --git a/examples/concurrences.ipynb b/examples/concurrences.ipynb index 71c1e2f..895da5d 100644 --- a/examples/concurrences.ipynb +++ b/examples/concurrences.ipynb @@ -6,7 +6,7 @@ "source": [ "# Concurrences\n", "\n", - "One of the tools in `contact_map` is the ability to look at simultaneous contacts. The idea is that you might have a set of contacts that is likely to happen concurrently, and that this set of contacts might help you define a stable state. This is managed in `contact_map` by what we call contact concurrences.\n", + "One of the tools in Contact Map Explorer is the ability to look at simultaneous contacts. The idea is that you might have a set of contacts that is likely to happen concurrently, and that this set of contacts might help you define a stable state. This is managed in Contact Map Explorer by what we call contact concurrences.\n", "\n", "To start, we'll look at a trajectory of a specific inhibitor during its binding process to GSK3B." ] @@ -224,7 +224,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.2" + "version": "3.7.3" } }, "nbformat": 4, diff --git a/examples/contact_map.ipynb b/examples/contact_map.ipynb index 8130622..55d6df1 100644 --- a/examples/contact_map.ipynb +++ b/examples/contact_map.ipynb @@ -6,9 +6,9 @@ "source": [ "# Contact Maps\n", "\n", - "The `contact_map` package includes some tricks to study contact maps in protein dynamics, based on tools in MDTraj. This notebook shows examples and serves as documentation.\n", + "Contact Map Explorer includes some tricks to study contact maps in protein dynamics, based on tools in MDTraj. This notebook shows examples and serves as documentation.\n", "\n", - "As an example, we'll use part of a trajectory of the KRas protein bound to GTP, which was provided by Sander Roet. KRas is a protein that plays a role in many cancers. For simplicity, the waters were removed from the trajectory (although ions are still included). To run this notebook, download the example files from https://figshare.com/s/453b1b215cf2f9270769 (total download size about 1.2 MB). Download all files, and extract in the same directory that you started Jupyer from (so that you have a directory called `5550217` in your current working directory)." + "As an example, we'll use part of a trajectory of the KRas protein bound to GTP, which was provided by Sander Roet. KRas is a protein that plays a role in many cancers. For simplicity, the waters were removed from the trajectory (although ions are still included). To run this notebook, download the example files from https://figshare.com/s/453b1b215cf2f9270769 (total download size about 1.2 MB). Download all files, and extract in the same directory that you started Jupyter from (so that you have a directory called `5550217` in your current working directory)." ] }, { @@ -1032,7 +1032,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.7" + "version": "3.7.3" } }, "nbformat": 4, diff --git a/examples/contact_map_without_atom_slice.ipynb b/examples/contact_map_without_atom_slice.ipynb index 98de8a0..59cef36 100644 --- a/examples/contact_map_without_atom_slice.ipynb +++ b/examples/contact_map_without_atom_slice.ipynb @@ -282,21 +282,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.15" + "pygments_lexer": "ipython3", + "version": "3.7.3" } }, "nbformat": 4, diff --git a/examples/dask_contact_frequency.ipynb b/examples/dask_contact_frequency.ipynb index a6077dd..bb58479 100644 --- a/examples/dask_contact_frequency.ipynb +++ b/examples/dask_contact_frequency.ipynb @@ -191,21 +191,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.14" + "pygments_lexer": "ipython3", + "version": "3.7.3" } }, "nbformat": 4, diff --git a/setup.py b/setup.py index 1ec9534..052a221 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ """ -setup.py for contact_map +setup.py for Contact Map Explorer """ import os import subprocess @@ -104,7 +104,7 @@ def _minimal_ext_cmd(cmd): VERSION_PY_CONTENT = """ # This file is automatically generated by setup.py \"\"\" -Version info for contact_map. +Version info for Contact Map Explorer. ``full_version`` gives the most information about the current state. It is always the short (PEP440) version string, followed by a git hash as From a53badbdca4d05b3f1040435e10b90dafd5e3ad5 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 4 Jun 2019 12:52:26 +0200 Subject: [PATCH 13/37] Bump to 0.5.0.dev0 --- ci/conda-recipe/meta.yaml | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/conda-recipe/meta.yaml b/ci/conda-recipe/meta.yaml index 51a4275..06aa0ea 100644 --- a/ci/conda-recipe/meta.yaml +++ b/ci/conda-recipe/meta.yaml @@ -1,7 +1,7 @@ package: name: contact_map # add ".dev0" for unreleased versions - version: "0.4.0" + version: "0.5.0.dev0" source: path: ../../ diff --git a/setup.py b/setup.py index 8ef8d25..f9852e4 100644 --- a/setup.py +++ b/setup.py @@ -9,8 +9,8 @@ ####################### USER SETUP AREA ################################# # * VERSION: base version (do not include .dev0, etc -- that's automatic) # * IS_RELEASE: whether this is a release -VERSION = "0.4.0" -IS_RELEASE = True +VERSION = "0.5.0" +IS_RELEASE = False DEV_NUM = 0 # always 0: we don't do public (pypi) .dev releases PRE_TYPE = "" # a, b, or rc (although we rarely release such versions) From 11f937d578db1bc0e9318fe8ca28b916c8994665 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 4 Jun 2019 13:36:29 +0200 Subject: [PATCH 14/37] comment out --allow-patch-skip in autorelease test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9c66969..54e1eaf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ install: script: - export MPLBACKEND=SVG - python -c "import contact_map" - - python autorelease_check.py --branch ${TRAVIS_BRANCH} --event ${TRAVIS_EVENT_TYPE} --allow-patch-skip #TODO remove allow-patch-skip + - python autorelease_check.py --branch ${TRAVIS_BRANCH} --event ${TRAVIS_EVENT_TYPE} #--allow-patch-skip # allow-patch-skip if there was a testpypi problem - py.test -vv --cov=contact_map --cov-report xml:cov.xml after_success: From 6a315a5f0bb87230b87646492412cf6a64c56aa4 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 4 Jun 2019 14:16:04 +0200 Subject: [PATCH 15/37] update pip install; windows conda-build install --- appveyor.yml | 3 ++- requirements.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 15d5aa5..66b0015 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -37,7 +37,8 @@ install: - "%CMD_IN_ENV% conda update -yq --all" - "%CMD_IN_ENV% conda config --add channels conda-forge" #- "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" - - "%CMD_IN_ENV% conda install -yq \"conda=4.5\" conda-build" + #- "%CMD_IN_ENV% conda install -yq \"conda=4.5\" conda-build" + - "%CMD_IN_ENV% conda install -yq conda-build" # test python version - "%CMD_IN_ENV% python --version" - "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\"" diff --git a/requirements.txt b/requirements.txt index 330eb0b..b350f5c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ future numpy scipy pandas ---no-binary :all: mdtraj +mdtraj +--no-binary=mdtraj From 30ecd253f0d95bc098b8514e547101a3f730ccd4 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 4 Jun 2019 14:38:59 +0200 Subject: [PATCH 16/37] make appveyor look more like MDTraj's --- appveyor.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 66b0015..029ffa4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,12 +33,14 @@ build: false install: # install python - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% + - conda config --add channels conda-forge + - conda install -yq conda=4.4 conda-build - "%CMD_IN_ENV% activate base" - - "%CMD_IN_ENV% conda update -yq --all" - - "%CMD_IN_ENV% conda config --add channels conda-forge" + #- "%CMD_IN_ENV% conda update -yq --all" + #- "%CMD_IN_ENV% conda config --add channels conda-forge" #- "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" #- "%CMD_IN_ENV% conda install -yq \"conda=4.5\" conda-build" - - "%CMD_IN_ENV% conda install -yq conda-build" + #- "%CMD_IN_ENV% conda install -yq conda-build" # test python version - "%CMD_IN_ENV% python --version" - "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\"" From a096124b57f710a68e8d7bcc9a3e0ce9574701ad Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 4 Jun 2019 17:13:54 +0200 Subject: [PATCH 17/37] remove pin on appveyor conda? --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 029ffa4..f86474e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,7 +34,7 @@ install: # install python - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% - conda config --add channels conda-forge - - conda install -yq conda=4.4 conda-build + - conda install -yq conda conda-build - "%CMD_IN_ENV% activate base" #- "%CMD_IN_ENV% conda update -yq --all" #- "%CMD_IN_ENV% conda config --add channels conda-forge" From 68891e8b0715a5572ebe1fdc242489e39e024c6e Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 4 Jun 2019 18:00:15 +0200 Subject: [PATCH 18/37] try pin of conda-build --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f86474e..0cc5fec 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,7 +34,7 @@ install: # install python - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% - conda config --add channels conda-forge - - conda install -yq conda conda-build + - conda install -yq conda conda-build=3.10 - "%CMD_IN_ENV% activate base" #- "%CMD_IN_ENV% conda update -yq --all" #- "%CMD_IN_ENV% conda config --add channels conda-forge" From 98758c6fc8a435febd51c8535b0391603de35037 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 4 Jun 2019 18:42:37 +0200 Subject: [PATCH 19/37] try a couple more things for appveyor --- appveyor.yml | 14 +++++++++----- ci/conda-recipe/meta.yaml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0cc5fec..c135f9c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,17 +34,21 @@ install: # install python - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% - conda config --add channels conda-forge - - conda install -yq conda conda-build=3.10 - - "%CMD_IN_ENV% activate base" + - conda install -yq conda=4.5 conda-build=3.10 #- "%CMD_IN_ENV% conda update -yq --all" #- "%CMD_IN_ENV% conda config --add channels conda-forge" #- "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" #- "%CMD_IN_ENV% conda install -yq \"conda=4.5\" conda-build" #- "%CMD_IN_ENV% conda install -yq conda-build" # test python version - - "%CMD_IN_ENV% python --version" - - "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\"" # now we do our own install test_script: - - "%CMD_IN_ENV% conda build --quiet ci\\conda-recipe" + #- "%CMD_IN_ENV% activate base" + #- "%CMD_IN_ENV% python --version" + #- "%CMD_IN_ENV% python -c \"import struct; print(struct.calcsize('P') * 8)\"" + #- "%CMD_IN_ENV% conda build --quiet ci\\conda-recipe" + - activate base + - python --version + - python -c "import struct; print(struct.calcsize('P') * 8)" + - conda build --quiet ci\conda-recipe diff --git a/ci/conda-recipe/meta.yaml b/ci/conda-recipe/meta.yaml index 06aa0ea..9841167 100644 --- a/ci/conda-recipe/meta.yaml +++ b/ci/conda-recipe/meta.yaml @@ -7,7 +7,7 @@ source: path: ../../ build: - preserve_egg_dir: True + #preserve_egg_dir: True number: 0 script: python setup.py install --single-version-externally-managed --record record.txt From e4cc55cad49015f815318572c5e919988717f796 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Tue, 4 Jun 2019 19:07:37 +0200 Subject: [PATCH 20/37] cleanup --- appveyor.yml | 10 +--------- ci/conda-recipe/meta.yaml | 1 - ci/pip-install/install_requirements.sh | 1 - requirements.txt | 1 - 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c135f9c..d2eda24 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,9 +21,8 @@ environment: CONDA_PY: "27" ARCH: '64' - PYTHON: "C:\\Miniconda36" - CONDA_PY: "36" + CONDA_PY: "36" # No MDTraj for py37/Win32 ARCH: '32' - # MDTraj hasn't released py37/Win32 (last Win32 was 1.9.1) - PYTHON: "C:\\Miniconda37-x64" CONDA_PY: "37" ARCH: '64' @@ -35,13 +34,6 @@ install: - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH% - conda config --add channels conda-forge - conda install -yq conda=4.5 conda-build=3.10 - #- "%CMD_IN_ENV% conda update -yq --all" - #- "%CMD_IN_ENV% conda config --add channels conda-forge" - #- "%CMD_IN_ENV% conda install -yq \"conda-build<3.0.26\"" - #- "%CMD_IN_ENV% conda install -yq \"conda=4.5\" conda-build" - #- "%CMD_IN_ENV% conda install -yq conda-build" - # test python version - # now we do our own install test_script: #- "%CMD_IN_ENV% activate base" diff --git a/ci/conda-recipe/meta.yaml b/ci/conda-recipe/meta.yaml index 9841167..c50ede6 100644 --- a/ci/conda-recipe/meta.yaml +++ b/ci/conda-recipe/meta.yaml @@ -7,7 +7,6 @@ source: path: ../../ build: - #preserve_egg_dir: True number: 0 script: python setup.py install --single-version-externally-managed --record record.txt diff --git a/ci/pip-install/install_requirements.sh b/ci/pip-install/install_requirements.sh index 7a53b42..c2aa8ba 100644 --- a/ci/pip-install/install_requirements.sh +++ b/ci/pip-install/install_requirements.sh @@ -3,5 +3,4 @@ pip install --upgrade pip pip install cython # may be required for numpy override? pip install --upgrade --force-reinstall numpy # override Travis numpy -# --no-binary required until MDTraj updates its wheels pip install -r requirements.txt diff --git a/requirements.txt b/requirements.txt index b350f5c..6cd0d95 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,3 @@ numpy scipy pandas mdtraj ---no-binary=mdtraj From 63ac227c5a97f8f5c53a26b7b79acb1b812fd51b Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Fri, 2 Aug 2019 00:46:23 +0200 Subject: [PATCH 21/37] Update setup.py author info --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 352a47e..9934e96 100644 --- a/setup.py +++ b/setup.py @@ -161,8 +161,8 @@ def write_version_py(filename): write_version_py(os.path.join('contact_map', 'version.py')) setup( name="contact_map", - author="David W.H. Swenson", - author_email="dwhs@hyperblazer.net", + author="David W.H. Swenson and Sander Roet", + author_email="dwhs@hyperblazer.net, sroet@hotmail.com", version=PACKAGE_VERSION, license="LGPL-2.1+", url="http://github.com/dwhswenson/contact_map", From f8ebbc40c4db7c62d79b9ec4a9ebf19cdd6ecda3 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Fri, 2 Aug 2019 00:52:05 +0200 Subject: [PATCH 22/37] use Sander's *actual* email address --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9934e96..b24a7d4 100644 --- a/setup.py +++ b/setup.py @@ -162,7 +162,7 @@ def write_version_py(filename): setup( name="contact_map", author="David W.H. Swenson and Sander Roet", - author_email="dwhs@hyperblazer.net, sroet@hotmail.com", + author_email="dwhs@hyperblazer.net, sanderroet@hotmail.com", version=PACKAGE_VERSION, license="LGPL-2.1+", url="http://github.com/dwhswenson/contact_map", From 98c9edb9412d1b05a4732661362bca3062dfb47d Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 5 Aug 2019 12:13:02 +0200 Subject: [PATCH 23/37] remove maintainer/license info from contact_map.py --- contact_map/contact_map.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/contact_map/contact_map.py b/contact_map/contact_map.py index 7c145f1..7f730eb 100644 --- a/contact_map/contact_map.py +++ b/contact_map/contact_map.py @@ -1,8 +1,6 @@ """ Contact map analysis. """ -# Maintainer: David W.H. Swenson (dwhs@hyperblazer.net) -# Licensed under LGPL, version 2.1 or greater import collections import itertools import pickle From 3b1eb4ec06337ba5feb7a4d16ad13cbf29157d88 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sun, 20 Oct 2019 18:20:59 +0200 Subject: [PATCH 24/37] try added webhooks notif to fix coveralls --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 969d457..6a4cbcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,9 @@ python: - '3.6' - '3.7' +notifications: + webhooks: https://coveralls.io/webhook + branches: only: - master From 8469b40bf83fb8b928ecb31cc282b00253a16793 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Sun, 20 Oct 2019 20:03:17 +0200 Subject: [PATCH 25/37] COVERALLS_PARALLEL env var --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 6a4cbcd..aa8c6cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,7 @@ script: - py.test -vv --cov=contact_map --cov-report xml:cov.xml after_success: + - export COVERALLS_PARALLEL=true - coveralls - python-codacy-coverage -r cov.xml From ff057bb7178fab4c1ff131a93781464669e57ed0 Mon Sep 17 00:00:00 2001 From: Nabil Faisal Faruk Date: Mon, 11 Nov 2019 13:34:00 -0800 Subject: [PATCH 26/37] Fix for lack of unitcell; better colorbar scaling --- contact_map/contact_map.py | 5 +++++ contact_map/plot_utils.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/contact_map/contact_map.py b/contact_map/contact_map.py index 7f730eb..ea069c6 100644 --- a/contact_map/contact_map.py +++ b/contact_map/contact_map.py @@ -1,6 +1,8 @@ """ Contact map analysis. """ +# Maintainer: David W.H. Swenson (dwhs@hyperblazer.net) +# Licensed under LGPL, version 2.1 or greater import collections import itertools import pickle @@ -59,6 +61,9 @@ def _atom_slice(traj, indices): if traj._have_unitcell: unitcell_lengths = traj._unitcell_lengths.copy() unitcell_angles = traj._unitcell_angles.copy() + else: + unitcell_lengths = None + unitcell_angles = None time = traj._time.copy() # Hackish to make the smart slicing work diff --git a/contact_map/plot_utils.py b/contact_map/plot_utils.py index ba2ff56..4d86260 100644 --- a/contact_map/plot_utils.py +++ b/contact_map/plot_utils.py @@ -42,7 +42,7 @@ def ranged_colorbar(cmap, norm, cbmin, cbmax, name="Partial Map"): new_norm = matplotlib.colors.Normalize(vmin=cbmin, vmax=cbmax) sm = plt.cm.ScalarMappable(cmap=new_cmap, norm=new_norm) sm._A = [] - cb = plt.colorbar(sm) + cb = plt.colorbar(sm, fraction=0.046, pad=0.04) return cb From 69aa1742803ad85c8a8994108d9adf648f2e3182 Mon Sep 17 00:00:00 2001 From: sroet Date: Sun, 17 Nov 2019 14:22:44 +0100 Subject: [PATCH 27/37] Added test for non_periodic systems and some pep8 --- contact_map/tests/test_contact_map.py | 50 ++++++++++++++++++++------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/contact_map/tests/test_contact_map.py b/contact_map/tests/test_contact_map.py index 26f1b2b..2d02445 100644 --- a/contact_map/tests/test_contact_map.py +++ b/contact_map/tests/test_contact_map.py @@ -1,6 +1,7 @@ import os import collections import mdtraj as md +import copy # pylint: disable=wildcard-import, missing-docstring, protected-access # pylint: disable=attribute-defined-outside-init, invalid-name, no-self-use @@ -11,7 +12,7 @@ # stuff to be testing in this file from contact_map.contact_map import * -from contact_map.contact_count import ContactCount, HAS_MATPLOTLIB +from contact_map.contact_count import HAS_MATPLOTLIB traj = md.load(find_testfile("trajectory.pdb")) @@ -39,9 +40,10 @@ test_file = "test_file.p" + def pdb_topology_dict(): serial = {str(i): i+1 for i in range(10)} - name = {str(i): "C" + str(i%2 + 1) for i in range(10)} + name = {str(i): "C" + str(i % 2 + 1) for i in range(10)} element = {str(i): "C" for i in range(10)} res_seq = {str(i): str(i/2 + 1) for i in range(10)} res_name = {str(i): "XXX" for i in range(10)} @@ -56,19 +58,23 @@ def pdb_topology_dict(): 'segmentID': seg_id} return dct + def counter_of_inner_list(ll): return collections.Counter([frozenset(i) for i in ll]) + def check_most_common_order(most_common): for i in range(len(most_common) - 1): assert most_common[i][1] >= most_common[i+1][1] + def check_use_atom_slice(m, use_atom_slice, expected): if use_atom_slice is not None: assert m._use_atom_slice == use_atom_slice else: assert m._use_atom_slice == expected[m] + def _contact_object_compare(m, m2): """Compare two contact objects (with asserts). @@ -95,6 +101,7 @@ def _check_contacts_dict_names(contact_object): for name in names: assert contacts.counter == contact_object.contacts[name].counter + def test_residue_neighborhood(): top = traj.topology residues = list(top.residues) @@ -262,15 +269,16 @@ def test_saving(self, idx): @pytest.mark.parametrize("use_atom_slice", [True, False, None]) def test_atom_slice(self, idx, use_atom_slice): - #Set class variable before init + # Set class variable before init class_default = ContactMap._class_use_atom_slice ContactMap._class_use_atom_slice = use_atom_slice map0q = ContactMap(traj[0], query=[1, 4, 5, 6], cutoff=0.075, n_neighbors_ignored=0) map0h = ContactMap(traj[0], haystack=[1, 4, 5, 6], cutoff=0.075, n_neighbors_ignored=0) - map0b = ContactMap(traj[0], query=[1, 4, 5, 6], haystack=[1,4,5,6], - cutoff=0.075, n_neighbors_ignored=0) + map0b = ContactMap(traj[0], query=[1, 4, 5, 6], + haystack=[1, 4, 5, 6], cutoff=0.075, + n_neighbors_ignored=0) maps = [map0q, map0h, map0b] atoms = {map0q: list(range(10)), map0h: list(range(10)), @@ -305,11 +313,26 @@ def test_atom_slice(self, idx, use_atom_slice): # Reset class variable (as imports are not redone between function # calls) ContactMap._class_use_atom_slice = class_default + def test_contacts_dict(self, idx): _check_contacts_dict_names(self.maps[idx]) + def test_no_unitcell(self, idx): + temptraj = copy.deepcopy(traj) + # Strip unitcell + temptraj.unitcell_vectors = None + + # Activate atom_slice + atoms = [1, 4, 5, 6] + mapi = ContactMap(temptraj[idx], cutoff=0.075, n_neighbors_ignored=0, + query=atoms, haystack=atoms) + expected_atom_contacts = {0: [[1, 4], [4, 6], [5, 6]], + 4: [[1, 4], [4, 6], [5, 6]]} + expected = counter_of_inner_list(expected_atom_contacts[idx]) + assert mapi._atom_contacts == expected # TODO: add tests for ContactObject._check_consistency + class TestContactFrequency(object): def setup(self): self.atoms = [0, 1, 4, 5, 6, 7, 8, 9] @@ -355,7 +378,7 @@ def test_check_compatibility_true(self): map2 = ContactFrequency(trajectory=traj[0:2], cutoff=0.075, n_neighbors_ignored=0) - assert self.map._check_compatibility(map2) == True + assert self.map._check_compatibility(map2) is True @pytest.mark.parametrize("diff", [ {'trajectory': traj.atom_slice([0, 1, 2, 3])}, @@ -512,10 +535,10 @@ def test_add_contact_frequency(self): start.add_contact_frequency(add_in) assert start.atom_contacts.counter == \ - self.map.atom_contacts.counter + self.map.atom_contacts.counter assert start.residue_contacts.counter == \ - self.map.residue_contacts.counter + self.map.residue_contacts.counter def test_subtract_contact_frequency(self): first_four = ContactFrequency(trajectory=traj[:4], @@ -531,14 +554,14 @@ def test_subtract_contact_frequency(self): test_subject.subtract_contact_frequency(first_four) assert test_subject.atom_contacts.counter == \ - last_frame.atom_contacts.counter + last_frame.atom_contacts.counter assert test_subject.residue_contacts.counter == \ - last_frame.residue_contacts.counter + last_frame.residue_contacts.counter @pytest.mark.parametrize("use_atom_slice", [True, False, None]) def test_use_atom_slice(self, use_atom_slice): - #Set class default before init + # Set class default before init class_default = ContactFrequency._class_use_atom_slice ContactFrequency._class_use_atom_slice = use_atom_slice mapq = ContactFrequency(trajectory=traj, cutoff=0.075, @@ -575,6 +598,7 @@ def test_use_atom_slice(self, use_atom_slice): # Reset class default as pytest does not re-import ContactFrequency._class_use_atom_slice = class_default + class TestContactDifference(object): def test_diff_traj_frame(self): ttraj = ContactFrequency(traj[0:4], cutoff=0.075, @@ -605,11 +629,11 @@ def test_diff_traj_frame(self): assert diff_1.atom_contacts.counter == expected_atom_count assert diff_2.atom_contacts.counter == \ - {k: -v for (k, v) in expected_atom_count.items()} + {k: -v for (k, v) in expected_atom_count.items()} assert diff_1.residue_contacts.counter == expected_residue_count assert diff_2.residue_contacts.counter == \ - {k: -v for (k, v) in expected_residue_count.items()} + {k: -v for (k, v) in expected_residue_count.items()} @pytest.mark.parametrize("intermediate", ["dict", "json"]) def test_serialization_cycle(self, intermediate): From 01bdde6f12ed2b687755c889b0a1c5b42e8cfad6 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Fri, 6 Dec 2019 13:53:00 +0100 Subject: [PATCH 28/37] Move to Autorelease 0.1.0 --- .gitignore | 2 +- .travis.yml | 69 +----------- setup.cfg | 31 ++++++ setup.py | 300 +++++++++++++++++++++------------------------------- 4 files changed, 159 insertions(+), 243 deletions(-) diff --git a/.gitignore b/.gitignore index 8e4d4e7..3f3f3af 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ dask-worker-space *nc .pytest_cache -contact_map/version.py +contact_map/_installed_version.py cover # Byte-compiled / optimized / DLL files diff --git a/.travis.yml b/.travis.yml index aa8c6cd..5ed357b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,68 +57,7 @@ after_success: - coveralls - python-codacy-coverage -r cov.xml -jobs: - include: - - stage: deploy testpypi - # This stage runs when you make a PR to stable. It tests that the - # deployment to testpypi works. - if: "(branch = stable) and (type = pull_request)" - python: '3.6' - addons: - apt_packages: - - pandoc - install: - - pip install twine - script: - - pandoc --from=markdown --to=rst --output=README.rst README.md - - python setup.py sdist bdist_wheel - - twine upload --repository-url https://test.pypi.org/legacy/ dist/* - after_success: skip - - stage: test testpypi - # This stage run when you make a PR to stable; after the package has - # been deployed to testpypi. It checks that the deployed package - # works. - if: "(branch = stable) and (type = pull_request)" - python: '3.6' - install: - - source ci/pip-install/install_requirements.sh - - pip install -U -r ci/pip-install/testing_requirements.txt - - pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple contact_map - script: - - cd ~ - - python -c "import contact_map" - - py.test --pyargs contact_map - after_success: skip - - stage: cut release - # This stage runs after you merge a PR into stable. It cuts the GitHub - # release based on the current stable branch and the release notes - # from the last PR merged into stable. - if: "(branch = stable) and (not type in (pull_request, cron))" - python: '3.6' - install: - - pip install autorelease - script: - - VERSION=`python setup.py --version` - - PROJECT=`python setup.py --name` - - autorelease-release --project $PROJECT --version $VERSION --token $AUTORELEASE_TOKEN - after_success: skip - - stage: deploy pypi - # This stage runs when a version-labelled tag is made. It deploys the - # package to PyPI. - if: tag =~ ^v[0-9]+\. - addons: - apt_packages: - - pandoc - install: skip - script: - - pandoc --from=markdown --to=rst --output=README.rst README.md - after_success: true - deploy: - provider: pypi - distributions: sdist bdist_wheel - skip_cleanup: true # need the readme.rst from the script stage - user: dwhswenson - on: - tags: true - password: - secure: "UN99BfNgMlE1qOwkbvJYMEdPGVF02dnZ5iF9HZY5HwJr7nlW1ixEGn6SzICS7WwLzthfqpbwXaqVGEsbsn1YwsvQe72JyCZxftoxZC2bVi5JV/OZka5uUTx0NXtzukZp33AUTDA9J2vushIxZCHSJG+GFqx4c+L8Y194V0QS4sw/lbtGC3qZ8jmszCnRgfPbb0tmCe4Jj1snclspPXhYtXL2z9Xh4r+ImCfosBFfThtsUs6t37/Jrx1srmDrt0eaGGBm1NAcyIVP6x03TdVVUFt/ud3U7+o0iHhqdEZKfUc2Dp6YN08Ck6Zyr/dR/A0Sc3/pWvytXwXLzOj+d7BtaAmPApcAc6v5GEmwWc4mkdsD+CEEW1q3CEFbWq6RTL+oa2zvEO6k0VrnHMCni3KqsWGmF6B209tHhy8jFAmCIruD2foUz7NxEKWNEOR4bqIjOGGIgGp4mfH+1l73JrI995ZmB1PqiIkxVeX0nPrZUZtBxOUyxg6aiL+NHMaYr5NCq2uCzDYhtwWnk26Oq6/JAEMxN+SCiC+O+DSvdQaUgUp6eS5whHGvf27ZxRMkmTSYTIMN6V1/PQ9WWSFsy0QBUYB7UJf/JLFnTi5xHj08jFNzUVOmeyq9MBzJF/ztnTTBSJgzNDROV+2qsZC0Ulm/hesMe0Swxqu/S5PelzrgwCA=" + +import: + - dwhswenson/autorelease:autorelease-travis.yml@v0.1.0 + diff --git a/setup.cfg b/setup.cfg index 3c6e79c..2e837b1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,33 @@ +[metadata] +name = contact_map +version = 0.5.0.dev0 +description = Contact maps based on MDTraj +long_description = file: README.md +long_description_content_type = text/markdown +author = David W.H. Swenson and Sander Roet +author_email = dwhs@hyperblazer.net, sanderroet@hotmail.com +license = LGPL 2.1+ +url = https://github.com/dwhswenson/contact_map +classifiers = + Development Status :: 4 - Beta + Intended Audience :: Science/Research + License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) + Operating System :: POSIX + Operating System :: Microsoft :: Windows + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Topic :: Scientific/Engineering :: Bio-Informatics + Topic :: Scientific/Engineering :: Chemistry + +[options] +install_requires = + future + numpy + mdtraj + scipy + pandas +packages = find: + + [bdist_wheel] universal=1 diff --git a/setup.py b/setup.py index b24a7d4..2a7d0df 100644 --- a/setup.py +++ b/setup.py @@ -1,183 +1,129 @@ -""" -setup.py for Contact Map Explorer -""" +# This file is vendored from Autorelease import os -import subprocess -import inspect +import ast +import sys + +import fnmatch # Py 2 + from setuptools import setup -####################### USER SETUP AREA ################################# -# * VERSION: base version (do not include .dev0, etc -- that's automatic) -# * IS_RELEASE: whether this is a release -VERSION = "0.5.0" -IS_RELEASE = False - -DEV_NUM = 0 # always 0: we don't do public (pypi) .dev releases -PRE_TYPE = "" # a, b, or rc (although we rarely release such versions) -PRE_NUM = 0 - -# REQUIREMENTS should list any required packages -REQUIREMENTS=['future', 'numpy', 'mdtraj', 'scipy', 'pandas'] - -# PACKAGES should list any subpackages of the code. The assumption is that -# package.subpackage is located at package/subpackage -PACKAGES=['contact_map', 'contact_map.tests'] - -# This DESCRIPTION is only used if a README.rst hasn't been made from the -# markdown version -DESCRIPTION=""" -Contact maps based on MDTraj; useful for studying for intramolecular and -intermolecular contacts (atom-atom or residue-residue) from simulations of -biomolecular systems. For a more detailed description, see package -documentation at http://contact-map.readthedocs.io/ -""" -SHORT_DESCRIPTION="Contact maps based on MDTraj" - -# note: leave the triple quotes on separate lines from the classifiers -CLASSIFIERS=""" -Development Status :: 4 - Beta -Intended Audience :: Science/Research -License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) -Operating System :: POSIX -Operating System :: Microsoft :: Windows -Programming Language :: Python :: 2.7 -Programming Language :: Python :: 3 -Topic :: Scientific/Engineering :: Bio-Informatics -Topic :: Scientific/Engineering :: Chemistry -""" -####################### USER SETUP AREA ################################# - - -# * VERSION: the release version number -# * __version__: ?? how is this used ?? -# * PACKAGE_VERSION: the version used in setup.py info -PACKAGE_VERSION = VERSION -if PRE_TYPE != "": - PACKAGE_VERSION += "." + PRE_TYPE + str(PRE_NUM) -if not IS_RELEASE: - PACKAGE_VERSION += ".dev" + str(DEV_NUM) -__version__ = PACKAGE_VERSION - -if os.path.isfile('README.rst'): - DESCRIPTION = open('README.rst').read() - -################################################################################ -# Writing version control information to the module -################################################################################ -def get_git_version(): - """ - Return the git hash as a string. - - Apparently someone got this from numpy's setup.py. It has since been - modified a few times. - """ - # Return the git revision as a string - # copied from numpy setup.py - def _minimal_ext_cmd(cmd): - # construct minimal environment - env = {} - for k in ['SYSTEMROOT', 'PATH']: - v = os.environ.get(k) - if v is not None: - env[k] = v - # LANGUAGE is used on win32 - env['LANGUAGE'] = 'C' - env['LANG'] = 'C' - env['LC_ALL'] = 'C' - with open(os.devnull, 'w') as err_out: - out = subprocess.Popen(cmd, - stdout=subprocess.PIPE, - stderr=err_out, # maybe debug later? - env=env).communicate()[0] - return out - - try: - git_dir = os.path.dirname(os.path.realpath(__file__)) - out = _minimal_ext_cmd(['git', '-C', git_dir, 'rev-parse', 'HEAD']) - GIT_REVISION = out.strip().decode('ascii') - except OSError: - GIT_REVISION = 'Unknown' - - return GIT_REVISION - -# TODO: this may get moved into another file -VERSION_PY_CONTENT = """ -# This file is automatically generated by setup.py -\"\"\" -Version info for Contact Map Explorer. - -``full_version`` gives the most information about the current state. It is -always the short (PEP440) version string, followed by a git hash as -``+gGITHASH``. If the install is not in a live git repository, that hash is -followed by ``.install``, and represents the commit that was installed. In a -live repository, it represents the active state. -\"\"\" +def _glob_glob_recursive(directory, pattern): + # python 2 glob.glob doesn't have a recursive keyword + # this implements for the specific case that we want an exact match + # See also https://stackoverflow.com/a/2186565 + matches = [] + for root, dirname, filenames in os.walk(directory): + matches.extend([os.path.join(root, filename) + for filename in fnmatch.filter(filenames, pattern)]) + return matches + + +class VersionPyFinder(object): + _VERSION_PY_FUNCTIONS = ['get_git_version', 'get_setup_cfg'] + def __init__(self, filename='version.py', max_depth=2): + self.filename_base = filename + self.max_depth = max_depth + self.depth = None + self.filename = os.getenv("AUTORELEASE_VERSION_PY", + self._first_eligible()) + self.functions = self._get_functions(self.filename) + + def _find_files(self): + # all_files = glob.glob("**/" + self.filename_base, recursive=True) + all_files = _glob_glob_recursive('.', self.filename_base) + meets_depth = [fname for fname in all_files + if len(fname.split(os.sep)) <= self.max_depth + 1] + return meets_depth + + def _is_eligible(self, filename): + with open(filename, mode='r') as f: + contents = f.read() + + tree = ast.parse(contents) + # we requrie that our functions be defined at module level -- we + # know that's how we wrote them, at least! + all_functions = [node.name for node in tree.body + if isinstance(node, ast.FunctionDef)] + return all(func in all_functions + for func in self._VERSION_PY_FUNCTIONS) + + def _first_eligible(self): + all_files = self._find_files() + for fname in all_files: + if self._is_eligible(fname): + return fname + return None + + @property + def version_setup_depth(self): + def get_depth(fname): + return len(os.path.abspath(fname).split(os.sep)) + + # we assume thta setup.py is in the same dir as setup.cfg + diff = get_depth(self.filename) - get_depth(__file__) + return diff + + def _get_functions(self, filename): + with open(self.filename, mode='r') as f: + contents = f.read() + + tree = ast.parse(contents) + + class MakeImportError(ast.NodeTransformer): + """converts a from x import y into an import error""" + def __init__(self, import_name): + self.import_name = import_name + + def visit_ImportFrom(self, node): + if node.module == self.import_name: + replacement = ast.Raise(exc=ast.Call( + func=ast.Name(id='ImportError', ctx=ast.Load()), + args=[], + keywords=[], + ), cause=None) + return ast.copy_location(replacement, node) + else: + return node + + import_remover = MakeImportError("_installed_version") + tree = import_remover.visit(tree) + ast.fix_missing_locations(tree) + + locs = dict(globals()) + exec(compile(tree, filename="version.py", mode='exec'), locs) + return {f: locs[f] for f in self._VERSION_PY_FUNCTIONS} + + +def write_installed_version_py(filename="_installed_version.py", + src_dir=None): + version_finder = VersionPyFinder() + directory = os.path.dirname(version_finder.filename) + depth = version_finder.version_setup_depth + get_git_version = version_finder.functions['get_git_version'] + get_setup_cfg = version_finder.functions['get_setup_cfg'] + + installed_version = os.path.join(directory, "_installed_version.py") + content = "_installed_version = '{vers}'\n" + content += "_installed_git_hash = '{git}'\n" + content += "_version_setup_depth = {depth}\n" + + # question: if I use the __file__ attribute in something I compile from + # here, what is the file? + my_dir = os.path.abspath(os.path.dirname(__file__)) + conf = get_setup_cfg(directory=my_dir, filename='setup.cfg') + # conf = get_setup_cfg(directory=my_dir, filename='new_setup.cfg') + version = conf.get('metadata', 'version') + git_rev = get_git_version() + + if src_dir is None: + src_dir = conf.get('metadata', 'name') + + with open (os.path.join(src_dir, filename), 'w') as f: + f.write(content.format(vers=version, git=git_rev, depth=depth)) -import os -import subprocess - -# this is automatically generated from the code in setup.py -%(git_version_code)s - -short_version = '%(version)s' -version = '%(version)s' -installed_git_hash = '%(git_revision)s' -full_version = version + '+g' + installed_git_hash[:7] + '.install' -release = %(is_release)s -git_hash = 'Unknown' # default - -if not release: - git_hash = get_git_version() - if git_hash != '' and git_hash != 'Unknown': - full_version = version + '+g' + git_hash[:7] - - version = full_version -""" - -def write_version_py(filename): - # Adding the git rev number needs to be done inside write_version_py(), - # otherwise the import of numpy.version messes up the build under Python 3. - git_version_code = inspect.getsource(get_git_version) - if os.path.exists('.git'): - GIT_REVISION = get_git_version() - else: - GIT_REVISION = 'Unknown' - - content = VERSION_PY_CONTENT % { - 'version': PACKAGE_VERSION, - 'git_revision': GIT_REVISION, - 'is_release': str(IS_RELEASE), - 'git_version_code': str(git_version_code) - } - - with open(filename, 'w') as version_file: - version_file.write(content) - - -################################################################################ -# Installation -################################################################################ if __name__ == "__main__": - write_version_py(os.path.join('contact_map', 'version.py')) - setup( - name="contact_map", - author="David W.H. Swenson and Sander Roet", - author_email="dwhs@hyperblazer.net, sanderroet@hotmail.com", - version=PACKAGE_VERSION, - license="LGPL-2.1+", - url="http://github.com/dwhswenson/contact_map", - packages=PACKAGES, - package_dir={p: '/'.join(p.split('.')) for p in PACKAGES}, - package_data={'contact_map': ['tests/*pdb']}, - ext_modules=[], - scripts=[], - description=SHORT_DESCRIPTION, - long_description=DESCRIPTION, - platforms=['Linux', 'Mac OS X', 'Unix', 'Windows'], - install_requires=REQUIREMENTS, - requires=REQUIREMENTS, - tests_require=["pytest", "pytest-cov", "python-coveralls"], - classifiers=CLASSIFIERS.split('\n')[1:-1] - ) - + # TODO: only write version.py under special circumstances + write_installed_version_py() + # write_version_py(os.path.join('autorelease', 'version.py')) + setup() From af110f11823c1ab4b84eb6ee41c7d5ce1b8bd29d Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Fri, 6 Dec 2019 14:02:23 +0100 Subject: [PATCH 29/37] add version.py --- contact_map/version.py | 141 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 contact_map/version.py diff --git a/contact_map/version.py b/contact_map/version.py new file mode 100644 index 0000000..37d99b4 --- /dev/null +++ b/contact_map/version.py @@ -0,0 +1,141 @@ +# This file vendored from Autorelease +import os +import subprocess + +try: + from configparser import ConfigParser, NoSectionError, NoOptionError +except ImportError: + # py2 + from ConfigParser import ConfigParser, NoSectionError, NoOptionError + +try: + from ._installed_version import _installed_version + from ._installed_version import _installed_git_hash + from ._installed_version import _version_setup_depth +except ImportError: + _installed_version = "Unknown" + _installed_git_hash = "Unknown" + _version_setup_depth = -1 + + +def get_git_version(): + """ + Return the git hash as a string. + + Apparently someone got this from numpy's setup.py. It has since been + modified a few times. + """ + # Return the git revision as a string + # copied from numpy setup.py + def _minimal_ext_cmd(cmd): + # construct minimal environment + env = {} + for k in ['SYSTEMROOT', 'PATH']: + v = os.environ.get(k) + if v is not None: + env[k] = v + # LANGUAGE is used on win32 + env['LANGUAGE'] = 'C' + env['LANG'] = 'C' + env['LC_ALL'] = 'C' + with open(os.devnull, 'w') as err_out: + out = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stderr=err_out, # maybe debug later? + env=env).communicate()[0] + return out + + try: + git_dir = os.path.dirname(os.path.realpath(__file__)) + out = _minimal_ext_cmd(['git', '-C', git_dir, 'rev-parse', 'HEAD']) + GIT_REVISION = out.strip().decode('ascii') + except OSError: + GIT_REVISION = 'Unknown' + + return GIT_REVISION + +def _seek_parent_dirs_for_file(filename): + rel_directory = None + my_dir = os.path.dirname(os.path.abspath(__file__)) + rel_directory_arr = [] + while not rel_directory: + expected_dir = os.path.join(*rel_directory_arr) \ + if rel_directory_arr else '.' + expected = os.path.join(expected_dir, filename) + if os.path.isfile(os.path.normpath(expected)): + rel_directory = expected_dir + else: + rel_directory_arr.append('..') + + if len(rel_directory_arr) > len(my_dir.split(os.sep)): + rel_directory_arr = [] + break + + return rel_directory + + +def _find_rel_path_for_file(depth, filename): + rel_directory = None + if depth == 0: + rel_directory = '.' + elif depth >= 1: + rel_directory = os.sep.join(['..'] * depth) + else: + rel_directory = _seek_parent_dirs_for_file(filename) + + if rel_directory: + return os.path.normpath(os.path.join(rel_directory, filename)) + else: + return None + + +def get_setup_cfg(directory, filename="setup.cfg"): + """Load the setup.cfg as a dict-of-dict. + + Parameters + ---------- + directory : str + directory for setup.cfg, relative to cwd; default '.' + filename : str + filename for setup.cfg; default 'setup.cfg' + """ + if isinstance(directory, int): + rel_path = _find_rel_path_for_file(directory, filename) + start_dir = os.path.abspath(os.path.dirname(__file__)) + setup_cfg = os.path.normpath(os.path.join(start_dir, rel_path)) + else: + setup_cfg = os.path.join(directory, filename) + + conf = None + if os.path.exists(setup_cfg): + conf = ConfigParser() + conf.read(setup_cfg) + + return conf + + +def get_setup_version(default_version, directory, filename="setup.cfg"): + version = default_version + conf = get_setup_cfg(directory, filename) + try: + version = conf.get('metadata', 'version') + except (NoSectionError, NoOptionError): + pass # version (or metadata) not defined in setup.cfg + except AttributeError: + pass # no setup.cfg found (conf is None) + return version + + +short_version = get_setup_version(_installed_version, + directory=_version_setup_depth) +_git_version = get_git_version() +_is_repo = (_git_version != '' and _git_version != "Unknown") + +if _is_repo: + git_hash = _git_version + full_version = short_version + "+g" + _git_version[:7] + version = full_version +else: + git_hash = "Unknown" + full_version = short_version + "+g" + _installed_git_hash[:7] + '.install' + version = short_version From acc93507071ef087c1e26b8c7cdb24acbac32d88 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Fri, 6 Dec 2019 14:11:39 +0100 Subject: [PATCH 30/37] update autorelease_check for autorelease 0.1.0 --- autorelease_check.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/autorelease_check.py b/autorelease_check.py index 2d1bfb2..9ac0536 100644 --- a/autorelease_check.py +++ b/autorelease_check.py @@ -3,17 +3,19 @@ import setup import contact_map from autorelease import DefaultCheckRunner, conda_recipe_version +from autorelease.version import get_setup_version from packaging.version import Version repo_path = '.' +SETUP_VERSION = get_setup_version(None, directory='.') versions = { 'package': contact_map.version.version, - 'setup.py': setup.PACKAGE_VERSION, + 'setup.py': SETUP_VERSION, 'conda-recipe': conda_recipe_version('ci/conda-recipe/meta.yaml'), } RELEASE_BRANCHES = ['stable'] -RELEASE_TAG = "v" + Version(setup.PACKAGE_VERSION).base_version +RELEASE_TAG = "v" + Version(SETUP_VERSION).base_version if __name__ == "__main__": checker = DefaultCheckRunner( From 5876d4560b623315860e6f2d8593c2394e9b721f Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Fri, 6 Dec 2019 15:08:56 +0100 Subject: [PATCH 31/37] include package data (using MANIFEST.in) --- MANIFEST.in | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 13d8124..2216b6e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ -include contact_map/tests/trajectory.pdb +include contact_map/tests/*.pdb include LICENSE diff --git a/setup.cfg b/setup.cfg index 2e837b1..9734f97 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,6 +20,7 @@ classifiers = Topic :: Scientific/Engineering :: Chemistry [options] +include_package_data = True install_requires = future numpy @@ -28,6 +29,5 @@ install_requires = pandas packages = find: - [bdist_wheel] universal=1 From fe5e7c55bfc0911d9b412feb23cfd94f3a3af118 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Fri, 31 Jan 2020 18:55:55 +0100 Subject: [PATCH 32/37] Release 0.5.0 --- ci/conda-recipe/meta.yaml | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/conda-recipe/meta.yaml b/ci/conda-recipe/meta.yaml index c50ede6..5aa8688 100644 --- a/ci/conda-recipe/meta.yaml +++ b/ci/conda-recipe/meta.yaml @@ -1,7 +1,7 @@ package: name: contact_map # add ".dev0" for unreleased versions - version: "0.5.0.dev0" + version: "0.5.0" source: path: ../../ diff --git a/setup.cfg b/setup.cfg index 9734f97..510fada 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = contact_map -version = 0.5.0.dev0 +version = 0.5.0 description = Contact maps based on MDTraj long_description = file: README.md long_description_content_type = text/markdown From ddeda85dc0f32b4ad6e42a20e1cd34360ac9cb46 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 10 Feb 2020 15:23:18 +0100 Subject: [PATCH 33/37] pin pandas<1.0 --- ci/conda-recipe/meta.yaml | 2 +- requirements.txt | 2 +- setup.cfg | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/conda-recipe/meta.yaml b/ci/conda-recipe/meta.yaml index c50ede6..1b01c06 100644 --- a/ci/conda-recipe/meta.yaml +++ b/ci/conda-recipe/meta.yaml @@ -20,7 +20,7 @@ requirements: - mdtraj - numpy - scipy - - pandas + - pandas<1.0 test: requires: diff --git a/requirements.txt b/requirements.txt index 6cd0d95..2bc28c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ future numpy scipy -pandas +pandas<1.0 mdtraj diff --git a/setup.cfg b/setup.cfg index 9734f97..89c198e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,7 @@ install_requires = numpy mdtraj scipy - pandas + pandas<1.0 packages = find: [bdist_wheel] From 2f559a23d264f85dee757a5146d9011a2ae072bf Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 10 Feb 2020 17:40:10 +0100 Subject: [PATCH 34/37] try to get travis to use autorelease --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5ed357b..972b0c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +version: ~> 1.0 + dist: "xenial" sudo: true language: python @@ -36,6 +38,7 @@ matrix: before_install: - echo "before install" + - echo "$TRAVIS_BRANCH $TRAVIS_EVENT_TYPE" - git fetch --tags install: From 73bd24381e588aabdef0e80280683abf24ec3e47 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 10 Feb 2020 18:19:44 +0100 Subject: [PATCH 35/37] remove xenial/sudo --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 972b0c8..50c7c3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ version: ~> 1.0 -dist: "xenial" -sudo: true language: python python: - '2.7' From 18f0ad5c8241e50eb3c61d3f48d83ff7db9752ea Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 10 Feb 2020 18:28:06 +0100 Subject: [PATCH 36/37] matrix.exclude -> jobs.exclude --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 50c7c3f..f93a7b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ env: - MDTRAJ="release" - MDTRAJ="dev" -matrix: +jobs: exclude: - env: MDTRAJ="dev" python: "3.6" From 54d85fd012b56937be122dd344b9e8605ee18250 Mon Sep 17 00:00:00 2001 From: "David W.H. Swenson" Date: Mon, 10 Feb 2020 18:47:47 +0100 Subject: [PATCH 37/37] make py37 Travis's canonical Python --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f93a7b0..e9ba691 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ version: ~> 1.0 language: python python: + - '3.7' - '2.7' - '3.6' - - '3.7' notifications: webhooks: https://coveralls.io/webhook