Author: bugman Date: Thu Jul 31 10:01:28 2014 New Revision: 24867 URL: http://svn.gna.org/viewcvs/relax?rev=24867&view=rev Log: Merged revisions 24857,24866 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r24857 | tlinnet | 2014-07-30 21:03:11 +0200 (Wed, 30 Jul 2014) | 6 lines Fix for replacing reduce function. This is a Python 3 fix, where this function has been removed. This was reported as a necessity in thread: http://thread.gmane.org/gmane.science.nmr.relax.devel/6544 ........ r24866 | bugman | 2014-07-31 08:40:11 +0200 (Thu, 31 Jul 2014) | 5 lines Added a minfx minimum version check to the dep_check module. This is to avoid problems such as that reported at bug #22408 (http://gna.org/bugs/?22408). ........ Modified: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/dep_check.py branches/frame_order_cleanup/specific_analyses/relax_disp/optimisation.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Jul 31 10:01:28 2014 @@ -1 +1 @@ -/trunk:1-24843 +/trunk:1-24866 Modified: branches/frame_order_cleanup/dep_check.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/dep_check.py?rev=24867&r1=24866&r2=24867&view=diff ============================================================================== --- branches/frame_order_cleanup/dep_check.py (original) +++ branches/frame_order_cleanup/dep_check.py Thu Jul 31 10:01:28 2014 @@ -54,6 +54,10 @@ # Minfx python package check. try: import minfx + ver = minfx.__version__.split('.') + if not (minfx.__version__ == 'trunk' or (int(ver[0]) <= 1 and int(ver[1]) <= 0 and int(ver[2]) <= 9)): + sys.stderr.write("Version %s of the 'minfx' dependency is too old, minfx >= 1.0.9 is required.\n" % minfx.__version__) + sys.exit() except ImportError: sys.stderr.write("The dependency 'minfx' has not been installed (see https://gna.org/projects/minfx/).\n") sys.exit() Modified: branches/frame_order_cleanup/specific_analyses/relax_disp/optimisation.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/relax_disp/optimisation.py?rev=24867&r1=24866&r2=24867&view=diff ============================================================================== --- branches/frame_order_cleanup/specific_analyses/relax_disp/optimisation.py (original) +++ branches/frame_order_cleanup/specific_analyses/relax_disp/optimisation.py Thu Jul 31 10:01:28 2014 @@ -322,7 +322,10 @@ # Grid search printout. if match('^[Gg]rid', min_algor): - print("Unconstrained grid search size: %s (constraints may decrease this size).\n" % reduce(mul, inc, 1)) + result = 1 + for x in inc: + result = mul(result, x) + print("Unconstrained grid search size: %s (constraints may decrease this size).\n" % result) # The peak intensities, errors and times. values = [] @@ -552,7 +555,10 @@ # Grid search printout. if search('^[Gg]rid', self.min_algor): - print("Unconstrained grid search size: %s (constraints may decrease this size).\n" % reduce(mul, self.inc, 1)) + result = 1 + for x in self.inc: + result = mul(result, x) + print("Unconstrained grid search size: %s (constraints may decrease this size).\n" % result) # Initialise the function to minimise. model = Dispersion(model=self.spins[0].model, num_params=self.param_num, num_spins=count_spins(self.spins), num_frq=len(self.fields), exp_types=self.exp_types, values=self.values, errors=self.errors, missing=self.missing, frqs=self.frqs, frqs_H=self.frqs_H, cpmg_frqs=self.cpmg_frqs, spin_lock_nu1=self.spin_lock_nu1, chemical_shifts=self.chemical_shifts, offset=self.offsets, tilt_angles=self.tilt_angles, r1=self.r1, relax_times=self.relax_times, scaling_matrix=self.scaling_matrix)