Skip to content

Commit

Permalink
Merge pull request #68 from dwhswenson/release-0.5.0
Browse files Browse the repository at this point in the history
Release 0.5.0
  • Loading branch information
dwhswenson authored Feb 11, 2020
2 parents 4395397 + 54d85fd commit 027a901
Show file tree
Hide file tree
Showing 21 changed files with 411 additions and 317 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
88 changes: 17 additions & 71 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
version: ~> 1.0

language: python
python:
- '3.6'
- '3.7'
- '2.7'
- '3.5'
- '3.6'

notifications:
webhooks: https://coveralls.io/webhook

branches:
only:
Expand All @@ -12,7 +17,7 @@ branches:

env:
global:
- CANONICAL_PYTHON="3.6"
- CANONICAL_PYTHON="3.7"
- CANONICAL_MDTRAJ="release"
- CODECLIMATE=""
- TWINE_USERNAME="dwhswenson"
Expand All @@ -24,13 +29,14 @@ env:
- MDTRAJ="release"
- MDTRAJ="dev"

matrix:
jobs:
exclude:
- env: MDTRAJ="dev"
python: "3.5"
python: "3.6"

before_install:
- echo "before install"
- echo "$TRAVIS_BRANCH $TRAVIS_EVENT_TYPE"
- git fetch --tags

install:
Expand All @@ -44,75 +50,15 @@ 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:
- export COVERALLS_PARALLEL=true
- 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:[email protected]

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include contact_map/tests/trajectory.pdb
include contact_map/tests/*.pdb
include LICENSE
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand Down Expand Up @@ -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!
Expand Down
24 changes: 13 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,26 @@ environment:
CONDA_PY: "27"
ARCH: '64'
- PYTHON: "C:\\Miniconda36"
CONDA_PY: "36"
CONDA_PY: "36" # No MDTraj for py37/Win32
ARCH: '32'
- PYTHON: "C:\\Miniconda36-x64"
CONDA_PY: "36"
- PYTHON: "C:\\Miniconda37-x64"
CONDA_PY: "37"
ARCH: '64'

build: false

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 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)\""
# now we do our own install
- conda config --add channels conda-forge
- conda install -yq conda=4.5 conda-build=3.10

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
6 changes: 4 additions & 2 deletions autorelease_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 2 additions & 3 deletions ci/conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package:
name: contact_map
# add ".dev0" for unreleased versions
version: "0.4.0"
version: "0.5.0"

source:
path: ../../

build:
preserve_egg_dir: True
number: 0
script: python setup.py install --single-version-externally-managed --record record.txt

Expand All @@ -21,7 +20,7 @@ requirements:
- mdtraj
- numpy
- scipy
- pandas
- pandas<1.0

test:
requires:
Expand Down
3 changes: 3 additions & 0 deletions contact_map/contact_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,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
Expand Down
2 changes: 1 addition & 1 deletion contact_map/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Loading

0 comments on commit 027a901

Please sign in to comment.