Author: bugman Date: Mon Feb 10 10:47:58 2014 New Revision: 22167 URL: http://svn.gna.org/viewcvs/relax?rev=22167&view=rev Log: Merged revisions 22155-22164 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r22155 | bugman | 2014-02-07 17:03:36 +0100 (Fri, 07 Feb 2014) | 7 lines Loosened the checks of some of the Relax_fit system tests. These are the Relax_fit.test_curve_fitting_height and Relax_fit.test_curve_fitting_volume system tests. The minor change is required to allow the tests to pass on a 32-bit system with Python 3.3.3. ........ r22156 | bugman | 2014-02-07 17:46:05 +0100 (Fri, 07 Feb 2014) | 5 lines The python_seek.py development script now allows the modules to be specified on the command line. This speeds up the script and allows individual modules to be checked and the version displayed. ........ r22157 | bugman | 2014-02-07 17:48:28 +0100 (Fri, 07 Feb 2014) | 6 lines Added a copyright notice to the python_seek.py script. The descriptive text has also been converted into a docstring. The copyright is simply to show who wrote the script and how old it is. ........ r22158 | bugman | 2014-02-07 17:54:29 +0100 (Fri, 07 Feb 2014) | 3 lines The python_seek.py script can now check for the ancient Numeric module. ........ r22159 | bugman | 2014-02-07 17:55:41 +0100 (Fri, 07 Feb 2014) | 3 lines The python_seek.py script can now check for the ancient Scientific module. ........ r22160 | bugman | 2014-02-07 18:14:41 +0100 (Fri, 07 Feb 2014) | 3 lines The python_seek.py now lists the Python version again (broken in the last few commits). ........ r22161 | bugman | 2014-02-07 18:18:06 +0100 (Fri, 07 Feb 2014) | 3 lines The python_seek.py script now accepts the 'all' argument to display all modules supported by the script. ........ r22162 | bugman | 2014-02-07 18:20:06 +0100 (Fri, 07 Feb 2014) | 3 lines Output formatting improvements for the python_seek.py development script. ........ r22163 | bugman | 2014-02-07 18:47:33 +0100 (Fri, 07 Feb 2014) | 3 lines Changed the module ordering in the python_seek.py development script. ........ r22164 | bugman | 2014-02-10 08:24:11 +0100 (Mon, 10 Feb 2014) | 3 lines Epydoc docstring fix for the pipe_control.structure.main.load_spins() function. ........ Modified: branches/double_rotor/ (props changed) branches/double_rotor/devel_scripts/python_seek.py branches/double_rotor/pipe_control/structure/main.py branches/double_rotor/test_suite/system_tests/relax_fit.py Propchange: branches/double_rotor/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Mon Feb 10 10:47:58 2014 @@ -1,1 +1,1 @@ -/trunk:1-22153 +/trunk:1-22153,22155-22164 Modified: branches/double_rotor/devel_scripts/python_seek.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/devel_scripts/python_seek.py?rev=22167&r1=22166&r2=22167&view=diff ============================================================================== --- branches/double_rotor/devel_scripts/python_seek.py (original) +++ branches/double_rotor/devel_scripts/python_seek.py Mon Feb 10 10:47:58 2014 @@ -1,7 +1,30 @@ #! /usr/bin/env python -# Script for finding all Python binaries on the system and to print out various package versions. -# This requires access to a shell and the locate, grep, and other programs. +############################################################################### +# # +# Copyright (C) 2013-2014 Edward d'Auvergne # +# # +# This file is part of the program relax (http://www.nmr-relax.com). # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see <http://www.gnu.org/licenses/>. # +# # +############################################################################### + +"""Script for finding all Python binaries on the system and to print out various package versions. + +This requires access to a shell and the locate, grep, and other programs. +""" # Python module imports. @@ -10,11 +33,36 @@ from subprocess import PIPE, Popen import sys +# The default module list. +MOD_LIST = [ + 'python', + 'minfx', + 'bmrblib', + 'numpy', + 'scipy', + 'wx', + 'mpi4py', + 'epydoc' +] + +MOD_ALL_LIST = [ + 'python', + 'minfx', + 'bmrblib', + 'Numeric', + 'Scientific', + 'numpy', + 'scipy', + 'wx', + 'mpi4py', + 'epydoc' +] + class Python_info: """Find all Python versions and the supported modules.""" - def __init__(self, format=" %-10s %-20s", debug=False): + def __init__(self, format=" %-15s %-20s", debug=False): """Set up and run.""" # Store the args. @@ -23,6 +71,9 @@ # Get a list of all Python binaries. files = self.get_files() + + # The modules to find. + self.modules() # Loop over the binaries. for file in files: @@ -30,14 +81,26 @@ print("Testing %s:" % file) # Determine and print out the version info. - self.version_python(file) - self.version_minfx(file) - self.version_bmrblib(file) - self.version_numpy(file) - self.version_scipy(file) - self.version_wx(file) - self.version_mpi4py(file) - self.version_epydoc(file) + if 'python' in self.module_list: + self.version_python(file) + if 'minfx' in self.module_list: + self.version_minfx(file) + if 'bmrblib' in self.module_list: + self.version_bmrblib(file) + if 'Numeric' in self.module_list: + self.version_numeric(file) + if 'Scientific' in self.module_list: + self.version_scientific(file) + if 'numpy' in self.module_list: + self.version_numpy(file) + if 'scipy' in self.module_list: + self.version_scipy(file) + if 'wx' in self.module_list: + self.version_wx(file) + if 'mpi4py' in self.module_list: + self.version_mpi4py(file) + if 'epydoc' in self.module_list: + self.version_epydoc(file) def execute(self, label=None, file=None, commands=None): @@ -129,6 +192,29 @@ return binaries + def modules(self): + """Determine the modules to find.""" + + # Arguments supplied, so use these. + if len(sys.argv) > 1: + # The special 'all' argument. + if sys.argv[1] == 'all': + self.module_list = MOD_ALL_LIST + + # Individual modules. + else: + # Initialise the list. + self.module_list = [] + + # Loop over the arguments. + for i in range(1, len(sys.argv)): + self.module_list.append(sys.argv[i]) + + # Use the defaults. + else: + self.module_list = MOD_LIST + + def version_bmrblib(self, file=None): """Determine and print out the bmrblib module version info.""" @@ -203,6 +289,23 @@ self.execute(label="mpi4py:", file=file, commands=commands) + def version_numeric(self, file=None): + """Determine and print out the Numeric module version info.""" + + # The commands. + commands = [ + "try:\n", + " import Numeric\n", + " version = Numeric.__version__\n", + "except:\n", + " version = '-'\n", + "print(version)\n", + ] + + # Execute and print the version + self.execute(label="Numeric:", file=file, commands=commands) + + def version_numpy(self, file=None): """Determine and print out the numpy module version info.""" @@ -218,6 +321,23 @@ # Execute and print the version self.execute(label="numpy:", file=file, commands=commands) + + + def version_scientific(self, file=None): + """Determine and print out the Scientific module version info.""" + + # The commands. + commands = [ + "try:\n", + " import Scientific\n", + " version = Scientific.__version__\n", + "except:\n", + " version = '-'\n", + "print(version)\n", + ] + + # Execute and print the version + self.execute(label="Scientific:", file=file, commands=commands) def version_scipy(self, file=None): Modified: branches/double_rotor/pipe_control/structure/main.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/pipe_control/structure/main.py?rev=22167&r1=22166&r2=22167&view=diff ============================================================================== --- branches/double_rotor/pipe_control/structure/main.py (original) +++ branches/double_rotor/pipe_control/structure/main.py Mon Feb 10 10:47:58 2014 @@ -546,8 +546,8 @@ @type spin_id: str @keyword str_id: The structure identifier. This can be the file name, model number, or structure number. @type str_id: int or str - @keyword mol_name: The name of target molecule container, overriding the name of the loaded structures - @type mol_name: str or None + @keyword mol_name_target: The name of target molecule container, overriding the name of the loaded structures + @type mol_name_target: str or None @keyword ave_pos: A flag specifying if the average atom position or the atom position from all loaded structures is loaded into the SpinContainer. @type ave_pos: bool """ Modified: branches/double_rotor/test_suite/system_tests/relax_fit.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/test_suite/system_tests/relax_fit.py?rev=22167&r1=22166&r2=22167&view=diff ============================================================================== --- branches/double_rotor/test_suite/system_tests/relax_fit.py (original) +++ branches/double_rotor/test_suite/system_tests/relax_fit.py Mon Feb 10 10:47:58 2014 @@ -82,7 +82,7 @@ # Check the errors. for key in cdp.sigma_I: - self.assertEqual(cdp.sigma_I[key], 10578.039482421433) + self.assertEqual(cdp.sigma_I[key], 10578.039482421433, 6) self.assertEqual(cdp.var_I[key], 111894919.29166669) # Spin data check.