mailr25903 - /trunk/auto_analyses/relax_disp_repeat_cpmg.py


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

Header


Content

Posted by tlinnet on September 18, 2014 - 19:00:
Author: tlinnet
Date: Thu Sep 18 19:00:17 2014
New Revision: 25903

URL: http://svn.gna.org/viewcvs/relax?rev=25903&view=rev
Log:
Fix for the testing of method is finished when called.

Task #7826 (https://gna.org/task/index.php?7826): Write an python class for 
the repeated analysis of dispersion data.

Modified:
    trunk/auto_analyses/relax_disp_repeat_cpmg.py

Modified: trunk/auto_analyses/relax_disp_repeat_cpmg.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/auto_analyses/relax_disp_repeat_cpmg.py?rev=25903&r1=25902&r2=25903&view=diff
==============================================================================
--- trunk/auto_analyses/relax_disp_repeat_cpmg.py       (original)
+++ trunk/auto_analyses/relax_disp_repeat_cpmg.py       Thu Sep 18 19:00:17 
2014
@@ -219,6 +219,7 @@
             self.interpreter.pipe.switch(pipe_name)
 
         # Loop over spectrometer frequencies.
+        finished = len(self.sfrqs) * [False]
         for i, sfrq in enumerate(self.sfrqs):
             # Access the key in self.
             key = DIC_KEY_FORMAT % (sfrq)
@@ -240,7 +241,7 @@
 
             # If there is no peak list, then continue.
             if len(peaks_file_list) == 0:
-                finished = False
+                finished[i] = False
                 continue
 
             # There should only be one peak file.
@@ -269,9 +270,9 @@
                     rmsd = float(extract_data(file=rmsd_file)[0][0])
                     self.interpreter.spectrum.baseplane_rmsd(error=rmsd, 
spectrum_id=spectrum_id)
 
-                finished = True
-
-            return finished
+            finished[i] = True
+
+        return all(finished)
 
 
     def do_spectrum_error_analysis(self, pipe_name, set_rep=None):
@@ -318,7 +319,8 @@
         analysis = 'int'
 
         # Loop over the methods.
-        for method in methods:
+        finished = len(methods) * [False]
+        for i, method in enumerate(methods):
             # Change the self key.
             self.set_self(key='method', value=method)
 
@@ -329,10 +331,10 @@
 
                 if not found:
                     calculate = True
-                    finished = False
+                    finished[i] = False
                 elif found:
                     calculate = False
-                    finished = True
+                    finished[i] = True
 
                 if calculate:
                     # Create the data pipe, by copying setup pipe.
@@ -340,9 +342,9 @@
                     self.interpreter.pipe.switch(pipe_name)
 
                     # Call set intensity.
-                    finished = 
self.set_intensity_and_error(pipe_name=pipe_name, glob_ini=glob_ini, 
set_rmsd=set_rmsd)
-
-                    if finished:
+                    finished_int = 
self.set_intensity_and_error(pipe_name=pipe_name, glob_ini=glob_ini, 
set_rmsd=set_rmsd)
+
+                    if finished_int:
                         # Call error analysis.
                         self.do_spectrum_error_analysis(pipe_name=pipe_name, 
set_rep=set_rep)
 
@@ -350,11 +352,13 @@
                         cdp.settings = self.settings
                         self.interpreter.results.write(file=resfile, 
dir=path, force=force)
 
+                        finished[i] = True
+
                     else:
                         pipe_name = pipes.cdp_name()
                         self.interpreter.pipe.delete(pipe_name=pipe_name)
 
-                return finished
+        return all(finished)
 
 
     def calc_r2eff(self, methods=None, list_glob_ini=None, force=False):




Related Messages


Powered by MHonArc, Updated Thu Sep 18 19:20:03 2014