Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ addons:
apt:
packages:
- gfortran
- libgfortran3
- libhdf5-serial-dev
- libnetcdf-dev
- liblapack-dev
Expand All @@ -28,8 +29,8 @@ before_install:
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda
install:
- if [[ $SETUP == 'full' ]]; then 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; fi
- if [[ $SETUP == 'minimal' ]]; then conda create --yes -q -n pyenv python=2.7 numpy=1.9.1 nose=1.3.7 sphinx=1.3; fi
- 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
- 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
Expand All @@ -40,7 +41,7 @@ install:
- 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=300 --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} && \
Expand Down
2 changes: 1 addition & 1 deletion package/MDAnalysis/analysis/psa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ class PSAnalysis(object):
"""
def __init__(self, universes, reference=None, ref_select='name CA',
ref_frame=0, path_select=None, labels=None,
targetdir=None):
targetdir=os.path.curdir):
"""Setting up Path Similarity Analysis.

The mutual similarity between all unique pairs of trajectories
Expand Down
8 changes: 8 additions & 0 deletions testsuite/MDAnalysisTests/analysis/test_persistencelength.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
assert_,
assert_almost_equal,
assert_raises,
dec
)

from MDAnalysisTests.datafiles import Plength
from MDAnalysisTests import module_not_found


class TestPersistenceLength(object):
Expand Down Expand Up @@ -52,6 +54,8 @@ def test_run(self):
assert_(len(p.results) == 280)
assert_almost_equal(p.lb, 1.485, 3)

@dec.skipif(module_not_found('scipy'),
"Test skipped because scipy is not available.")
def test_fit(self):
p = self._make_p()
p.run()
Expand All @@ -72,10 +76,14 @@ def tearDown(self):
del self.a_ref
del self.y

@dec.skipif(module_not_found('scipy'),
"Test skipped because scipy is not available.")
def test_fit_simple(self):
a = polymer.fit_exponential_decay(self.x, self.y)
assert_(a == self.a_ref)

@dec.skipif(module_not_found('scipy'),
"Test skipped because scipy is not available.")
def test_fit_noisy(self):
y2 = self.y + (np.random.random(len(self.y)) - 0.5) * 0.05
a = polymer.fit_exponential_decay(self.x, y2)
Expand Down
8 changes: 5 additions & 3 deletions testsuite/MDAnalysisTests/analysis/test_psa.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@
from MDAnalysisTests.datafiles import PSF, DCD, DCD2



class TestPSAnalysis(TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
self.iu1 = np.triu_indices(3, k=1)
self.universe1 = MDAnalysis.Universe(PSF, DCD)
self.universe2 = MDAnalysis.Universe(PSF, DCD2)
self.universe_rev = MDAnalysis.Universe(PSF, DCD)
self.universes = [self.universe1, self.universe2, self.universe_rev]
self.psa = MDAnalysis.analysis.psa.PSAnalysis(self.universes, \
path_select='name CA')
path_select='name CA', \
targetdir=self.tmpdir)
self.psa.generate_paths(align=True)
self.psa.paths[-1] = self.psa.paths[-1][::-1,:,:] # reverse third path
self._run()
Expand All @@ -54,7 +55,8 @@ def tearDown(self):
del self.universe2
del self.universe_rev
del self.psa
shutil.rmtree('psadata') # remove psa data directory
if self.tmpdir:
shutil.rmtree(self.tmpdir)

def test_hausdorff_bound(self):
err_msg = "Some Frechet distances are smaller than corresponding " \
Expand Down