From b6f8632754831e3c6d6600b4e04fce6f986d40c4 Mon Sep 17 00:00:00 2001 From: Eugen Hruska Date: Wed, 2 Mar 2016 15:55:50 -0600 Subject: [PATCH] diffusionmap faster test --- .../analysis/test_diffusionmap.py | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/testsuite/MDAnalysisTests/analysis/test_diffusionmap.py b/testsuite/MDAnalysisTests/analysis/test_diffusionmap.py index 9344b011d87..b49e9760e4c 100644 --- a/testsuite/MDAnalysisTests/analysis/test_diffusionmap.py +++ b/testsuite/MDAnalysisTests/analysis/test_diffusionmap.py @@ -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 @@ -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)