mailr8478 - /branches/multi_structure/generic_fns/structure/api_base.py


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

Header


Content

Posted by edward on January 15, 2009 - 17:12:
Author: bugman
Date: Thu Jan 15 17:12:46 2009
New Revision: 8478

URL: http://svn.gna.org/viewcvs/relax?rev=8478&view=rev
Log:
Created the validate() method.


Modified:
    branches/multi_structure/generic_fns/structure/api_base.py

Modified: branches/multi_structure/generic_fns/structure/api_base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_structure/generic_fns/structure/api_base.py?rev=8478&r1=8477&r2=8478&view=diff
==============================================================================
--- branches/multi_structure/generic_fns/structure/api_base.py (original)
+++ branches/multi_structure/generic_fns/structure/api_base.py Thu Jan 15 
17:12:46 2009
@@ -682,6 +682,21 @@
         raise RelaxImplementError
 
 
+    def validate(self):
+        """Check the integrity of the structural data.
+
+        The number of molecules must be the same in all models.
+        """
+
+        # Reference number of molecules.
+        num_mols = len(self.structural_data[0].mol)
+
+        # Loop over all other models.
+        for i in range(1, len(self.structural_data)+1):
+            if num_mols != len(self.structural_data[i].mol):
+                raise RelaxError, "The structural object is not valid - the 
number of molecules is not the same for all models."
+
+
 
 class ModelList(list):
     """List type data container for the different structural models.




Related Messages


Powered by MHonArc, Updated Thu Jan 15 17:20:03 2009