Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
149 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[report] | ||
exclude_lines = | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: |
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,42 @@ | ||
*.py[cod] | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
lib | ||
lib64 | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
nosetests.xml | ||
htmlcov | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Complexity | ||
output/*.html | ||
output/*/index.html | ||
|
||
# Sphinx | ||
docs/_build | ||
|
||
# PyCharm | ||
.idea | ||
.idea/* |
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,38 @@ | ||
language: python | ||
|
||
python: | ||
# We don't actually use the Travis Python, but this keeps it organized. | ||
- "2.7" | ||
- "3.3" | ||
- "3.4" | ||
install: | ||
- sudo apt-get update | ||
# You may want to periodically update this, although the conda update | ||
# conda line below will keep everything up-to-date. We do this | ||
# conditionally because it saves us some downloading if the version is | ||
# the same. | ||
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then | ||
wget http://repo.continuum.io/miniconda/Miniconda-3.4.2-Linux-x86_64.sh -O miniconda.sh; | ||
else | ||
wget http://repo.continuum.io/miniconda/Miniconda3-3.4.2-Linux-x86_64.sh -O miniconda.sh; | ||
fi | ||
- bash miniconda.sh -b -p $HOME/miniconda | ||
- export PATH="$HOME/miniconda/bin:$PATH" | ||
- hash -r | ||
- conda config --set always_yes yes --set changeps1 no | ||
- conda update -q conda | ||
# Useful for debugging any issues with conda | ||
- conda info -a | ||
|
||
# Replace dep1 dep2 ... with your dependencies | ||
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION | ||
- source activate test-environment | ||
- conda install future coverage pytest | ||
- pip install coveralls | ||
- python setup.py install | ||
|
||
script: | ||
- coverage run --rcfile=.coveragerc --source=mbuild setup.py test | ||
|
||
after_success: | ||
- coveralls |
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,54 @@ | ||
import collections | ||
from copy import deepcopy | ||
|
||
|
||
class OrderedSet(collections.Set): | ||
""" """ | ||
def __init__(self, iterable=()): | ||
self.d = collections.OrderedDict.fromkeys(iterable) | ||
|
||
def add(self, key): | ||
self.d[key] = None | ||
|
||
def discard(self, key): | ||
del self.d[key] | ||
|
||
def difference_update(self, *args, **kwargs): | ||
intersection = set(self.d.keys()).intersection(args[0]) | ||
self.intersection_update(intersection) | ||
|
||
def intersection_update(self, *args, **kwargs): | ||
for part in args[0]: | ||
del self.d[part] | ||
|
||
def __len__(self): | ||
return len(self.d) | ||
|
||
def __contains__(self, element): | ||
return element in self.d | ||
|
||
def __iter__(self): | ||
return self.d.__iter__() | ||
|
||
def __le__(self, other): | ||
if not isinstance(other, collections.Set): | ||
return NotImplemented | ||
if len(self) > len(other): | ||
return False | ||
|
||
for e1, e2 in zip(self, other): | ||
if e1 != e2: | ||
return False | ||
return True | ||
|
||
def __repr__(self): | ||
class_name = self.__class__.__name__ | ||
if not self: | ||
return '{0!s}()'.format(class_name) | ||
return '{0!s}({1!r})'.format(class_name, list(self)) | ||
|
||
def __deepcopy__(self, memo): | ||
result = OrderedSet() | ||
for elt in self: | ||
result.add(deepcopy(elt, memo)) | ||
return result |
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,5 @@ | ||
from __future__ import print_function | ||
|
||
import os | ||
|
||
import mdtraj as md | ||
|
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,3 @@ | ||
matplotlib | ||
networkx | ||
simtk.units |