mailRe: r4650 - /branches/consistency_tests_1.3/specific_fns/consistency_tests.py


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

Header


Content

Posted by Edward d'Auvergne on January 11, 2008 - 19:43:
On Jan 11, 2008 6:03 PM,  <sebastien.morin.1@xxxxxxxxx> wrote:
Author: semor
Date: Fri Jan 11 18:02:57 2008
New Revision: 4650

URL: http://svn.gna.org/viewcvs/relax?rev=4650&view=rev
Log:
Continued the shifting of the consistency tests code to the new relax 
design started at r4583.


Modified:
    branches/consistency_tests_1.3/specific_fns/consistency_tests.py

Modified: branches/consistency_tests_1.3/specific_fns/consistency_tests.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/consistency_tests_1.3/specific_fns/consistency_tests.py?rev=4650&r1=4649&r2=4650&view=diff
==============================================================================
--- branches/consistency_tests_1.3/specific_fns/consistency_tests.py 
(original)
+++ branches/consistency_tests_1.3/specific_fns/consistency_tests.py Fri 
Jan 11 18:02:57 2008
@@ -49,7 +49,7 @@
             raise RelaxError, "The frequency has not been set up."

         # Test if the sequence data is loaded.
-        if not relax_data_store.res.has_key(self.run):
+        if not cdp.res.has_key:

The data structure 'res' no longer exists in the PipeContainer.  It is
replaced by this (these are the classes, not the actual names):

PipeContainer.MoleculeList[MoleculeContainer].ResidueList[ResidueContainer].SpinList[SpinContainer]

These are defined in the 'data' directory.  In variable form, this
might look like:

cdp.mol[i].res[j].spin[k]

Because of this complexity, I have written the function
exists_mol_res_spin_data().  This is located in the
generic_fns.selection module.


@@ -76,8 +76,8 @@
                 raise RelaxNoValueError, "correlation time"

         # Frequency index.
-        if relax_data_store.ct_frq[self.run] not in 
relax_data_store.frq[self.run]:
-            raise RelaxError, "No relaxation data corresponding to the 
frequency " + `relax_data_store.ct_frq[self.run]` + " has been loaded."
+        if cdp.ct_frq not in cdp.frq:
+            raise RelaxError, "No relaxation data corresponding to the 
frequency " + `cdp.ct_frq` + " has been loaded."

         # Consistency testing.
         for spin in spin_loop(spin_id):
@@ -91,7 +91,7 @@
             # Residue specific frequency index.
             frq_index = None
             for j in xrange(data.num_frq):
-                if data.frq[j] == relax_data_store.ct_frq[self.run]:
+                if data.frq[j] == cdp.ct_frq:
                     frq_index = j
             if frq_index == None:
                 continue

In this spin loop, all 'data' variables should be replaced with
'spin'.  The "data = cdp" statement should also be removed.


@@ -129,7 +129,7 @@
                 continue

             # Initialise the function to calculate.
-            self.ct = Consistency(frq=relax_data_store.ct_frq[self.run], 
gx=relax_data_store.gx, gh=relax_data_store.gh, mu0=relax_data_store.mu0, 
h_bar=relax_data_store.h_bar)
+            self.ct = Consistency(frq=cdp.ct_frq, gx=relax_data_store.gx, 
gh=relax_data_store.gh, mu0=relax_data_store.mu0, 
h_bar=relax_data_store.h_bar)

             # Calculate the consistency tests values.
             j0, f_eta, f_r2 = self.ct.func(orientation=data.orientation, 
tc=data.tc, r=data.r, csa=data.csa, r1=r1, r2=r2, noe=noe)

The "relax_data_store.gx" should be replaced by "spin.gx".  This is
because gx is a spin specific parameter.  Also, as mu0 and h_bar are
now defined in the physical_constants module, these do not need to be
passed in as arguments.  The necessary code in 'math_fns' can import
the values for itself.


@@ -270,11 +270,11 @@
         cdp = relax_data_store[relax_data_store.current_pipe]

         # Test if sequence data is loaded.
-        if not relax_data_store.res.has_key(self.run):
+        if not cdp.res.has_key:
             return 0

This again requires the call to exists_mol_res_spin_data().


         # Return the number of residues.
-        return len(relax_data_store.res[self.run])
+        return len(cdp.res)



Actually the whole contents of the num_instances() method can be
replaced with a call to generic_fns.selection.count_spins()

I'll comment on the rest in a separate post to keep things short.

Regards,

Edward



Related Messages


Powered by MHonArc, Updated Fri Jan 11 22:03:00 2008