Author: bugman Date: Thu Mar 27 16:43:56 2014 New Revision: 22564 URL: http://svn.gna.org/viewcvs/relax?rev=22564&view=rev Log: Merged revisions 22560-22562 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r22560 | bugman | 2014-03-27 11:20:20 +0100 (Thu, 27 Mar 2014) | 6 lines Modified the python_multiversion_test_suite.py script to run the relax information printout. This is to test out the info module on multiple Python versions and to have a record of the setup of each Python version. ........ r22561 | bugman | 2014-03-27 11:27:34 +0100 (Thu, 27 Mar 2014) | 6 lines Python 3 fixes for the info module. The new processor_name() function was not compatible with Python 3 as the text read from STDOUT needs to be 'decoded'. ........ r22562 | bugman | 2014-03-27 15:47:52 +0100 (Thu, 27 Mar 2014) | 3 lines The variables in the relax_fit.h file are now all static. ........ Modified: branches/double_rotor/ (props changed) branches/double_rotor/devel_scripts/python_multiversion_test_suite.py branches/double_rotor/info.py branches/double_rotor/target_functions/relax_fit.h Propchange: branches/double_rotor/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Mar 27 16:43:56 2014 @@ -1 +1 @@ -/trunk:1-22559 +/trunk:1-22563 Modified: branches/double_rotor/devel_scripts/python_multiversion_test_suite.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/devel_scripts/python_multiversion_test_suite.py?rev=22564&r1=22563&r2=22564&view=diff ============================================================================== --- branches/double_rotor/devel_scripts/python_multiversion_test_suite.py (original) +++ branches/double_rotor/devel_scripts/python_multiversion_test_suite.py Thu Mar 27 16:43:56 2014 @@ -80,5 +80,8 @@ # Build the C modules for the current Python version. execute_sh('devel_scripts/manual_c_module.py %s' % (version), log=LOG, err=LOG) + # Run the relax information printout, for testing that code path. + execute_sh('~/bin/python%s relax -i' % (version), log=LOG, err=LOG) + # Run the test suite. execute_sh('~/bin/python%s relax -x' % (version), log=LOG, err=LOG) Modified: branches/double_rotor/info.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/info.py?rev=22564&r1=22563&r2=22564&view=diff ============================================================================== --- branches/double_rotor/info.py (original) +++ branches/double_rotor/info.py Thu Mar 27 16:43:56 2014 @@ -38,7 +38,7 @@ Structure = object from os import environ, pathsep, waitpid import platform -from re import sub +from re import search, sub PIPE, Popen = None, None if dep_check.subprocess_module: from subprocess import PIPE, Popen @@ -559,7 +559,12 @@ # Loop over the lines, returning the first model name with the leading "model name :" text stripped. for line in data: - if "model name" in line: + # Decode Python 3 byte arrays. + if hasattr(line, 'decode'): + line = line.decode() + + # Find the processor name. + if search("model name", line): # Convert the text. name = sub(".*model name.*:", "", line, 1) name = name.strip() @@ -588,8 +593,14 @@ # Get the STDOUT data. data = pipe.stdout.readlines() + # Decode Python 3 byte arrays. + string = data[0] + if hasattr(string, 'decode'): + string = string.decode() + + # Find the processor name. # Return the string. - return data[0].strip() + return string.strip() # Nothing. except: Modified: branches/double_rotor/target_functions/relax_fit.h URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/target_functions/relax_fit.h?rev=22564&r1=22563&r2=22564&view=diff ============================================================================== --- branches/double_rotor/target_functions/relax_fit.h (original) +++ branches/double_rotor/target_functions/relax_fit.h Thu Mar 27 16:43:56 2014 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2013 Edward d'Auvergne + * Copyright (C) 2006-2014 Edward d'Auvergne * * This file is part of the program relax (http://www.nmr-relax.com). * @@ -35,12 +35,12 @@ /****************************************/ /* Variables sent to the setup function to be stored for later use */ -int num_params, num_times; +static int num_params, num_times; /* Variables used for storage during the function calls of optimisation */ -double back_calc[MAXTIMES]; -double params[MAXPARAMS]; -double values[MAXTIMES]; -double sd[MAXTIMES]; -double relax_times[MAXTIMES]; -double scaling_matrix[MAXPARAMS]; +static double back_calc[MAXTIMES]; +static double params[MAXPARAMS]; +static double values[MAXTIMES]; +static double sd[MAXTIMES]; +static double relax_times[MAXTIMES]; +static double scaling_matrix[MAXPARAMS];