Skip to content

Commit

Permalink
added tests, fixed logger issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jdetle committed May 30, 2016
1 parent f1dd6e2 commit 86e0525
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion package/MDAnalysis/analysis/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ def rotation_matrix(a, b, weights=None):

rot = np.zeros(9, dtype=np.float64)
rmsd = qcp.CalcRMSDRotationalMatrix(a.T, b.T, N, rot, weights)
logger.info("qcp: %d", rmsd)
return np.matrix(rot.reshape(3, 3)), rmsd


Expand Down
17 changes: 9 additions & 8 deletions testsuite/MDAnalysisTests/analysis/test_diffusionmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,21 @@ def __init__(self):
#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
dmap = diffusionmap.DiffusionMap(u, select='backbone', k = 5)
dmap.run()
self.eigvals = dmap.eigenvalues
self.eigvects = dmap.eigenvectors


def test_eg(self):
assert_equal(self.eg.shape, (10, ))
assert_almost_equal(self.eg[0], 1.0, decimal=5)
assert_almost_equal(self.eg[-1], 0.0142, decimal = 3)
assert_equal(self.eigvals.shape, (10, ))
assert_almost_equal(self.eigvals[0], 1.0, decimal=5)
assert_almost_equal(self.eigvals[-1], 0.0142, decimal = 3)


def test_ev(self):
assert_equal(self.ev.shape, (10, 10))
assert_almost_equal(self.ev[0, 0], -0.3019, decimal = 2)
assert_equal(self.eigvects.shape, (10, 10))
assert_almost_equal(self.eigvects[0, 0], -0.3019, decimal = 2)



0 comments on commit 86e0525

Please sign in to comment.