mailr9956 - /1.3/specific_fns/hybrid.py


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

Header


Content

Posted by edward on November 25, 2009 - 09:38:
Author: bugman
Date: Wed Nov 25 09:38:44 2009
New Revision: 9956

URL: http://svn.gna.org/viewcvs/relax?rev=9956&view=rev
Log:
Separation of the private and API methods in the hybrid specific analysis.


Modified:
    1.3/specific_fns/hybrid.py

Modified: 1.3/specific_fns/hybrid.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/hybrid.py?rev=9956&r1=9955&r2=9956&view=diff
==============================================================================
--- 1.3/specific_fns/hybrid.py (original)
+++ 1.3/specific_fns/hybrid.py Wed Nov 25 09:38:44 2009
@@ -30,6 +30,47 @@
 
 class Hybrid:
     """Class containing function specific to hybrid models."""
+
+    def _hybridise(self, hybrid=None, pipe_list=None):
+        """Create the hybrid data pipe.
+
+        @keyword hybrid:    The name of the new hybrid data pipe.
+        @type hybrid:       str
+        @keyword pipe_list: The list of data pipes that the hybrid is 
composed of.
+        @type pipe_list:    list of str
+        """
+
+        # Test if the hybrid data pipe already exists.
+        if hybrid in pipes.pipe_names():
+            raise RelaxPipeError(hybrid)
+
+        # Loop over the pipes to be hybridised and check them.
+        pipe_type = pipes.get_type(pipe_list[0])
+        for pipe in pipe_list:
+            # Switch to the data pipe.
+            pipes.switch(pipe)
+
+            # Test if the pipe exists.
+            pipes.test()
+
+            # Check that the pipe types match.
+            if pipes.get_type() != pipe_type:
+                raise RelaxError("The data pipe types do not match.")
+
+            # Test if sequence data is loaded.
+            if not exists_mol_res_spin_data():
+                raise RelaxNoSequenceError
+
+        # Check that the sequence data matches in all pipes.
+        for i in range(1, len(pipe_list)):
+            compare_sequence(pipe_list[0], pipe_list[1])
+
+        # Create the data pipe.
+        pipes.create(pipe_name=hybrid, pipe_type='hybrid')
+
+        # Store the pipe list forming the hybrid.
+        cdp.hybrid_pipes = pipe_list
+
 
     def duplicate_data(self, pipe_from=None, pipe_to=None, model_info=None, 
global_stats=False, verbose=True):
         """Duplicate the data specific to a single hybrid data pipe.
@@ -60,47 +101,6 @@
 
         # Duplicate the hybrid pipe list data structure.
         dp_to.hybrid_pipes = dp_from.hybrid_pipes
-
-
-    def _hybridise(self, hybrid=None, pipe_list=None):
-        """Create the hybrid data pipe.
-
-        @keyword hybrid:    The name of the new hybrid data pipe.
-        @type hybrid:       str
-        @keyword pipe_list: The list of data pipes that the hybrid is 
composed of.
-        @type pipe_list:    list of str
-        """
-
-        # Test if the hybrid data pipe already exists.
-        if hybrid in pipes.pipe_names():
-            raise RelaxPipeError(hybrid)
-
-        # Loop over the pipes to be hybridised and check them.
-        pipe_type = pipes.get_type(pipe_list[0])
-        for pipe in pipe_list:
-            # Switch to the data pipe.
-            pipes.switch(pipe)
-
-            # Test if the pipe exists.
-            pipes.test()
-
-            # Check that the pipe types match.
-            if pipes.get_type() != pipe_type:
-                raise RelaxError("The data pipe types do not match.")
-
-            # Test if sequence data is loaded.
-            if not exists_mol_res_spin_data():
-                raise RelaxNoSequenceError
-
-        # Check that the sequence data matches in all pipes.
-        for i in range(1, len(pipe_list)):
-            compare_sequence(pipe_list[0], pipe_list[1])
-
-        # Create the data pipe.
-        pipes.create(pipe_name=hybrid, pipe_type='hybrid')
-
-        # Store the pipe list forming the hybrid.
-        cdp.hybrid_pipes = pipe_list
 
 
     def model_desc(self, model_info):




Related Messages


Powered by MHonArc, Updated Wed Nov 25 09:40:02 2009