mailr28208 - /trunk/test_suite/system_tests/structure.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on May 12, 2016 - 11:46:
Author: bugman
Date: Thu May 12 11:46:15 2016
New Revision: 28208

URL: http://svn.gna.org/viewcvs/relax?rev=28208&view=rev
Log:
Mac OS X fixes for the Structure.test_pca and Structure.test_pca_observers 
system tests.

The eigenvectors on this OS are sometimes inverted.  As the sign of the 
eigenvector is irrelevant,
the vectors hardcoded into the system tests are now inverted as required.


Modified:
    trunk/test_suite/system_tests/structure.py

Modified: trunk/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/structure.py?rev=28208&r1=28207&r2=28208&view=diff
==============================================================================
--- trunk/test_suite/system_tests/structure.py  (original)
+++ trunk/test_suite/system_tests/structure.py  Thu May 12 11:46:15 2016
@@ -21,7 +21,7 @@
 
 # Python module imports.
 from math import sqrt
-from numpy import array, average, dot, float64, std, zeros
+from numpy import array, average, dot, float64, sign, std, zeros
 from numpy.linalg import norm
 from os import sep
 from re import search
@@ -4150,6 +4150,11 @@
         proj[:, 2] = -proj[:, 2]
         proj[:, 3] = -proj[:, 3]
 
+        # Are more inversion necessary?
+        for mode in range(4):
+            if sign(cdp.structure.pca_proj[mode][0]) != sign(proj[0][mode]):
+                proj[:, mode] = -proj[:, mode]
+
         # Checks.
         self.assert_(hasattr(cdp.structure, 'pca_values'))
         self.assert_(hasattr(cdp.structure, 'pca_vectors'))
@@ -4180,6 +4185,11 @@
         # Invert the 3rd and 4th Gromacs eigenvectors to match.
         proj[:, 2] = -proj[:, 2]
         proj[:, 3] = -proj[:, 3]
+
+        # Are more inversion necessary?
+        for mode in range(4):
+            if sign(cdp.structure.pca_proj[mode][0]) != sign(proj[0][mode]):
+                proj[:, mode] = -proj[:, mode]
 
         # Checks.
         self.assert_(hasattr(cdp.structure, 'pca_values'))




Related Messages


Powered by MHonArc, Updated Fri May 13 16:20:15 2016