mailr17705 - /trunk/specific_fns/relax_fit.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on October 05, 2012 - 19:48:
Author: bugman
Date: Fri Oct  5 19:48:03 2012
New Revision: 17705

URL: http://svn.gna.org/viewcvs/relax?rev=17705&view=rev
Log:
The relax_fit specific analysis module now supports both Python 2 and 3.

The command used was:
2to3 -w specific_fns/relax_fit.py


Modified:
    trunk/specific_fns/relax_fit.py

Modified: trunk/specific_fns/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_fns/relax_fit.py?rev=17705&r1=17704&r2=17705&view=diff
==============================================================================
--- trunk/specific_fns/relax_fit.py (original)
+++ trunk/specific_fns/relax_fit.py Fri Oct  5 19:48:03 2012
@@ -184,7 +184,7 @@
         scaling_matrix = self._assemble_scaling_matrix(spin=spin, 
scaling=False)
 
         # The keys.
-        keys = spin.intensities.keys()
+        keys = list(spin.intensities.keys())
 
         # The peak intensities and times.
         values = []
@@ -341,7 +341,7 @@
                 elif search('^I', spin.params[i]):
                     # Find the ID of the first time point.
                     min_time = min(cdp.relax_times.values())
-                    for key in cdp.relax_times.keys():
+                    for key in list(cdp.relax_times.keys()):
                         if cdp.relax_times[key] == min_time:
                             id = key
                             break
@@ -541,7 +541,7 @@
             raise RelaxNoModelError
 
         # Loop over the spectral time points.
-        for id in cdp.relax_times.keys():
+        for id in list(cdp.relax_times.keys()):
             # Back calculate the value.
             value = self._back_calc(spin=spin, relax_time_id=id)
 
@@ -687,7 +687,7 @@
             ######################################
 
             # The keys.
-            keys = spin.intensities.keys()
+            keys = list(spin.intensities.keys())
 
             # The peak intensities and times.
             values = []
@@ -843,7 +843,7 @@
 
             # Check that the number of relaxation times is complete.
             if len(spin.intensities) != len(cdp.relax_times):
-                raise RelaxError("The %s peak intensity points of the spin 
'%s' does not match the expected number of %s (the IDs %s do not match %s)." 
% (len(spin.intensities), spin_id, len(cdp.relax_times), 
spin.intensities.keys(), cdp.relax_times.keys()))
+                raise RelaxError("The %s peak intensity points of the spin 
'%s' does not match the expected number of %s (the IDs %s do not match %s)." 
% (len(spin.intensities), spin_id, len(cdp.relax_times), 
list(spin.intensities.keys()), list(cdp.relax_times.keys())))
 
         # Final printout.
         if verbose and not deselect_flag:




Related Messages


Powered by MHonArc, Updated Sun Oct 07 15:20:02 2012