mailr12722 - /branches/relax_data/generic_fns/relax_data.py


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

Header


Content

Posted by edward on March 02, 2011 - 15:56:
Author: bugman
Date: Wed Mar  2 15:56:10 2011
New Revision: 12722

URL: http://svn.gna.org/viewcvs/relax?rev=12722&view=rev
Log:
Fixes for the back end of the relax_data.back_calc() user function.

The missing ri_id arg situation was not being handled and spin container 
ri_data_bc structure was
being constantly overwritten.


Modified:
    branches/relax_data/generic_fns/relax_data.py

Modified: branches/relax_data/generic_fns/relax_data.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_data/generic_fns/relax_data.py?rev=12722&r1=12721&r2=12722&view=diff
==============================================================================
--- branches/relax_data/generic_fns/relax_data.py (original)
+++ branches/relax_data/generic_fns/relax_data.py Wed Mar  2 15:56:10 2011
@@ -82,6 +82,12 @@
     # Specific Ri back-calculate function setup.
     back_calculate = specific_fns.setup.get_specific_fn('back_calc_ri', 
pipes.get_type())
 
+    # The IDs to loop over.
+    if ri_id == None:
+        ri_ids = cdp.ri_ids
+    else:
+        ri_ids = [ri_id]
+
     # Loop over the spins.
     for spin, spin_id in spin_loop(return_id=True):
         # Skip deselected spins.
@@ -92,11 +98,12 @@
         spin_index = find_index(spin_id)
 
         # Initialise the spin data if necessary.
-        if not hasattr(cdp, 'ri_data_bc'):
+        if not hasattr(spin, 'ri_data_bc'):
             spin.ri_data_bc = {}
 
         # Back-calculate the relaxation value.
-        spin.ri_data_bc[ri_id] = back_calculate(spin_index=spin_index, 
ri_id=ri_id, ri_type=ri_type, frq=frq)
+        for ri_id in ri_ids:
+            spin.ri_data_bc[ri_id] = back_calculate(spin_index=spin_index, 
ri_id=ri_id, ri_type=ri_type, frq=frq)
 
 
 def bmrb_read(star, sample_conditions=None):




Related Messages


Powered by MHonArc, Updated Wed Mar 02 16:40:02 2011