Skip to content

Commit

Permalink
diffusionmap faster test
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugen Hruska authored and jdetle committed Jul 7, 2016
1 parent 6f8e8cc commit b6f8632
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions testsuite/MDAnalysisTests/analysis/test_diffusionmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

import MDAnalysis

import MDAnalysis.analysis.align as align
import MDAnalysis.analysis.rms as rms
import MDAnalysis.lib.qcprot as qcp
import MDAnalysis.analysis.diffusionmap as diffusionmap
from MDAnalysis import SelectionError

Expand All @@ -31,27 +28,36 @@
import tempdir
from os import path

from MDAnalysisTests.datafiles import PSF, DCD, FASTA
from MDAnalysisTests.datafiles import PDB,XTC
from MDAnalysisTests import executable_not_found, parser_not_found


class TestDiffusionmap(object):
def __init__(self):
u = MDAnalysis.Universe(PSF,DCD)
eg,ev=diffusionmap.diffusionmap(u)
#slow 6s test
#u = MDAnalysis.Universe(PSF,DCD)
#eg,ev=diffusionmap.diffusionmap(u)
#assert_equal(self.eg.shape, (98,))
#assert_almost_equal(self.eg[0], 1.0)
#assert_almost_equal(self.eg[-1],0.03174182)
#assert_equal(self.ev.shape, (98,98))
#assert_almost_equal(self.ev[0,0], .095836037343022831)
#faster
u = MDAnalysis.Universe(PDB, XTC)
eg,ev=diffusionmap.diffusionmap(u, select='backbone', k=5)
self.eg=eg
self.ev=ev


def test_eg(self):
assert_equal(self.eg.shape, (98,))
assert_equal(self.eg.shape, (10,))
assert_almost_equal(self.eg[0], 1.0)
assert_almost_equal(self.eg[-1],0.03174182)
assert_almost_equal(self.eg[-1],0.03661048812801191)


def test_ev(self):
assert_equal(self.ev.shape, (98,98))
assert_almost_equal(self.ev[0,0], .095836037343022831)
assert_equal(self.ev.shape, (10,10))
assert_almost_equal(self.ev[0,0], -0.30796900898350615)



0 comments on commit b6f8632

Please sign in to comment.