Author: bugman Date: Wed Dec 2 14:42:28 2009 New Revision: 10046 URL: http://svn.gna.org/viewcvs/relax?rev=10046&view=rev Log: Merged revisions 10038-10041 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r10038 | bugman | 2009-12-02 14:14:54 +0100 (Wed, 02 Dec 2009) | 5 lines Added a system test to catch bug #14872 (https://gna.org/bugs/?14872). This is the unicode selection bug reported by Olivier Serve <olivier dott serve att gmail dott com>. ........ r10039 | bugman | 2009-12-02 14:18:48 +0100 (Wed, 02 Dec 2009) | 6 lines Fix for the bug_14872_unicode_selection system test. The system test was creating a pipe called 'mf' in the setUp() method causing model selection to fail. This pipe is now excluded. ........ r10040 | bugman | 2009-12-02 14:24:46 +0100 (Wed, 02 Dec 2009) | 5 lines Added the reverse_euler_zyz() function. This converts forwards rotation Euler angles into reverse rotation Euler angles. ........ r10041 | bugman | 2009-12-02 14:38:47 +0100 (Wed, 02 Dec 2009) | 7 lines Fix for bug #14872 (https://gna.org/bugs/?14872). This is the unicode selection bug reported by Olivier Serve <olivier dott serve att gmail dott com>. The selection string is now converted to a normal string using str() if it is detected to be unicode. ........ Added: branches/multi_processor_merge/test_suite/shared_data/model_free/bug_14872_unicode_selection/ - copied from r10041, 1.3/test_suite/shared_data/model_free/bug_14872_unicode_selection/ branches/multi_processor_merge/test_suite/system_tests/scripts/bug_14872_unicode_selection.py - copied unchanged from r10041, 1.3/test_suite/system_tests/scripts/bug_14872_unicode_selection.py Modified: branches/multi_processor_merge/ (props changed) branches/multi_processor_merge/generic_fns/mol_res_spin.py branches/multi_processor_merge/maths_fns/rotation_matrix.py branches/multi_processor_merge/test_suite/system_tests/model_free.py Propchange: branches/multi_processor_merge/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Wed Dec 2 14:42:28 2009 @@ -1,1 +1,1 @@ -/1.3:1-10032 +/1.3:1-10041 Modified: branches/multi_processor_merge/generic_fns/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/generic_fns/mol_res_spin.py?rev=10046&r1=10045&r2=10046&view=diff ============================================================================== --- branches/multi_processor_merge/generic_fns/mol_res_spin.py (original) +++ branches/multi_processor_merge/generic_fns/mol_res_spin.py Wed Dec 2 14:42:28 2009 @@ -83,6 +83,10 @@ @type select_string: string """ + # Handle Unicode. + if isinstance(select_string, unicode): + select_string = str(select_string) + self._union = None self._intersect = None @@ -1846,6 +1850,10 @@ @rtype: instance of the SpinContainer class. If full_info=True, the type is the tuple (SpinContainer, str, int, str). """ + + # Handle Unicode. + if isinstance(selection, unicode): + selection = str(selection) # The data pipe. if pipe == None: Modified: branches/multi_processor_merge/maths_fns/rotation_matrix.py URL: http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/maths_fns/rotation_matrix.py?rev=10046&r1=10045&r2=10046&view=diff ============================================================================== --- branches/multi_processor_merge/maths_fns/rotation_matrix.py (original) +++ branches/multi_processor_merge/maths_fns/rotation_matrix.py Wed Dec 2 14:42:28 2009 @@ -22,7 +22,7 @@ # Python module imports. from math import acos, asin, atan2, cos, pi, sin, sqrt -from numpy import array, cross, dot, float64, hypot, zeros +from numpy import array, cross, dot, float64, hypot, transpose, zeros from numpy.linalg import norm from random import gauss, uniform @@ -430,6 +430,35 @@ axis[2] = cos(phi) +def reverse_euler_zyz(alpha, beta, gamma): + """Convert the given forward rotation Euler angles into the equivalent reverse rotation Euler angles. + + This if for the z-y-z notation. + + + @param alpha: The alpha Euler angle in rad. + @type alpha: float + @param beta: The beta Euler angle in rad. + @type beta: float + @param gamma: The gamma Euler angle in rad. + @type gamma: float + @return: The alpha, beta, and gamma Euler angles for the reverse rotation. + @rtype: tuple of float + """ + + # Init. + R = zeros((3, 3), float64) + + # Get the rotation. + euler_zyz_to_R(alpha, beta, gamma, R) + + # Reverse rotation. + R = transpose(R) + + # Return the Euler angles. + return R_to_euler_zyz(R) + + def quaternion_to_axis_angle(quat): """Convert a quaternion into the axis-angle notation. Modified: branches/multi_processor_merge/test_suite/system_tests/model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/test_suite/system_tests/model_free.py?rev=10046&r1=10045&r2=10046&view=diff ============================================================================== --- branches/multi_processor_merge/test_suite/system_tests/model_free.py (original) +++ branches/multi_processor_merge/test_suite/system_tests/model_free.py Wed Dec 2 14:42:28 2009 @@ -157,6 +157,13 @@ # Check that they are equal (converting to strings to avoid comparison nastiness). self.assertEqual(str(sub_obj1), str(sub_obj2)) + + + def test_bug_14872_unicode_selection(self): + """Test catching bug #14872, the unicode string selection failure as submitted by Olivier Serve.""" + + # Execute the script. + self.relax.interpreter.run(script_file=sys.path[-1] + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'bug_14872_unicode_selection.py') def test_bugs_12582_12591_12607(self):