-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/encore-similarity/mdanalysis
- Loading branch information
Showing
690 changed files
with
86,681 additions
and
141,751 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
env: | ||
global: | ||
- secure: "HIj3p+p2PV8DBVg/KGUx6n83KwB0ASE5FwOn0SMB9zxnzAqe8sapwdBQdMdq0sXB7xT1spJqRxuxOMVEVn35BNLu7bxMLfa4287C8YXcomnvmv9xruxAsjsIewnNQ80vtPVbQddBPxa4jKbqgPby5QhhAP8KANAqYe44pIV70fY=" | ||
- GH_DOC_BRANCH: develop | ||
- GH_REPOSITORY: github.com/MDAnalysis/mdanalysis.git | ||
- GIT_CI_USER: TravisCI | ||
- GIT_CI_EMAIL: [email protected] | ||
- MDA_DOCDIR: package/doc/html | ||
matrix: | ||
- SETUP=full CYTHONIZE=true | ||
- SETUP=minimal CYTHONIZE=false | ||
language: python | ||
python: | ||
- "2.7" | ||
|
@@ -6,27 +17,31 @@ addons: | |
apt: | ||
packages: | ||
- gfortran | ||
- libgfortran3 | ||
- libhdf5-serial-dev | ||
- libnetcdf-dev | ||
- liblapack-dev | ||
- libatlas-dev | ||
before_install: | ||
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh | ||
- chmod +x miniconda.sh | ||
- ./miniconda.sh -b | ||
- ./miniconda.sh -b -p /home/travis/miniconda | ||
- export PATH=/home/travis/miniconda/bin:$PATH | ||
- conda update --yes conda | ||
install: | ||
- conda create --yes -q -n pyenv mkl python=2.7 numpy=1.9.1 scipy=0.14.0 nose=1.3.7 sphinx=1.3 | ||
- if [[ $SETUP == 'full' ]]; then conda create --yes -q -n pyenv python=2.7 numpy=1.9.2 scipy=0.16.0 nose=1.3.7 sphinx=1.3; fi | ||
- if [[ $SETUP == 'minimal' ]]; then conda create --yes -q -n pyenv python=2.7 numpy=1.9.2 nose=1.3.7 sphinx=1.3; fi | ||
- source activate pyenv | ||
- conda install --yes python=$TRAVIS_PYTHON_VERSION cython biopython matplotlib networkx netcdf4 | ||
- pip install package/ | ||
- if [[ $SETUP == 'full' ]]; then conda install --yes python=$TRAVIS_PYTHON_VERSION cython biopython matplotlib networkx netcdf4; fi | ||
- if [[ $SETUP == 'minimal' ]]; then conda install --yes python=$TRAVIS_PYTHON_VERSION biopython networkx; fi | ||
- if [[ $CYTHONIZE == 'true' ]]; then find . -name '*.pyx' -exec touch '{}' \; ;fi | ||
- pip install -v package/ | ||
- pip install testsuite/ | ||
- pip install coveralls tempdir | ||
- chmod +x testsuite/MDAnalysisTests/mda_nosetests | ||
# command to run tests | ||
script: | ||
- ./testsuite/MDAnalysisTests/mda_nosetests -v --with-coverage --cover-package MDAnalysis --processes=2 --process-timeout=120 --with-memleak | ||
- ./testsuite/MDAnalysisTests/mda_nosetests --with-coverage --cover-package MDAnalysis --processes=2 --process-timeout=300 --with-memleak | ||
- | | ||
test ${TRAVIS_PULL_REQUEST} == "false" && \ | ||
test ${TRAVIS_BRANCH} == ${GH_DOC_BRANCH} && \ | ||
|
@@ -41,12 +56,3 @@ after_success: | |
test ${TRAVIS_BRANCH} == ${GH_DOC_BRANCH} && \ | ||
test "${TRAVIS_BUILD_NUMBER}.1" == "${TRAVIS_JOB_NUMBER}" && \ | ||
bash ./maintainer/deploy_docs.sh | ||
env: | ||
global: | ||
- secure: "HIj3p+p2PV8DBVg/KGUx6n83KwB0ASE5FwOn0SMB9zxnzAqe8sapwdBQdMdq0sXB7xT1spJqRxuxOMVEVn35BNLu7bxMLfa4287C8YXcomnvmv9xruxAsjsIewnNQ80vtPVbQddBPxa4jKbqgPby5QhhAP8KANAqYe44pIV70fY=" | ||
- GH_DOC_BRANCH: develop | ||
- GH_REPOSITORY: github.com/MDAnalysis/mdanalysis.git | ||
- GIT_CI_USER: TravisCI | ||
- GIT_CI_EMAIL: [email protected] | ||
- MDA_DOCDIR: package/doc/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- | ||
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 | ||
# | ||
# MDAnalysis --- http://www.MDAnalysis.org | ||
# Copyright (c) 2006-2015 Naveen Michaud-Agrawal, Elizabeth J. Denning, Oliver Beckstein | ||
# and contributors (see AUTHORS for the full list) | ||
# | ||
# Released under the GNU Public Licence, v2 or any higher version | ||
# | ||
# Please cite your use of MDAnalysis in published work: | ||
# | ||
# N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. | ||
# MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. | ||
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 | ||
# | ||
|
||
""" | ||
Analysis building blocks --- :mod:`MDAnalysis.analysis.base` | ||
============================================================ | ||
A collection of useful building blocks for creating Analysis | ||
classes. | ||
""" | ||
import numpy as np | ||
import logging | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class AnalysisBase(object): | ||
"""Base class for defining multi frame analysis | ||
The analysis base class is designed as a template for creating | ||
multiframe analysis. | ||
The class implements the following methods: | ||
_setup_frames(trajectory, start=None, stop=None, step=None) | ||
Pass a Reader object and define the desired iteration pattern | ||
through the trajectory | ||
run | ||
The user facing run method. Calls the analysis methods | ||
defined below | ||
Your analysis can implement the following methods, which are | ||
called from run: | ||
_prepare | ||
Called before iteration on the trajectory has begun. | ||
Data structures can be set up at this time, however most | ||
error checking should be done in the __init__ | ||
_single_frame | ||
Called after the trajectory is moved onto each new frame. | ||
_conclude | ||
Called once iteration on the trajectory is finished. | ||
Apply normalisation and averaging to results here. | ||
""" | ||
def _setup_frames(self, trajectory, start=None, | ||
stop=None, step=None): | ||
self._trajectory = trajectory | ||
start, stop, step = trajectory.check_slice_indices( | ||
start, stop, step) | ||
self.start = start | ||
self.stop = stop | ||
self.step = step | ||
self.nframes = len(xrange(start, stop, step)) | ||
|
||
def _single_frame(self): | ||
"""Calculate data from a single frame of trajectory | ||
Don't worry about normalising, just deal with a single frame. | ||
""" | ||
pass | ||
|
||
def _prepare(self): | ||
"""Set things up before the analysis loop begins""" | ||
pass | ||
|
||
def _conclude(self): | ||
"""Finalise the results you've gathered. | ||
Called at the end of the run() method to finish everything up. | ||
""" | ||
pass | ||
|
||
def run(self): | ||
"""Perform the calculation""" | ||
logger.info("Starting preparation") | ||
self._prepare() | ||
for i, ts in enumerate( | ||
self._trajectory[self.start:self.stop:self.step]): | ||
self._ts = ts | ||
#logger.info("--> Doing frame {} of {}".format(i+1, self.nframes)) | ||
self._single_frame() | ||
logger.info("Finishing up") | ||
self._conclude() | ||
|
||
|
Oops, something went wrong.