Author: bugman Date: Tue Oct 16 11:21:55 2012 New Revision: 17848 URL: http://svn.gna.org/viewcvs/relax?rev=17848&view=rev Log: Python 3 fixes for the Frame Order testing branch. This includes print statement removal and updates of the all raise statement syntax. Modified: branches/frame_order_testing/extern/sobol/sobol_lib.py branches/frame_order_testing/maths_fns/frame_order/iso_cone.py branches/frame_order_testing/maths_fns/frame_order/iso_cone_torsionless.py branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse_torsionless.py branches/frame_order_testing/maths_fns/frame_order/rotor.py branches/frame_order_testing/specific_fns/frame_order.py Modified: branches/frame_order_testing/extern/sobol/sobol_lib.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/extern/sobol/sobol_lib.py?rev=17848&r1=17847&r2=17848&view=diff ============================================================================== --- branches/frame_order_testing/extern/sobol/sobol_lib.py (original) +++ branches/frame_order_testing/extern/sobol/sobol_lib.py Tue Oct 16 11:21:55 2012 @@ -315,10 +315,10 @@ # Check parameters. # if ( dim_num < 1 or dim_max < dim_num ): - print 'I4_SOBOL - Fatal error!' - print ' The spatial dimension DIM_NUM should satisfy:' - print ' 1 <= DIM_NUM <= %d'%dim_max - print ' But this input value is DIM_NUM = %d'%dim_num + print('I4_SOBOL - Fatal error!') + print(' The spatial dimension DIM_NUM should satisfy:') + print(' 1 <= DIM_NUM <= %d'%dim_max) + print(' But this input value is DIM_NUM = %d'%dim_num) return dim_num_save = dim_num @@ -412,10 +412,10 @@ # Check that the user is not calling too many times! # if ( maxcol < l ): - print 'I4_SOBOL - Fatal error!' - print ' Too many calls!' - print ' MAXCOL = %d\n'%maxcol - print ' L = %d\n'%l + print('I4_SOBOL - Fatal error!') + print(' Too many calls!') + print(' MAXCOL = %d\n'%maxcol) + print(' L = %d\n'%l) return # # Calculate the new components of QUASI. @@ -487,8 +487,8 @@ # Output, integer SEED, the updated seed. # if ( seed == 0 ): - print 'I4_UNIFORM - Fatal error!' - print ' Input SEED = 0!' + print('I4_UNIFORM - Fatal error!') + print(' Input SEED = 0!') seed = math.floor ( seed ) a = round ( a ) @@ -602,4 +602,4 @@ return False p+=1 return True - + Modified: branches/frame_order_testing/maths_fns/frame_order/iso_cone.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/frame_order/iso_cone.py?rev=17848&r1=17847&r2=17848&view=diff ============================================================================== --- branches/frame_order_testing/maths_fns/frame_order/iso_cone.py (original) +++ branches/frame_order_testing/maths_fns/frame_order/iso_cone.py Tue Oct 16 11:21:55 2012 @@ -164,7 +164,7 @@ if error_flag: pcs_theta_err[i, j] = abs(pcs_theta_err[i, j] / float(num) - pcs_theta[i, j]**2) / float(num) pcs_theta_err[i, j] = c[i] * sqrt(pcs_theta_err[i, j]) - print "%8.3f +/- %-8.3f" % (pcs_theta[i, j]*1e6, pcs_theta_err[i, j]*1e6) + print("%8.3f +/- %-8.3f" % (pcs_theta[i, j]*1e6, pcs_theta_err[i, j]*1e6)) def populate_1st_eigenframe_iso_cone(matrix, angle): Modified: branches/frame_order_testing/maths_fns/frame_order/iso_cone_torsionless.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/frame_order/iso_cone_torsionless.py?rev=17848&r1=17847&r2=17848&view=diff ============================================================================== --- branches/frame_order_testing/maths_fns/frame_order/iso_cone_torsionless.py (original) +++ branches/frame_order_testing/maths_fns/frame_order/iso_cone_torsionless.py Tue Oct 16 11:21:55 2012 @@ -183,4 +183,4 @@ if error_flag: pcs_theta_err[i, j] = abs(pcs_theta_err[i, j] / float(num) - pcs_theta[i, j]**2) / float(num) pcs_theta_err[i, j] = c[i] * sqrt(pcs_theta_err[i, j]) - print "%8.3f +/- %-8.3f" % (pcs_theta[i, j]*1e6, pcs_theta_err[i, j]*1e6) + print("%8.3f +/- %-8.3f" % (pcs_theta[i, j]*1e6, pcs_theta_err[i, j]*1e6)) Modified: branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse_torsionless.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse_torsionless.py?rev=17848&r1=17847&r2=17848&view=diff ============================================================================== --- branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse_torsionless.py (original) +++ branches/frame_order_testing/maths_fns/frame_order/pseudo_ellipse_torsionless.py Tue Oct 16 11:21:55 2012 @@ -370,4 +370,4 @@ if error_flag: pcs_theta_err[i, j] = abs(pcs_theta_err[i, j] / float(num) - pcs_theta[i, j]**2) / float(num) pcs_theta_err[i, j] = c[i] * sqrt(pcs_theta_err[i, j]) - print "%8.3f +/- %-8.3f" % (pcs_theta[i, j]*1e6, pcs_theta_err[i, j]*1e6) + print("%8.3f +/- %-8.3f" % (pcs_theta[i, j]*1e6, pcs_theta_err[i, j]*1e6)) Modified: branches/frame_order_testing/maths_fns/frame_order/rotor.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/frame_order/rotor.py?rev=17848&r1=17847&r2=17848&view=diff ============================================================================== --- branches/frame_order_testing/maths_fns/frame_order/rotor.py (original) +++ branches/frame_order_testing/maths_fns/frame_order/rotor.py Tue Oct 16 11:21:55 2012 @@ -187,7 +187,7 @@ if error_flag: pcs_theta_err[i, j] = abs(pcs_theta_err[i, j] / float(num) - pcs_theta[i, j]**2) / float(num) pcs_theta_err[i, j] = c[i] * sqrt(pcs_theta_err[i, j]) - print "%8.3f +/- %-8.3f" % (pcs_theta[i, j]*1e6, pcs_theta_err[i, j]*1e6) + print("%8.3f +/- %-8.3f" % (pcs_theta[i, j]*1e6, pcs_theta_err[i, j]*1e6)) def pcs_pivot_motion_rotor(sigma_i, r_pivot_atom, r_ln_pivot, A, R_eigen, RT_eigen, Ri_prime): Modified: branches/frame_order_testing/specific_fns/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/specific_fns/frame_order.py?rev=17848&r1=17847&r2=17848&view=diff ============================================================================== --- branches/frame_order_testing/specific_fns/frame_order.py (original) +++ branches/frame_order_testing/specific_fns/frame_order.py Tue Oct 16 11:21:55 2012 @@ -822,11 +822,11 @@ # Check. if unit_vect[rdc_index] != None and len(unit_vect[rdc_index]) != num: - raise RelaxError, "The number of interatomic vectors for all no match:\n%s" % unit_vect + raise RelaxError("The number of interatomic vectors for all no match:\n%s" % unit_vect) # Missing unit vectors. if num == None: - raise RelaxError, "No interatomic vectors could be found." + raise RelaxError("No interatomic vectors could be found.") # Update None entries. for i in range(len(unit_vect)):