Author: bugman Date: Fri Jun 7 00:28:44 2013 New Revision: 19930 URL: http://svn.gna.org/viewcvs/relax?rev=19930&view=rev Log: Python 3 fixes for the relax_disp.cpmg_frq and relax_disp.spin_lock_field user functions. The sorting of lists with None is not supported by Python 3, so this has to be carefully handled. Modified: branches/relax_disp/specific_analyses/relax_disp/disp_data.py Modified: branches/relax_disp/specific_analyses/relax_disp/disp_data.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/disp_data.py?rev=19930&r1=19929&r2=19930&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/disp_data.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/disp_data.py Fri Jun 7 00:28:44 2013 @@ -139,7 +139,15 @@ # The unique curves for the R2eff fitting (CPMG). if cdp.cpmg_frqs[spectrum_id] not in cdp.cpmg_frqs_list: cdp.cpmg_frqs_list.append(cdp.cpmg_frqs[spectrum_id]) + + # Sort the list (handling None for Python 3). + flag = False + if None in cdp.cpmg_frqs_list: + cdp.cpmg_frqs_list.pop(cdp.cpmg_frqs_list.index(None)) + flag = True cdp.cpmg_frqs_list.sort() + if flag: + cdp.cpmg_frqs_list.insert(0, None) # Update the exponential curve count (skipping the reference if present). cdp.dispersion_points = len(cdp.cpmg_frqs_list) @@ -711,7 +719,15 @@ # The unique curves for the R2eff fitting (R1rho). if cdp.spin_lock_nu1[spectrum_id] not in cdp.spin_lock_nu1_list: cdp.spin_lock_nu1_list.append(cdp.spin_lock_nu1[spectrum_id]) + + # Sort the list (handling None for Python 3). + flag = False + if None in cdp.spin_lock_nu1_list: + cdp.spin_lock_nu1_list.pop(cdp.spin_lock_nu1_list.index(None)) + flag = True cdp.spin_lock_nu1_list.sort() + if flag: + cdp.spin_lock_nu1_list.insert(0, None) # Update the exponential curve count (skipping the reference if present). cdp.dispersion_points = len(cdp.spin_lock_nu1_list)